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 and their utilities:

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.

FourierDecomposeTransform(k[, in_column, ...])

Transform that uses Fourier transformation to estimate series decomposition.

ModelDecomposeTransform(model[, in_column, ...])

Transform that uses ETNA models to estimate series decomposition.

decomposition.RupturesChangePointsModel(...)

RupturesChangePointsModel is ruptures change point models adapter.

decomposition.StatisticsPerIntervalModel(...)

StatisticsPerIntervalModel gets statistics from series and use them for prediction.

decomposition.MeanPerIntervalModel()

MeanPerIntervalModel.

decomposition.MedianPerIntervalModel()

MedianPerIntervalModel.

decomposition.SklearnPreprocessingPerIntervalModel(...)

SklearnPreprocessingPerIntervalModel applies PerIntervalModel interface for sklearn preprocessings.

decomposition.SklearnRegressionPerIntervalModel([model])

SklearnRegressionPerIntervalModel applies PerIntervalModel interface for sklearn-like regression models.

Categorical encoding transforms:

SegmentEncoderTransform()

Encode segment label to categorical.

MeanEncoderTransform(in_column, out_column)

Makes encoding of categorical feature.

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[, ...])

Encode categorical feature as a one-hot numeric features.

Embedding transforms and their utilities:

EmbeddingSegmentTransform(in_columns, ...[, ...])

Create the constant embedding features using embedding model.

EmbeddingWindowTransform(in_columns, ...[, ...])

Create the embedding features for each timestamp using embedding model.

embeddings.models.TS2VecEmbeddingModel(...)

TS2Vec embedding model.

embeddings.models.TSTCCEmbeddingModel(input_dims)

TSTCC embedding model.

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.

IForestOutlierTransform(in_column[, ...])

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

IQROutlierTransform([in_column, ...])

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

MADOutlierTransform([in_column, ...])

Transform that uses get_anomalies_mad() 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, mode, ...])

HolidayTransform generates series that indicates holidays in given dataset.

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

Adds fourier features to the dataset.

EventTransform(in_column, out_column, n_pre, ...)

EventTransform marks days before and after event depending on mode.

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 and their utilities:

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

LambdaTransform applies input function for given series.

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

AddConstTransform add constant for given series.

BinaryOperationTransform(left_column, ...[, ...])

Perform binary operation on the columns of dataset.

BinaryOperator(value)

Enum for mathematical operators from pandas.

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.

LimitTransform(in_column[, lower_bound, ...])

LimitTransform limits values of some feature between the borders (lower_bound - tol, upper_bound + tol).