library.phases.phases_implementation.data_preprocessing.class_imbalance module¶
- class library.phases.phases_implementation.data_preprocessing.class_imbalance.ClassImbalance(dataset: Dataset)[source]¶
Bases:
object
- class_imbalance(method: str = 'SMOTE', save_plots: bool = False, save_path: str = None) str [source]¶
Balances classes via SMOTE and optionally plots the distributions before and after resampling.
- Parameters:
method (str) – The method to use for balancing classes.
save_plots (bool) – Whether to save plots of class counts before/after SMOTE
save_path (str) – The path to save the plots
- Returns:
Summary of the balancing operation
- Return type:
str