tensortrade.pipeline.transformers.correlation_absolute module

class tensortrade.pipeline.transformers.correlation_absolute.CorrelationAbsoluteTransformer(num_features: int = 20, *, price_column: str = 'close')[source]

Bases: AbstractTransformer

Transformer that removes features based on their correlation.

It creates a rank based on the correlation and removes the features with the highest correlation. Then it returns num_features with the least correlation.

Params num_features:

The number of features that should be returned. (Default = 20)

Params price_column:

The price column, that should not be removed. (Default = ‘close’)

transform(df: DataFrame) DataFrame[source]

Transforms the input DataFrame by returning the least correlating features.

Parameters:

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

Returns:

A DataFrame with the least correlating features.

Return type:

DataFrame