Skip to content

[WIP] ENH: Resample additional arrays apart from X and y #463

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

Open
wants to merge 16 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
DOC fix import
  • Loading branch information
glemaitre committed Aug 27, 2018
commit 9046477d70e44050e72d3637f3b354682e6eac54
1 change: 0 additions & 1 deletion doc/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -247,4 +247,3 @@ Imbalance-learn provides some fast-prototyping tools.
utils.check_neighbors_object
utils.check_ratio
utils.check_sampling_strategy
utils.hash_X_y
18 changes: 4 additions & 14 deletions examples/over-sampling/plot_comparison_over_sampling.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@
from imblearn.over_sampling import ADASYN
from imblearn.over_sampling import SMOTE, BorderlineSMOTE, SVMSMOTE
from imblearn.over_sampling import RandomOverSampler
from imblearn.base import SamplerMixin
from imblearn.utils import hash_X_y
from imblearn.base import BaseSampler

print(__doc__)

Expand Down Expand Up @@ -131,20 +130,11 @@ def plot_decision_function(X, y, clf, ax):


# Make an identity sampler
class FakeSampler(SamplerMixin):
class FakeSampler(BaseSampler):

def fit(self, X, y):
self.ratio_ = 1
self.X_hash_ = hash_X_y(X, y)
return self
_sampling_type = 'bypass'

def sample(self, X, y):
return X,

def _sample(self, X, y):
pass

def fit_resample(self, X, y):
def _fit_resample(self, X, y):
return X, y


Expand Down