tensortrade.features.feature_pipeline module¶
-
class
tensortrade.features.feature_pipeline.
FeaturePipeline
(steps, **kwargs)[source]¶ Bases:
object
An pipeline for transforming observation data frames into features for learning.
-
__init__
(steps, **kwargs)[source]¶ - Parameters
dtype – The dtype elements in the pipeline should be cast to.
-
property
dtype
¶ The dtype that elements in the pipeline should be input and output as.
-
property
steps
¶ A list of feature transformations to apply to observations.
- Return type
-
transform
(observation, input_space)[source]¶ Apply the pipeline of feature transformations to an observation frame.
- Parameters
observation (
DataFrame
) – A pandas.DataFrame corresponding to an observation within a TradingEnvironment.input_space (
Space
) – A gym.Space matching the shape of the pipeline’s input.
- Return type
DataFrame
- Returns
A pandas.DataFrame of features corresponding to an input oversvation.
- Raises
ValueError – In the case that an invalid observation frame has been input.
-