Skip to content

Commit

Permalink
Update doc string
Browse files Browse the repository at this point in the history
  • Loading branch information
Guillaume Lemaitre committed Jan 1, 2017
1 parent cc82b1f commit 352cc90
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 15 deletions.
2 changes: 1 addition & 1 deletion imblearn/combine/smote_enn.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ class SMOTEENN(BaseBinarySampler):
>>> sme = SMOTEENN(random_state=42)
>>> X_res, y_res = sme.fit_sample(X, y)
>>> print('Resampled dataset shape {}'.format(Counter(y_res)))
Resampled dataset shape Counter({0: 900, 1: 865})
Resampled dataset shape Counter({0: 900, 1: 881})
References
----------
Expand Down
2 changes: 1 addition & 1 deletion imblearn/over_sampling/adasyn.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class ADASYN(BaseBinarySampler):
>>> ada = ADASYN(random_state=42)
>>> X_res, y_res = ada.fit_sample(X, y)
>>> print('Resampled dataset shape {}'.format(Counter(y_res)))
Resampled dataset shape Counter({0: 909, 1: 900})
Resampled dataset shape Counter({0: 904, 1: 900})
References
----------
Expand Down
6 changes: 3 additions & 3 deletions imblearn/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,10 @@ class Pipeline(pipeline.Pipeline):
>>> print(classification_report(y_test, y_hat))
precision recall f1-score support
<BLANKLINE>
0 0.71 1.00 0.83 24
1 1.00 0.96 0.98 226
0 0.87 1.00 0.93 26
1 1.00 0.98 0.99 224
<BLANKLINE>
avg / total 0.97 0.96 0.96 250
avg / total 0.99 0.98 0.98 250
<BLANKLINE>
"""
Expand Down
6 changes: 3 additions & 3 deletions imblearn/under_sampling/edited_nearest_neighbours.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ class EditedNearestNeighbours(BaseMulticlassSampler):
>>> enn = EditedNearestNeighbours(random_state=42)
>>> X_res, y_res = enn.fit_sample(X, y)
>>> print('Resampled dataset shape {}'.format(Counter(y_res)))
Resampled dataset shape Counter({1: 883, 0: 100})
Resampled dataset shape Counter({1: 887, 0: 100})
References
----------
Expand Down Expand Up @@ -331,7 +331,7 @@ class RepeatedEditedNearestNeighbours(BaseMulticlassSampler):
>>> renn = RepeatedEditedNearestNeighbours(random_state=42)
>>> X_res, y_res = renn.fit_sample(X, y)
>>> print('Resampled dataset shape {}'.format(Counter(y_res)))
Resampled dataset shape Counter({1: 883, 0: 100})
Resampled dataset shape Counter({1: 887, 0: 100})
References
----------
Expand Down Expand Up @@ -576,7 +576,7 @@ class AllKNN(BaseMulticlassSampler):
>>> allknn = AllKNN(random_state=42)
>>> X_res, y_res = allknn.fit_sample(X, y)
>>> print('Resampled dataset shape {}'.format(Counter(y_res)))
Resampled dataset shape Counter({1: 883, 0: 100})
Resampled dataset shape Counter({1: 887, 0: 100})
References
----------
Expand Down
9 changes: 4 additions & 5 deletions imblearn/under_sampling/instance_hardness_threshold.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,17 +103,16 @@ class InstanceHardnessThreshold(BaseBinarySampler):
>>> from collections import Counter
>>> from sklearn.datasets import make_classification
>>> from imblearn.under_sampling import \
RepeatedEditedNearestNeighbours # doctest: +NORMALIZE_WHITESPACE
>>> from imblearn.under_sampling import InstanceHardnessThreshold
>>> X, y = make_classification(n_classes=2, class_sep=2,
... weights=[0.1, 0.9], n_informative=3, n_redundant=1, flip_y=0,
... n_features=20, n_clusters_per_class=1, n_samples=1000, random_state=10)
>>> print('Original dataset shape {}'.format(Counter(y)))
Original dataset shape Counter({1: 900, 0: 100})
>>> renn = RepeatedEditedNearestNeighbours(random_state=42)
>>> X_res, y_res = renn.fit_sample(X, y)
>>> iht = InstanceHardnessThreshold(random_state=42)
>>> X_res, y_res = iht.fit_sample(X, y)
>>> print('Resampled dataset shape {}'.format(Counter(y_res)))
Resampled dataset shape Counter({1: 883, 0: 100})
Resampled dataset shape Counter({1: 811, 0: 100})
References
----------
Expand Down
2 changes: 1 addition & 1 deletion imblearn/under_sampling/neighbourhood_cleaning_rule.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class NeighbourhoodCleaningRule(BaseMulticlassSampler):
>>> ncr = NeighbourhoodCleaningRule(random_state=42)
>>> X_res, y_res = ncr.fit_sample(X, y)
>>> print('Resampled dataset shape {}'.format(Counter(y_res)))
Resampled dataset shape Counter({1: 884, 0: 100})
Resampled dataset shape Counter({1: 891, 0: 100})
References
----------
Expand Down
2 changes: 1 addition & 1 deletion imblearn/under_sampling/one_sided_selection.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class OneSidedSelection(BaseBinarySampler):
>>> oss = OneSidedSelection(random_state=42)
>>> X_res, y_res = oss.fit_sample(X, y)
>>> print('Resampled dataset shape {}'.format(Counter(y_res)))
Resampled dataset shape Counter({1: 595, 0: 100})
Resampled dataset shape Counter({1: 496, 0: 100})
References
----------
Expand Down

0 comments on commit 352cc90

Please sign in to comment.