bluecast.preprocessing.category_encoder_orchestration¶
Module Contents¶
Classes¶
- class bluecast.preprocessing.category_encoder_orchestration.CategoryEncoderOrchestrator(target_col: str | float | int)¶
- fit(df: pandas.DataFrame, cat_columns: List[str | int | float], threshold: int = 5) None¶
Map categorical columns to appropriate encoder.
Measures the cardinality of each categorical column. Assign either onehot or target encoder depending on cardinality threshold. :param df: DataFrame containing the categorical columns :param cat_columns: List containing the name of categorical columns. :param threshold: If cardinality is less or equal the threshold, the column will be assigned to onehot
encoding, otherwise target encoding will be assigned.