tensortrade.pipeline.transformers.correlation_threshold module

class tensortrade.pipeline.transformers.correlation_threshold.CorrelationThresholdTransformer(threshold: float = 0.85, *, price_column: str = 'close')[source]

Bases: AbstractTransformer

Transformer that removes features based on a correlation threshold.

Params threshold:

The correlation threshold above which features are considered highly correlated and one of them will be removed. (Default = 0.85)

Params price_column:

The price column, that should not be removed.

transform(df: DataFrame) DataFrame[source]

Transforms the input DataFrame by removing features that are highly correlated.

Parameters:

df (DataFrame) – The input DataFrame containing the features.

Returns:

A DataFrame with features removed based on the correlation threshold.

Return type:

DataFrame