SegmentEncoderTransform¶
- class SegmentEncoderTransform[source]¶
Bases:
etna.transforms.base.Transform
,etna.transforms.base.FutureMixin
Encode segment label to categorical. Creates column ‘segment_code’.
- Inherited-members
Methods
fit
(df)Fit encoder on existing segment labels.
fit_transform
(df)May be reimplemented.
inverse_transform
(df)Inverse transforms dataframe.
transform
(df)Get encoded (categorical) for each segment.
Attributes
idx
- fit(df: pandas.core.frame.DataFrame) etna.transforms.encoders.segment_encoder.SegmentEncoderTransform [source]¶
Fit encoder on existing segment labels.
- Parameters
df (pandas.core.frame.DataFrame) – dataframe with data to fit label encoder.
- Returns
Fitted transform
- Return type
etna.transforms.encoders.segment_encoder.SegmentEncoderTransform