Skip to main content
Step 7: Weight of Evidence (WOE) Encoding. Implements WOE transformation to convert variables into a continuous scale relative to the binary target probability.

Parameters

inputs : WoeEncoderInput
Custom WOE configuration. If None, resolves from ‘train.stable’, ‘features.encoded.num’ and ‘features.encoded.cat’.
**kwargs : dict
Additional parameters passed to the WoeEncoder worker.
Inputs full schema can be obtained by ctx.workers.woe_encoder.spec with main params:
inputs == None→pipeline data context
train_set != None→custom train data for woe_encoder training
num_features != None→custom subset of numerical encoded vars
cat_features != None→custom subset of categorical encoded vars

Returns

WoeEncoderWorker
The populated instance of WoeEncoderWorker.
Populates attributes into the worker context:
model→ctx.workers.woe_encoder
inputs→ctx.workers.woe_encoder.spec
result→ctx.workers.woe_encoder.result
state→ctx.workers.woe_encoder.state
report→ctx.workers.woe_encoder.report
stats→ctx.workers.woe_encoder.stats
fitter→ctx.workers.woe_encoder.fitter
Registers data into the datasets context:
data→ctx.datasets.train.encoded.num
features→ctx.datasets.features.woe.encoded
features→ctx.datasets.features.woe.selected
mapping→ctx.datasets.features.woe.mapping
dropped→ctx.datasets.features.woe.dropped.encoded
encodings→ctx.datasets.encodings.woe
stats→ctx.datasets.stats.encoded.woe.encoding

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 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.
View to model report of executed worker:

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.
Direct choice and parametrization of internal fitter:
In the experimenting phase when various targets might be under testing (note that ‘target2’ must be present in the data):

Attributes

All worker attributes return None prior its execution.