A transformer for normalizing values within a feature pipeline by removing the mean and scaling to unit variance.
- A list of column names to normalize.
- The minimum value in the range to scale to.
- The maximum value in the range to scale to.
False, a new column will be added to the output for each input column.
Properties and Setters¶
Below are the functions that the
StandardNormalizer uses to effectively operate.
- Apply the pipeline of feature transformations to an observation frame.
- Resets the history of the standard scaler.
Use Case #1: Different Input Spaces
StandardNormalizer operates differently depending on if we pretransform the observation to an ndarray or keep it as a pandas dataframe.
from tensortrade.features import FeaturePipeline from tensortrade.features.scalers import StandardNormalizer from tensortrade.features.stationarity import FractionalDifference from tensortrade.features.indicators import SimpleMovingAverage price_columns = ["open", "high", "low", "close"] normalize_price = MinMaxNormalizer(price_columns) moving_averages = SimpleMovingAverage(price_columns) difference_all = FractionalDifference(difference_order=0.6) feature_pipeline = FeaturePipeline(steps=[normalize_price, moving_averages, difference_all]) exchange.feature_pipeline = feature_pipeline