tensortrade.features.scalers.standard_normalizer module

class tensortrade.features.scalers.standard_normalizer.StandardNormalizer(columns=None, feature_min=0, feature_max=1, inplace=True)[source]

Bases: tensortrade.features.feature_transformer.FeatureTransformer

A transformer for normalizing values within a feature pipeline by removing the mean and scaling to unit variance.

__init__(columns=None, feature_min=0, feature_max=1, inplace=True)[source]
Parameters
  • columns (optional) – A list of column names to normalize.

  • feature_min (optional) – The minimum value in the range to scale to.

  • feature_max (optional) – The maximum value in the range to scale to.

  • 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)[source]

Transform the data set and return a new data frame.

Parameters

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

Return type

DataFrame

Returns

A transformed data frame.

transform_space(input_space)[source]

Get the transformed output space for a given input space.

Parameters

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

Return type

Space

Returns

A gym.Space matching the shape of the pipeline’s output.