Skip to content

DOC: Remove docstring which are not useful #454

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 23, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions doc/whats_new/v0.0.4.rst
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,15 @@ Maintenance
- Remove deprecated parameters in 0.2 - :issue:`331` by :user:`Guillaume
Lemaitre <glemaitre>`.

- Make some modules private.
:issue:`452` by :user:`Guillaume Lemaitre <glemaitre>`.

Documentation
.............

- Remove some docstring which are not necessary.
:issue:`454` by :user:`Guillaume Lemaitre <glemaitre>`.

Deprecation
...........

Expand Down
3 changes: 2 additions & 1 deletion imblearn/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ def fit_sample(self, X, y):

@abstractmethod
def _sample(self, X, y):
"""Resample the dataset.
"""Base method defined in each sampler to defined the sampling
strategy.

Parameters
----------
Expand Down
20 changes: 0 additions & 20 deletions imblearn/combine/_smote_enn.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,26 +149,6 @@ def fit(self, X, y):
return self

def _sample(self, X, y):
"""Resample the dataset.

Parameters
----------
X : {array-like, sparse matrix}, shape (n_samples, n_features)
Matrix containing the data which have to be sampled.

y : array-like, shape (n_samples,)
Corresponding label for each sample in X.

Returns
-------
X_resampled : {ndarray, sparse matrix}, shape \
(n_samples_new, n_features)
The array containing the resampled data.

y_resampled : ndarray, shape (n_samples_new)
The corresponding label of `X_resampled`

"""
self._validate_estimator()

X_res, y_res = self.smote_.fit_sample(X, y)
Expand Down
20 changes: 0 additions & 20 deletions imblearn/combine/_smote_tomek.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,26 +157,6 @@ def fit(self, X, y):
return self

def _sample(self, X, y):
"""Resample the dataset.

Parameters
----------
X : {array-like, sparse matrix}, shape (n_samples, n_features)
Matrix containing the data which have to be sampled.

y : array-like, shape (n_samples,)
Corresponding label for each sample in X.

Returns
-------
X_resampled : {ndarray, sparse matrix}, shape \
(n_samples_new, n_features)
The array containing the resampled data.

y_resampled : ndarray, shape (n_samples_new,)
The corresponding label of `X_resampled`

"""
self._validate_estimator()

X_res, y_res = self.smote_.fit_sample(X, y)
Expand Down
24 changes: 0 additions & 24 deletions imblearn/ensemble/_balance_cascade.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,30 +152,6 @@ def _validate_estimator(self):
self.logger.debug(self.estimator_)

def _sample(self, X, y):
"""Resample the dataset.

Parameters
----------
X : {array-like, sparse matrix}, shape (n_samples, n_features)
Matrix containing the data which have to be sampled.

y : array-like, shape (n_samples,)
Corresponding label for each sample in X.

Returns
-------
X_resampled : {ndarray, sparse matrix}, shape \
(n_subset, n_samples_new, n_features)
The array containing the resampled data.

y_resampled : ndarray, shape (n_subset, n_samples_new)
The corresponding label of `X_resampled`

idx_under : ndarray, shape (n_subset, n_samples, )
If `return_indices` is `True`, a boolean array will be returned
containing the which samples have been selected.

"""
self._validate_estimator()

random_state = check_random_state(self.random_state)
Expand Down
25 changes: 0 additions & 25 deletions imblearn/ensemble/_easy_ensemble.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,31 +102,6 @@ def __init__(self,
self.n_subsets = n_subsets

def _sample(self, X, y):
"""Resample the dataset.

Parameters
----------
X : {array-like, sparse matrix}, shape (n_samples, n_features)
Matrix containing the data which have to be sampled.

y : array-like, shape (n_samples,)
Corresponding label for each sample in X.

Returns
-------
X_resampled : {ndarray, sparse matrix}, shape \
(n_subset, n_samples_new, n_features)
The array containing the resampled data.

y_resampled : ndarray, shape (n_subset, n_samples_new)
The corresponding label of `X_resampled`

idx_under : ndarray, shape (n_subset, n_samples, )
If `return_indices` is `True`, a boolean array will be returned
containing the which samples have been selected.

"""

random_state = check_random_state(self.random_state)

X_resampled = []
Expand Down
21 changes: 0 additions & 21 deletions imblearn/over_sampling/_adasyn.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,27 +107,6 @@ def _validate_estimator(self):
self.nn_.set_params(**{'n_jobs': self.n_jobs})

def _sample(self, X, y):
"""Resample the dataset.

Parameters
----------
X : {array-like, sparse matrix}, shape (n_samples, n_features)
Matrix containing the data which have to be sampled.

y : array-like, shape (n_samples,)
Corresponding label for each sample in X.

Returns
-------
X_resampled : {ndarray, sparse matrix}, shape \
(n_samples_new, n_features)
The array containing the resampled data.

y_resampled : ndarray, shape (n_samples_new,)
The corresponding label of `X_resampled`


"""
self._validate_estimator()
random_state = check_random_state(self.random_state)

Expand Down
20 changes: 0 additions & 20 deletions imblearn/over_sampling/_random_over_sampler.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,26 +89,6 @@ def _check_X_y(X, y):
return X, y, binarize_y

def _sample(self, X, y):
"""Resample the dataset.

Parameters
----------
X : {array-like, sparse matrix}, shape (n_samples, n_features)
Matrix containing the data which have to be sampled.

y : array-like, shape (n_samples,)
Corresponding label for each sample in X.

Returns
-------
X_resampled : {ndarray, sparse matrix}, shape \
(n_samples_new, n_features)
The array containing the resampled data.

y_resampled : ndarray, shape (n_samples_new,)
The corresponding label of `X_resampled`

"""
random_state = check_random_state(self.random_state)
target_stats = Counter(y)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,26 +136,6 @@ def _generate_sample(self, X, y, centroids, target_class):
return X_new, y_new

def _sample(self, X, y):
"""Resample the dataset.

Parameters
----------
X : {array-like, sparse matrix}, shape (n_samples, n_features)
Matrix containing the data which have to be sampled.

y : array-like, shape (n_samples,)
Corresponding label for each sample in X.

Returns
-------
X_resampled : {ndarray, sparse matrix}, shape \
(n_samples_new, n_features)
The array containing the resampled data.

y_resampled : ndarray, shape (n_samples_new,)
The corresponding label of `X_resampled`

"""
self._validate_estimator()

if self.voting == 'auto':
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,30 +129,6 @@ def _validate_estimator(self):
' Got {} instead.'.format(type(self.n_neighbors)))

