Skip to main content
Step 9: ML Sample Generation & Synchronization. Acts as the final synchronization point before agent training. It applies all previously trained encoding transformation logic (Numerical, Categorical, and WOE) to create synchronized ‘ml’ versions of the training and test sets. This method ensures that the exact same encoding pipelines trained during the Encoding Phase are applied consistently across both datasets, preventing data leakage and ensuring model validity.
  • DataEncoder serves as the entry point to the agent training phase.
  • It applies all fitted encodings to transform input data into ML-ready datasets.
  • Any new data sharing the original training schema can be passed in directly without requiring a separate test split - new input data are split to train and test part.
  • Results are registered under ctx.datasets as train.ml and test.ml.

Parameters

inputs : DataEncoderInput
Custom input configuration for sample generation. If None, resolves defaults from the current pipeline state (train_set, test_set, woe_features).
**kwargs : dict
Additional parameters passed to the DataEncoder worker.
Inputs full schema can be obtained by ctx.workers.data_encoder.spec with main params:
inputs == None→pipeline data context
train_set != None→custom train data for encoding application by data_encoder
test_set != None→custom test for encoding application by data_encoder
woe_features != None→optional subset of woe features

Returns

DataEncoderWorker
The populated instance of DataEncoderWorker.
Populates attributes into the worker context:
model→ctx.workers.data_encoder
inputs→ctx.workers.data_encoder.spec
result→ctx.workers.data_encoder.result
state→ctx.workers.data_encoder.state
stats→ctx.workers.data_encoder.stats
fitter→ctx.workers.data_encoder.fitter
Registers data into the datasets context:
data→ctx.datasets.train.ml
data→ctx.datasets.test.ml
dtypes→ctx.datasets.dtypes.ml
features→ctx.datasets.all.ml
stats→ctx.datasets.stats.ml

Examples

Defining the Project Context (Control Plane) & Project Scope:

Worker → Model → Fitter

Accessing worker’s inputs schema → parameters & types (shown in the display output):
Accessing model’s fitter options and schema → parameters & types (shown in the display output):
Executing workers with defaults → auto provided by the context:
Note that steps 0-3 and steps 4-9 can be run by ExecutionContext one-liner:
Once worker has been executed, thus its main model has been built, we have access to all populated attributes.

Model → Fitter

Once worker has been executed, we can obtain internal fitter state and its parametrization (shown in the display output):
The fitted fitter provides all populated attributes.
Use new data to apply fitted encodings to obtain ML-ready datasets:
Obtaining created ML-ready sets (auto-provided to agents):
Direct choice and parametrization of internal fitter:

Attributes

All worker attributes return None prior its execution.