@@ -127,11 +127,11 @@ nearest neighbors class. Those variants are presented in the figure below.
127
127
:align: center
128
128
129
129
130
- The parameter `` kind `` is controlling this feature and the following types are
131
- available: (i) `` 'borderline1' ``, (ii) `` 'borderline2' ``, and (iii) `` 'svm' `` ::
130
+ The :class: ` BorderlineSMOTE ` and :class: ` SVMSMOTE ` offer some variant of the SMOTE
131
+ algorithm ::
132
132
133
- >>> from imblearn.over_sampling import SMOTE, ADASYN
134
- >>> X_resampled, y_resampled = SMOTE(kind='borderline1' ).fit_sample(X, y)
133
+ >>> from imblearn.over_sampling import BorderlineSMOTE
134
+ >>> X_resampled, y_resampled = BorderlineSMOTE( ).fit_sample(X, y)
135
135
>>> print(sorted(Counter(y_resampled).items()))
136
136
[(0, 4674), (1, 4674), (2, 4674)]
137
137
@@ -168,12 +168,11 @@ interpolation will create a sample on the line between :math:`x_{i}` and
168
168
Each SMOTE variant and ADASYN differ from each other by selecting the samples
169
169
:math: `x_i` ahead of generating the new samples.
170
170
171
- The **regular ** SMOTE algorithm --- cf. to ``kind='regular' `` when
172
- instantiating a :class: `SMOTE ` object --- does not impose any rule and will
173
- randomly pick-up all possible :math: `x_i` available.
171
+ The **regular ** SMOTE algorithm --- cf. to the :class: `SMOTE ` object --- does not
172
+ impose any rule and will randomly pick-up all possible :math: `x_i` available.
174
173
175
- The **borderline ** SMOTE --- cf. to `` kind='borderline1' `` and
176
- ``kind='borderline2 ' `` when instantiating a :class: ` SMOTE ` object --- will
174
+ The **borderline ** SMOTE --- cf. to the :class: ` BorderlineSMOTE ` with the
175
+ parameters ``kind='borderline-1 ' `` and `` kind='borderline-2' `` --- will
177
176
classify each sample :math: `x_i` to be (i) noise (i.e. all nearest-neighbors
178
177
are from a different class than the one of :math: `x_i`), (ii) in danger
179
178
(i.e. at least half of the nearest neighbors are from the same class than
@@ -184,10 +183,9 @@ samples *in danger* to generate new samples. In **Borderline-1** SMOTE,
184
183
:math: `x_i`. On the contrary, **Borderline-2 ** SMOTE will consider
185
184
:math: `x_{zi}` which can be from any class.
186
185
187
- **SVM ** SMOTE --- cf. to ``kind='svm' `` when instantiating a :class: `SMOTE `
188
- object --- uses an SVM classifier to find support vectors and generate samples
189
- considering them. Note that the ``C `` parameter of the SVM classifier allows to
190
- select more or less support vectors.
186
+ **SVM ** SMOTE --- cf. to :class: `SVMSMOTE ` --- uses an SVM classifier to find
187
+ support vectors and generate samples considering them. Note that the ``C ``
188
+ parameter of the SVM classifier allows to select more or less support vectors.
191
189
192
190
For both borderline and SVM SMOTE, a neighborhood is defined using the
193
191
parameter ``m_neighbors `` to decide if a sample is in danger, safe, or noise.
@@ -196,7 +194,7 @@ ADASYN is working similarly to the regular SMOTE. However, the number of
196
194
samples generated for each :math: `x_i` is proportional to the number of samples
197
195
which are not from the same class than :math: `x_i` in a given
198
196
neighborhood. Therefore, more samples will be generated in the area that the
199
- nearest neighbor rule is not respected. The parameter ``n_neighbors `` is
197
+ nearest neighbor rule is not respected. The parameter ``m_neighbors `` is
200
198
equivalent to ``k_neighbors `` in :class: `SMOTE `.
201
199
202
200
Multi-class management
0 commit comments