From 25c5f86f5dd1ff49f42eb350f5286a6c6e081f17 Mon Sep 17 00:00:00 2001 From: sujal Date: Sat, 21 Nov 2026 20:32:14 +0530 Subject: [PATCH] Add space before colon in RareLabelEncoder docstrings --- feature_engine/encoding/rare_label.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/feature_engine/encoding/rare_label.py b/feature_engine/encoding/rare_label.py index 03e805537..c922c8079 100644 --- a/feature_engine/encoding/rare_label.py +++ b/feature_engine/encoding/rare_label.py @@ -74,22 +74,22 @@ class RareLabelEncoder(CategoricalMethodsMixin, CategoricalInitMixinNA): Parameters ---------- - tol: float, default=0.05 + tol : float, default=0.05 The minimum frequency a label should have to be considered frequent. Categories with frequencies lower than tol will be grouped. - n_categories: int, default=10 + n_categories : int, default=10 The minimum number of categories a variable should have for the encoder to find frequent labels. If the variable contains less categories, all of them will be considered frequent. - max_n_categories: int, default=None + max_n_categories : int, default=None The maximum number of categories that should be considered frequent. If None, all categories with frequency above the tolerance (tol) will be considered frequent. If you enter 5, only the 5 most frequent categories will be retained and the rest grouped. - replace_with: string, integer or float, default='Rare' + replace_with : string, integer or float, default='Rare' The value that will be used to replace infrequent categories. {variables} @@ -102,7 +102,7 @@ class RareLabelEncoder(CategoricalMethodsMixin, CategoricalInitMixinNA): Attributes ---------- - encoder_dict_: + encoder_dict_ : Dictionary with the frequent categories, i.e., those that will be kept, per variable. @@ -215,11 +215,11 @@ def fit(self, X: IntoDataFrame, y: Optional[IntoSeries] = None): Parameters ---------- - X: dataframe of shape = [n_samples, n_features] + X : dataframe of shape = [n_samples, n_features] The training input samples. Can be the entire dataframe, not just selected variables - y: None + y : None y is not required. You can pass y or None. """ @@ -274,12 +274,12 @@ def transform(self, X: IntoDataFrame) -> IntoDataFrame: Parameters ---------- - X: dataframe of shape = [n_samples, n_features] + X : dataframe of shape = [n_samples, n_features] The input samples. Returns ------- - X: dataframe of shape = [n_samples, n_features] + X : dataframe of shape = [n_samples, n_features] The dataframe where rare categories have been grouped. """