From 15b7a806b48870ba87eb8655cb8ceae231c0b93a Mon Sep 17 00:00:00 2001 From: Bishal Date: Sat, 13 Dec 2025 23:23:43 +0000 Subject: [PATCH] Improve SMOTE docstring with clearer explanation and example --- imblearn/over_sampling/_smote/base.py | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/imblearn/over_sampling/_smote/base.py b/imblearn/over_sampling/_smote/base.py index c008a95e6..89713d7fb 100644 --- a/imblearn/over_sampling/_smote/base.py +++ b/imblearn/over_sampling/_smote/base.py @@ -36,7 +36,30 @@ class BaseSMOTE(BaseOverSampler): - """Base class for the different SMOTE algorithms.""" + """ + Synthetic Minority Over-sampling Technique (SMOTE). + + SMOTE is an over-sampling method that generates synthetic samples + for the minority class instead of duplicating existing samples. + New samples are created by interpolating between a data point + and its nearest neighbors in feature space. + + This technique is commonly used in imbalanced classification + problems such as fraud detection, medical diagnosis, or + anomaly detection. + + Example + ------- + >>> from imblearn.over_sampling import SMOTE + >>> smote = SMOTE(random_state=42) + >>> X_resampled, y_resampled = smote.fit_resample(X, y) + + Notes + ----- + SMOTE works best when features are continuous and may not be + suitable for datasets with many categorical variables. + """ + _parameter_constraints: dict = { **BaseOverSampler._parameter_constraints,