tensortrade.features.stationarity.fractional_difference module

class tensortrade.features.stationarity.fractional_difference.FractionalDifference(columns=None, difference_order=0.5, difference_threshold=0.1, inplace=True)[source]

Bases: tensortrade.features.feature_transformer.FeatureTransformer

A transformer for differencing values within a feature pipeline by a fractional order.

__init__(columns=None, difference_order=0.5, difference_threshold=0.1, inplace=True)[source]
Parameters
  • columns (optional) – A list of column names to difference.

  • difference_order (optional) – The fractional difference order. Defaults to 0.5.

  • difference_threshold (optional) – The fractional difference threshold. Defaults to 0.1.

  • inplace (optional) – If False, a new column will be added to the output for each input column.

reset()[source]

Optionally implementable method for resetting stateful transformers.

transform(X, input_space)[source]

Transform the data set and return a new data frame.

Parameters
  • X (DataFrame) – The set of data to transform.

  • input_space (Space) – A gym.Space matching the shape of the pipeline’s input.

Return type

DataFrame

Returns

A transformed data frame.