def _sample(self, X, y):
"""Resample the dataset.

Parameters
----------
X : {array-like, sparse matrix}, shape (n_samples, n_features)
Matrix containing the data which have to be sampled.

y : array-like, shape (n_samples,)
Corresponding label for each sample in X.

Returns
-------
X_resampled : {ndarray, sparse matrix}, shape \
(n_samples_new, n_features)
The array containing the resampled data.

y_resampled : ndarray, shape (n_samples_new,)
The corresponding label of `X_resampled`

idx_under : ndarray, shape (n_samples, )
If `return_indices` is `True`, a boolean array will be returned
containing the which samples have been selected.

"""
self._validate_estimator()

random_state = check_random_state(self.random_state)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,30 +139,6 @@ def _validate_estimator(self):
raise NotImplementedError

def _sample(self, X, y):
"""Resample the dataset.

Parameters
----------
X : {array-like, sparse matrix}, shape (n_samples, n_features)
Matrix containing the data which have to be sampled.

y : array-like, shape (n_samples,)
Corresponding label for each sample in X.

Returns
-------
X_resampled : {ndarray, sparse matrix}, shape \
(n_samples_new, n_features)
The array containing the resampled data.

y_resampled : ndarray, shape (n_samples_new,)
The corresponding label of `X_resampled`

idx_under : ndarray, shape (n_samples, )
If `return_indices` is `True`, a boolean array will be returned
containing the which samples have been selected.

"""
self._validate_estimator()

idx_under = np.empty((0, ), dtype=int)
Expand Down Expand Up @@ -328,31 +304,6 @@ def _validate_estimator(self):
ratio=self.ratio)

def _sample(self, X, y):
"""Resample the dataset.

Parameters
----------
X : {array-like, sparse matrix}, shape (n_samples, n_features)
Matrix containing the data which have to be sampled.

y : array-like, shape (n_samples,)
Corresponding label for each sample in X.

Returns
-------
X_resampled : {ndarray, sparse matrix}, shape \
(n_samples_new, n_features)
The array containing the resampled data.

y_resampled : ndarray, shape (n_samples_new,)
The corresponding label of `X_resampled`

idx_under : ndarray, shape (n_samples, )
If `return_indices` is `True`, a boolean array will be returned
containing the which samples have been selected.

"""

self._validate_estimator()

X_, y_ = X, y
Expand Down Expand Up @@ -539,30 +490,6 @@ def _validate_estimator(self):
ratio=self.ratio)

def _sample(self, X, y):
"""Resample the dataset.

Parameters
----------
X : {array-like, sparse matrix}, shape (n_samples, n_features)
Matrix containing the data which have to be sampled.

y : array-like, shape (n_samples,)
Corresponding label for each sample in X.

Returns
-------
X_resampled : {ndarray, sparse matrix}, shape \
(n_samples_new, n_features)
The array containing the resampled data.

y_resampled : ndarray, shape (n_samples_new,)
The corresponding label of `X_resampled`

idx_under : ndarray, shape (n_samples, )
If `return_indices` is `True`, a boolean array will be returned
containing the which samples have been selected.

"""
self._validate_estimator()

X_, y_ = X, y
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,26 +126,6 @@ def _validate_estimator(self):
type(self.estimator)))

def _sample(self, X, y):
"""Resample the dataset.

Parameters
----------
X : {array-like, sparse matrix}, shape (n_samples, n_features)
Matrix containing the data which have to be sampled.

y : array-like, shape (n_samples,)
Corresponding label for each sample in X.

The array containing the resampled data.

y_resampled : ndarray, shape (n_samples_new,)
The corresponding label of `X_resampled`

idx_under : ndarray, shape (n_samples, )
If `return_indices` is `True`, a boolean array will be returned
containing the which samples have been selected.

"""
self._validate_estimator()

target_stats = Counter(y)
Expand Down
Loading