Skip to main content

models.TargetEncoding

The encoding of each level of a factor learned from all the training

Usage

Source

models.TargetEncoding()

rows, from target_encode.

Attributes

Name Description
k The credibility constant K.
levels The levels seen in training, sorted.
ratios Each level’s credibility-weighted actual-to-expected ratio.

k

The credibility constant K.

k: float


levels

The levels seen in training, sorted.

levels: list[str]


ratios

Each level’s credibility-weighted actual-to-expected ratio.

ratios: list[float]

Methods

Name Description
encode() The encoding of each value of new data; a level not seen in

encode()

The encoding of each value of new data; a level not seen in

Usage

Source

encode(values)

training gets 1.

Parameters
values: list of str
Returns
list of float