Transforms#

Module with dataset transformations.

API details#

Base:

IrreversibleTransform(required_features)

Base class to create irreversible transforms.

ReversibleTransform(required_features)

Base class to create reversible transforms.

IrreversiblePerSegmentWrapper(transform, ...)

Class to apply irreversible transform in per segment manner.

ReversiblePerSegmentWrapper(transform, ...)

Class to apply reversible transform in per segment manner.

OneSegmentTransform()

Base class to create one segment transforms to apply to data.

Decomposition transforms:

ChangePointsLevelTransform(in_column[, ...])

Transform that makes a detrending of change-point intervals.

ChangePointsSegmentationTransform(in_column)

Transform that makes label encoding of change-point intervals.

ChangePointsTrendTransform(in_column[, ...])

Transform that makes a detrending of change-point intervals.

DeseasonalityTransform(in_column, period[, ...])

Transform that uses statsmodels.tsa.seasonal.seasonal_decompose() to subtract seasonal component from the data.

LinearTrendTransform(in_column[, poly_degree])

Transform that uses linear regression with polynomial features to make a detrending.

STLTransform(in_column, period[, model, ...])

Transform that uses statsmodels.tsa.seasonal.STL to subtract season and trend from the data.

TheilSenTrendTransform(in_column[, poly_degree])

Transform that uses Theil–Sen regression with polynomial features to make a detrending.

TrendTransform(in_column[, ...])

Transform that adds trend as a feature.

ChangePointsLevelTransform(in_column[, ...])

Transform that makes a detrending of change-point intervals.

ChangePointsSegmentationTransform(in_column)

Transform that makes label encoding of change-point intervals.

ChangePointsTrendTransform(in_column[, ...])

Transform that makes a detrending of change-point intervals.

DeseasonalityTransform(in_column, period[, ...])

Transform that uses statsmodels.tsa.seasonal.seasonal_decompose() to subtract seasonal component from the data.

LinearTrendTransform(in_column[, poly_degree])

Transform that uses linear regression with polynomial features to make a detrending.

STLTransform(in_column, period[, model, ...])

Transform that uses statsmodels.tsa.seasonal.STL to subtract season and trend from the data.

TheilSenTrendTransform(in_column[, poly_degree])

Transform that uses Theil–Sen regression with polynomial features to make a detrending.

TrendTransform(in_column[, ...])

Transform that adds trend as a feature.

Categorical encoding transforms:

SegmentEncoderTransform()

Encode segment label to categorical.

MeanSegmentEncoderTransform()

Makes expanding mean target encoding of the segment.

LabelEncoderTransform(in_column[, ...])

Encode categorical feature with value between 0 and n_classes-1.

OneHotEncoderTransform(in_column[, out_column])

Encode categorical feature as a one-hot numeric features.

Feature selection transforms:

FilterFeaturesTransform([include, exclude, ...])

Filters features in each segment of the dataframe.

TreeFeatureSelectionTransform(model, top_k)

Transform that selects features according to tree-based models feature importance.

GaleShapleyFeatureSelectionTransform(...[, ...])

Transform that provides feature filtering by Gale-Shapley matching algorithm according to the relevance table.

MRMRFeatureSelectionTransform(...[, ...])

Transform that selects features according to MRMR variable selection method adapted to the timeseries case.

Transforms to work with missing values:

TimeSeriesImputerTransform([in_column, ...])

Transform to fill NaNs in series of a given dataframe.

ResampleWithDistributionTransform(in_column, ...)

ResampleWithDistributionTransform resamples the given column using the distribution of the other column.

Transforms to detect outliers:

DensityOutliersTransform(in_column, ...)

Transform that uses get_anomalies_density() to find anomalies in data.

MedianOutliersTransform(in_column[, ...])

Transform that uses get_anomalies_median() to find anomalies in data.

PredictionIntervalOutliersTransform(...[, ...])

Transform that uses get_anomalies_prediction_interval() to find anomalies in data.

Transforms to work with time-related features:

DateFlagsTransform([day_number_in_week, ...])

DateFlagsTransform is a class that implements extraction of the main date-based features from datetime column.

TimeFlagsTransform([minute_in_hour_number, ...])

TimeFlagsTransform is a class that implements extraction of the main time-based features from datetime column.

SpecialDaysTransform([find_special_weekday, ...])

SpecialDaysTransform generates series that indicates is weekday/monthday is special in given dataframe.

HolidayTransform([iso_code, out_column])

HolidayTransform generates series that indicates holidays in given dataframe.

FourierTransform(period[, order, mods, ...])

Adds fourier features to the dataset.

Shift transforms:

LagTransform(in_column, lags[, out_column])

Generates series of lags from given dataframe.

ExogShiftTransform(lag[, horizon])

Shifts exogenous variables from a given dataframe.

Window-based transforms:

MeanTransform(in_column, window[, ...])

MeanTransform computes average value for given window.

SumTransform(in_column, window[, ...])

SumTransform computes sum of values over given window.

MedianTransform(in_column, window[, ...])

MedianTransform computes median value for given window.

MaxTransform(in_column, window[, ...])

MaxTransform computes max value for given window.

MinTransform(in_column, window[, ...])

MinTransform computes min value for given window.

QuantileTransform(in_column, quantile, window)

QuantileTransform computes quantile value for given window.

StdTransform(in_column, window[, ...])

StdTransform computes std value for given window.

MADTransform(in_column, window[, ...])

MADTransform computes Mean Absolute Deviation over the window.

MinMaxDifferenceTransform(in_column, window)

MinMaxDifferenceTransform computes difference between max and min values for given window.

Scaling transforms:

StandardScalerTransform([in_column, ...])

Standardize features by removing the mean and scaling to unit variance.

RobustScalerTransform([in_column, inplace, ...])

Scale features using statistics that are robust to outliers.

MinMaxScalerTransform([in_column, inplace, ...])

Transform features by scaling each feature to a given range.

MaxAbsScalerTransform([in_column, inplace, ...])

Scale each feature by its maximum absolute value.

Functional transforms:

LambdaTransform(in_column, transform_func[, ...])

LambdaTransform applies input function for given series.

AddConstTransform(in_column, value[, ...])

AddConstTransform add constant for given series.

LogTransform(in_column[, base, inplace, ...])

LogTransform applies logarithm transformation for given series.

YeoJohnsonTransform([in_column, inplace, ...])

YeoJohnsonTransform applies Yeo-Johns transformation to a DataFrame.

BoxCoxTransform([in_column, inplace, ...])

BoxCoxTransform applies Box-Cox transformation to DataFrame.

DifferencingTransform(in_column[, period, ...])

Calculate a time series differences.