Release 0.1.10
New Transformers Added
This release introduces five new transformers, expanding the blocks
package's functionality for data preprocessing and feature engineering.
1. RSTradeEntry
- Description: This transformer generates trade signals based on the Relative Strength Index (RSI). It identifies overbought and oversold conditions using RSI thresholds.
- Parameters:
window
: The window length for calculating RSI. Default is 14.thresh
: A tuple for RSI thresholds, default is (30, 70).
- Usage:
rsi_trade_entry = RSTradeEntry(window=14, thresh=(30, 70)) signals = rsi_trade_entry.fit_transform(data_series)
2. RSInterval
- Description: This transformer generates trade signals based on RSI intervals, differentiating between overbought and oversold conditions and their transitions.
- Parameters:
window
: The window length for calculating RSI. Default is 14.thresh
: A tuple for RSI thresholds, default is (30, 70).
- Usage:
rsi_interval = RSInterval(window=14, thresh=(30, 70)) signals = rsi_interval.fit_transform(data_series)
3. FilterCollinear
- Description: This transformer removes collinear features from the dataset based on the Variance Inflation Factor (VIF).
- Parameters:
target
: The target variable to exclude from VIF calculation. Default is None.subset
: Subset of columns to consider for collinearity. Default is None.threshold
: VIF threshold above which features are removed. Default is 5.0.
- Usage:
filter_collinear = FilterCollinear(threshold=5.0) filtered_data = filter_collinear.fit_transform(dataframe)
4. LinearImputer
- Description: This transformer performs linear interpolation to impute missing values in the dataset.
- Parameters:
subset
: Subset of columns to apply interpolation. Default is None.kwargs
: Additional arguments for pandas' interpolate method.
- Usage:
linear_imputer = LinearImputer(subset=['column1', 'column2']) imputed_data = linear_imputer.fit_transform(dataframe)
5. ForestImputer
- Description: This transformer uses Random Forests to impute missing values in the dataset.
- Parameters:
- Various parameters for customizing the random forest model used for imputation.
- Usage:
forest_imputer = ForestImputer(subset=['column1', 'column2'], n_estimators=100) imputed_data = forest_imputer.fit_transform(dataframe)
Installation
To install the latest version of the blocks
package, use:
pip install blocks==0.1.10