@@ -229,7 +229,7 @@ def __setstate__(self, dict):
229229 self .logger = logger
230230
231231
232- class BaseBinaryclassSampler (six .with_metaclass (ABCMeta , SamplerMixin )):
232+ class BaseBinarySampler (six .with_metaclass (ABCMeta , SamplerMixin )):
233233 """Base class for all binary class sampler.
234234
235235 Warning: This class should not be used directly. Use derived classes
@@ -255,36 +255,14 @@ def fit(self, X, y):
255255
256256 """
257257
258- super (BaseBinaryclassSampler , self ).fit (X , y )
258+ super (BaseBinarySampler , self ).fit (X , y )
259259
260260 # Check that the target type is binary
261261 if not type_of_target (y ) == 'binary' :
262262 warnings .warn ('The target type should be binary.' )
263263
264264 return self
265265
266- @abstractmethod
267- def _sample (self , X , y ):
268- """Resample the dataset.
269-
270- Parameters
271- ----------
272- X : ndarray, shape (n_samples, n_features)
273- Matrix containing the data which have to be sampled.
274-
275- y : ndarray, shape (n_samples, )
276- Corresponding label for each sample in X.
277-
278- Returns
279- -------
280- X_resampled : ndarray, shape (n_samples_new, n_features)
281- The array containing the resampled data.
282-
283- y_resampled : ndarray, shape (n_samples_new)
284- The corresponding label of `X_resampled`
285- """
286- pass
287-
288266
289267class BaseMulticlassSampler (six .with_metaclass (ABCMeta , SamplerMixin )):
290268 """Base class for all multiclass sampler.
@@ -320,25 +298,3 @@ def fit(self, X, y):
320298 warnings .warn ('The target type should be binary or multiclass.' )
321299
322300 return self
323-
324- @abstractmethod
325- def _sample (self , X , y ):
326- """Resample the dataset.
327-
328- Parameters
329- ----------
330- X : ndarray, shape (n_samples, n_features)
331- Matrix containing the data which have to be sampled.
332-
333- y : ndarray, shape (n_samples, )
334- Corresponding label for each sample in X.
335-
336- Returns
337- -------
338- X_resampled : ndarray, shape (n_samples_new, n_features)
339- The array containing the resampled data.
340-
341- y_resampled : ndarray, shape (n_samples_new)
342- The corresponding label of `X_resampled`
343- """
344- pass
0 commit comments