From a56c4ba396722dd2b023d42a231cf1eefeef175f Mon Sep 17 00:00:00 2001 From: Guillaume Lemaitre Date: Wed, 29 Mar 2017 10:34:07 +0200 Subject: [PATCH 1/8] MAINT change organisation under-sampling --- imblearn/under_sampling/__init__.py | 25 +++++++++++-------- .../prototype_generation/__init__.py | 11 ++++++++ .../cluster_centroids.py | 2 +- .../prototype_generation/tests/__init__.py | 0 .../prototype_selection/__init__.py | 23 +++++++++++++++++ .../condensed_nearest_neighbour.py | 2 +- .../edited_nearest_neighbours.py | 4 +-- .../instance_hardness_threshold.py | 2 +- .../{ => prototype_selection}/nearmiss.py | 4 +-- .../neighbourhood_cleaning_rule.py | 4 +-- .../one_sided_selection.py | 2 +- .../random_under_sampler.py | 2 +- .../prototype_selection/tests/__init__.py | 0 .../{ => prototype_selection}/tomek_links.py | 2 +- 14 files changed, 60 insertions(+), 23 deletions(-) create mode 100644 imblearn/under_sampling/prototype_generation/__init__.py rename imblearn/under_sampling/{ => prototype_generation}/cluster_centroids.py (99%) create mode 100644 imblearn/under_sampling/prototype_generation/tests/__init__.py create mode 100644 imblearn/under_sampling/prototype_selection/__init__.py rename imblearn/under_sampling/{ => prototype_selection}/condensed_nearest_neighbour.py (99%) rename imblearn/under_sampling/{ => prototype_selection}/edited_nearest_neighbours.py (99%) rename imblearn/under_sampling/{ => prototype_selection}/instance_hardness_threshold.py (99%) rename imblearn/under_sampling/{ => prototype_selection}/nearmiss.py (99%) rename imblearn/under_sampling/{ => prototype_selection}/neighbourhood_cleaning_rule.py (98%) rename imblearn/under_sampling/{ => prototype_selection}/one_sided_selection.py (99%) rename imblearn/under_sampling/{ => prototype_selection}/random_under_sampler.py (99%) create mode 100644 imblearn/under_sampling/prototype_selection/tests/__init__.py rename imblearn/under_sampling/{ => prototype_selection}/tomek_links.py (99%) diff --git a/imblearn/under_sampling/__init__.py b/imblearn/under_sampling/__init__.py index f1f235fb4..cedd9562e 100644 --- a/imblearn/under_sampling/__init__.py +++ b/imblearn/under_sampling/__init__.py @@ -3,17 +3,20 @@ a dataset. """ -from .random_under_sampler import RandomUnderSampler -from .tomek_links import TomekLinks -from .cluster_centroids import ClusterCentroids -from .nearmiss import NearMiss -from .condensed_nearest_neighbour import CondensedNearestNeighbour -from .one_sided_selection import OneSidedSelection -from .neighbourhood_cleaning_rule import NeighbourhoodCleaningRule -from .edited_nearest_neighbours import EditedNearestNeighbours -from .edited_nearest_neighbours import RepeatedEditedNearestNeighbours -from .edited_nearest_neighbours import AllKNN -from .instance_hardness_threshold import InstanceHardnessThreshold +from . import prototype_generation +from .prototype_generation import ClusterCentroids + +from . import prototype_selection +from .prototype_selection import RandomUnderSampler +from .prototype_selection import TomekLinks +from .prototype_selection import NearMiss +from .prototype_selection import CondensedNearestNeighbour +from .prototype_selection import OneSidedSelection +from .prototype_selection import NeighbourhoodCleaningRule +from .prototype_selection import EditedNearestNeighbours +from .prototype_selection import RepeatedEditedNearestNeighbours +from .prototype_selection import AllKNN +from .prototype_selection import InstanceHardnessThreshold __all__ = [ 'RandomUnderSampler', 'TomekLinks', 'ClusterCentroids', 'NearMiss', diff --git a/imblearn/under_sampling/prototype_generation/__init__.py b/imblearn/under_sampling/prototype_generation/__init__.py new file mode 100644 index 000000000..a09ed1458 --- /dev/null +++ b/imblearn/under_sampling/prototype_generation/__init__.py @@ -0,0 +1,11 @@ +""" +The :mod:`imblearn.under_sampling.prototype_generation` submodule +contains the method in which a new samples are generated such that the +dataset become more balanced. +""" + +from .cluster_centroids import ClusterCentroids + +__all__ = [ + 'ClusterCentroids' +] diff --git a/imblearn/under_sampling/cluster_centroids.py b/imblearn/under_sampling/prototype_generation/cluster_centroids.py similarity index 99% rename from imblearn/under_sampling/cluster_centroids.py rename to imblearn/under_sampling/prototype_generation/cluster_centroids.py index 001903cb6..62fc49767 100644 --- a/imblearn/under_sampling/cluster_centroids.py +++ b/imblearn/under_sampling/prototype_generation/cluster_centroids.py @@ -13,7 +13,7 @@ import numpy as np from sklearn.cluster import KMeans -from ..base import BaseMulticlassSampler +from ...base import BaseMulticlassSampler class ClusterCentroids(BaseMulticlassSampler): diff --git a/imblearn/under_sampling/prototype_generation/tests/__init__.py b/imblearn/under_sampling/prototype_generation/tests/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/imblearn/under_sampling/prototype_selection/__init__.py b/imblearn/under_sampling/prototype_selection/__init__.py new file mode 100644 index 000000000..dfa09e432 --- /dev/null +++ b/imblearn/under_sampling/prototype_selection/__init__.py @@ -0,0 +1,23 @@ +""" +The :mod:`imblearn.under_sampling.prototype_selection` submodule +contains the method in which a subset of the original data a selected +to create a new dataset. +""" + +from .random_under_sampler import RandomUnderSampler +from .tomek_links import TomekLinks +from .nearmiss import NearMiss +from .condensed_nearest_neighbour import CondensedNearestNeighbour +from .one_sided_selection import OneSidedSelection +from .neighbourhood_cleaning_rule import NeighbourhoodCleaningRule +from .edited_nearest_neighbours import EditedNearestNeighbours +from .edited_nearest_neighbours import RepeatedEditedNearestNeighbours +from .edited_nearest_neighbours import AllKNN +from .instance_hardness_threshold import InstanceHardnessThreshold + +__all__ = [ + 'RandomUnderSampler', 'TomekLinks', 'NearMiss', + 'CondensedNearestNeighbour', 'OneSidedSelection', + 'NeighbourhoodCleaningRule', 'EditedNearestNeighbours', + 'RepeatedEditedNearestNeighbours', 'AllKNN', 'InstanceHardnessThreshold' +] diff --git a/imblearn/under_sampling/condensed_nearest_neighbour.py b/imblearn/under_sampling/prototype_selection/condensed_nearest_neighbour.py similarity index 99% rename from imblearn/under_sampling/condensed_nearest_neighbour.py rename to imblearn/under_sampling/prototype_selection/condensed_nearest_neighbour.py index f47ba2dc6..6d1141807 100644 --- a/imblearn/under_sampling/condensed_nearest_neighbour.py +++ b/imblearn/under_sampling/prototype_selection/condensed_nearest_neighbour.py @@ -13,7 +13,7 @@ from sklearn.neighbors import KNeighborsClassifier from sklearn.utils import check_random_state -from ..base import BaseMulticlassSampler +from ...base import BaseMulticlassSampler class CondensedNearestNeighbour(BaseMulticlassSampler): diff --git a/imblearn/under_sampling/edited_nearest_neighbours.py b/imblearn/under_sampling/prototype_selection/edited_nearest_neighbours.py similarity index 99% rename from imblearn/under_sampling/edited_nearest_neighbours.py rename to imblearn/under_sampling/prototype_selection/edited_nearest_neighbours.py index 25f11f56d..0a56dab48 100644 --- a/imblearn/under_sampling/edited_nearest_neighbours.py +++ b/imblearn/under_sampling/prototype_selection/edited_nearest_neighbours.py @@ -14,8 +14,8 @@ import numpy as np from scipy.stats import mode -from ..base import BaseMulticlassSampler -from ..utils import check_neighbors_object +from ...base import BaseMulticlassSampler +from ...utils import check_neighbors_object SEL_KIND = ('all', 'mode') diff --git a/imblearn/under_sampling/instance_hardness_threshold.py b/imblearn/under_sampling/prototype_selection/instance_hardness_threshold.py similarity index 99% rename from imblearn/under_sampling/instance_hardness_threshold.py rename to imblearn/under_sampling/prototype_selection/instance_hardness_threshold.py index b0ffab5a5..f3f50b2c2 100644 --- a/imblearn/under_sampling/instance_hardness_threshold.py +++ b/imblearn/under_sampling/prototype_selection/instance_hardness_threshold.py @@ -17,7 +17,7 @@ from sklearn.ensemble import RandomForestClassifier from sklearn.externals.six import string_types -from ..base import BaseBinarySampler +from ...base import BaseBinarySampler def _get_cv_splits(X, y, cv, random_state): diff --git a/imblearn/under_sampling/nearmiss.py b/imblearn/under_sampling/prototype_selection/nearmiss.py similarity index 99% rename from imblearn/under_sampling/nearmiss.py rename to imblearn/under_sampling/prototype_selection/nearmiss.py index af0eba576..59b9ba6c3 100644 --- a/imblearn/under_sampling/nearmiss.py +++ b/imblearn/under_sampling/prototype_selection/nearmiss.py @@ -11,8 +11,8 @@ import numpy as np -from ..base import BaseMulticlassSampler -from ..utils import check_neighbors_object +from ...base import BaseMulticlassSampler +from ...utils import check_neighbors_object class NearMiss(BaseMulticlassSampler): diff --git a/imblearn/under_sampling/neighbourhood_cleaning_rule.py b/imblearn/under_sampling/prototype_selection/neighbourhood_cleaning_rule.py similarity index 98% rename from imblearn/under_sampling/neighbourhood_cleaning_rule.py rename to imblearn/under_sampling/prototype_selection/neighbourhood_cleaning_rule.py index fd03ea46d..5e758e6fa 100644 --- a/imblearn/under_sampling/neighbourhood_cleaning_rule.py +++ b/imblearn/under_sampling/prototype_selection/neighbourhood_cleaning_rule.py @@ -10,8 +10,8 @@ import numpy as np -from ..base import BaseMulticlassSampler -from ..utils import check_neighbors_object +from ...base import BaseMulticlassSampler +from ...utils import check_neighbors_object class NeighbourhoodCleaningRule(BaseMulticlassSampler): diff --git a/imblearn/under_sampling/one_sided_selection.py b/imblearn/under_sampling/prototype_selection/one_sided_selection.py similarity index 99% rename from imblearn/under_sampling/one_sided_selection.py rename to imblearn/under_sampling/prototype_selection/one_sided_selection.py index 1d643a603..e62c8851d 100644 --- a/imblearn/under_sampling/one_sided_selection.py +++ b/imblearn/under_sampling/prototype_selection/one_sided_selection.py @@ -12,7 +12,7 @@ from sklearn.neighbors import KNeighborsClassifier, NearestNeighbors from sklearn.utils import check_random_state -from ..base import BaseBinarySampler +from ...base import BaseBinarySampler from .tomek_links import TomekLinks diff --git a/imblearn/under_sampling/random_under_sampler.py b/imblearn/under_sampling/prototype_selection/random_under_sampler.py similarity index 99% rename from imblearn/under_sampling/random_under_sampler.py rename to imblearn/under_sampling/prototype_selection/random_under_sampler.py index fcf04b19e..40a9b85bc 100644 --- a/imblearn/under_sampling/random_under_sampler.py +++ b/imblearn/under_sampling/prototype_selection/random_under_sampler.py @@ -11,7 +11,7 @@ import numpy as np from sklearn.utils import check_random_state -from ..base import BaseMulticlassSampler +from ...base import BaseMulticlassSampler class RandomUnderSampler(BaseMulticlassSampler): diff --git a/imblearn/under_sampling/prototype_selection/tests/__init__.py b/imblearn/under_sampling/prototype_selection/tests/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/imblearn/under_sampling/tomek_links.py b/imblearn/under_sampling/prototype_selection/tomek_links.py similarity index 99% rename from imblearn/under_sampling/tomek_links.py rename to imblearn/under_sampling/prototype_selection/tomek_links.py index 766cbe1fb..276efd812 100644 --- a/imblearn/under_sampling/tomek_links.py +++ b/imblearn/under_sampling/prototype_selection/tomek_links.py @@ -12,7 +12,7 @@ import numpy as np from sklearn.neighbors import NearestNeighbors -from ..base import BaseBinarySampler +from ...base import BaseBinarySampler class TomekLinks(BaseBinarySampler): From 3b92e4d8c7d2b1bdd338eab2de2b2e750777809f Mon Sep 17 00:00:00 2001 From: Guillaume Lemaitre Date: Thu, 6 Apr 2017 13:47:24 +0200 Subject: [PATCH 2/8] FIX conflict api doc --- doc/api.rst | 35 +++++++++++------------------------ 1 file changed, 11 insertions(+), 24 deletions(-) diff --git a/doc/api.rst b/doc/api.rst index 2fbb8bb79..d88f1547d 100644 --- a/doc/api.rst +++ b/doc/api.rst @@ -13,14 +13,22 @@ Under-sampling methods :no-members: :no-inherited-members: -Classes -------- .. currentmodule:: imblearn +Prototype generation +-------------------- + +.. autosummary:: + :toctree: generated/ + +under_sampling.ClusterCentroids + +Prototype selection +------------------- + .. autosummary:: :toctree: generated/ - under_sampling.ClusterCentroids under_sampling.CondensedNearestNeighbour under_sampling.EditedNearestNeighbours under_sampling.RepeatedEditedNearestNeighbours @@ -32,7 +40,6 @@ Classes under_sampling.RandomUnderSampler under_sampling.TomekLinks - .. _over_sampling_ref: Over-sampling methods @@ -42,8 +49,6 @@ Over-sampling methods :no-members: :no-inherited-members: -Classes -------- .. currentmodule:: imblearn .. autosummary:: @@ -63,8 +68,6 @@ Combination of over- and under-sampling methods :no-members: :no-inherited-members: -Classes -------- .. currentmodule:: imblearn .. autosummary:: @@ -83,8 +86,6 @@ Ensemble methods :no-members: :no-inherited-members: -Classes -------- .. currentmodule:: imblearn .. autosummary:: @@ -105,18 +106,10 @@ Pipeline .. currentmodule:: imblearn -Classes -------- .. autosummary:: :toctree: generated/ pipeline.Pipeline - -Functions ---------- -.. autosummary:: - :toctree: generated/ - pipeline.make_pipeline .. _metrics_ref: @@ -130,8 +123,6 @@ Metrics .. currentmodule:: imblearn -Functions ---------- .. autosummary:: :toctree: generated/ @@ -152,8 +143,6 @@ Datasets .. currentmodule:: imblearn -Functions ---------- .. autosummary:: :toctree: generated/ @@ -169,8 +158,6 @@ Utilities .. currentmodule:: imblearn -Functions ---------- .. autosummary:: :toctree: generated/ From 56cce6e0f218ca623cb2fe2720f5cccb276c05fe Mon Sep 17 00:00:00 2001 From: Guillaume Lemaitre Date: Wed, 29 Mar 2017 16:25:42 +0200 Subject: [PATCH 3/8] DOC add entry in whats new --- doc/whats_new.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/doc/whats_new.rst b/doc/whats_new.rst index d08b1f526..eb467c528 100644 --- a/doc/whats_new.rst +++ b/doc/whats_new.rst @@ -42,6 +42,9 @@ API changes summary errors. By `Guillaume Lemaitre`_. - creation of a module `utils.validation` to make checking of recurrent patterns. By `Guillaume Lemaitre`_. +- move the under-sampling methods in `prototype_selection` and + `prototype_generation` submodule to make a clearer dinstinction. By + `Guillaume Lemaitre`_. .. _changes_0_2: From ccbbb2895c9cc6f24882ebfee8f28ca946893bae Mon Sep 17 00:00:00 2001 From: Guillaume Lemaitre Date: Wed, 29 Mar 2017 21:08:27 +0200 Subject: [PATCH 4/8] FIX indent in the documentation --- doc/api.rst | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/doc/api.rst b/doc/api.rst index d88f1547d..81f9e60fa 100644 --- a/doc/api.rst +++ b/doc/api.rst @@ -18,14 +18,22 @@ Under-sampling methods Prototype generation -------------------- +.. automodule:: imblearn.under_sampling.prototype_generation + :no-members: + :no-inherited-members: + .. autosummary:: :toctree: generated/ -under_sampling.ClusterCentroids + under_sampling.ClusterCentroids Prototype selection ------------------- +.. automodule:: imblearn.under_sampling.prototype_selection + :no-members: + :no-inherited-members: + .. autosummary:: :toctree: generated/ From 6e1153e3bb2b972cb7d25e6f3e6046934d072206 Mon Sep 17 00:00:00 2001 From: Guillaume Lemaitre Date: Wed, 29 Mar 2017 21:28:01 +0200 Subject: [PATCH 5/8] FIX add current module for linking the documentation --- doc/api.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doc/api.rst b/doc/api.rst index 81f9e60fa..ce2495c3e 100644 --- a/doc/api.rst +++ b/doc/api.rst @@ -22,6 +22,8 @@ Prototype generation :no-members: :no-inherited-members: +.. currentmodule:: imblearn + .. autosummary:: :toctree: generated/ @@ -34,6 +36,8 @@ Prototype selection :no-members: :no-inherited-members: +.. currentmodule:: imblearn + .. autosummary:: :toctree: generated/ From a02606e65d4880d789c18fd1660f23932a9ae3ef Mon Sep 17 00:00:00 2001 From: Guillaume Lemaitre Date: Thu, 6 Apr 2017 11:18:38 +0200 Subject: [PATCH 6/8] FIX addres christos comments --- imblearn/under_sampling/prototype_generation/__init__.py | 5 ++--- imblearn/under_sampling/prototype_selection/__init__.py | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/imblearn/under_sampling/prototype_generation/__init__.py b/imblearn/under_sampling/prototype_generation/__init__.py index a09ed1458..8bbdfcd4a 100644 --- a/imblearn/under_sampling/prototype_generation/__init__.py +++ b/imblearn/under_sampling/prototype_generation/__init__.py @@ -1,7 +1,6 @@ """ -The :mod:`imblearn.under_sampling.prototype_generation` submodule -contains the method in which a new samples are generated such that the -dataset become more balanced. +The :mod:`imblearn.under_sampling.prototype_generation` submodule contains +methods that generate new samples in order to balance the dataset. """ from .cluster_centroids import ClusterCentroids diff --git a/imblearn/under_sampling/prototype_selection/__init__.py b/imblearn/under_sampling/prototype_selection/__init__.py index dfa09e432..d4494b322 100644 --- a/imblearn/under_sampling/prototype_selection/__init__.py +++ b/imblearn/under_sampling/prototype_selection/__init__.py @@ -1,7 +1,6 @@ """ -The :mod:`imblearn.under_sampling.prototype_selection` submodule -contains the method in which a subset of the original data a selected -to create a new dataset. +The :mod:`imblearn.under_sampling.prototype_selection` submodule contains +methods that select samples in order to balance the dataset. """ from .random_under_sampler import RandomUnderSampler From c34eca6fc2514d42cea2e7c97fb30fb0d4d30d93 Mon Sep 17 00:00:00 2001 From: Guillaume Lemaitre Date: Thu, 6 Apr 2017 11:21:34 +0200 Subject: [PATCH 7/8] ENH Move the tests --- .../{ => prototype_generation}/tests/test_cluster_centroids.py | 0 .../under_sampling/{ => prototype_selection}/tests/test_allknn.py | 0 .../tests/test_condensed_nearest_neighbour.py | 0 .../tests/test_edited_nearest_neighbours.py | 0 .../tests/test_instance_hardness_threshold.py | 0 .../{ => prototype_selection}/tests/test_nearmiss.py | 0 .../tests/test_neighbourhood_cleaning_rule.py | 0 .../{ => prototype_selection}/tests/test_one_sided_selection.py | 0 .../{ => prototype_selection}/tests/test_random_under_sampler.py | 0 .../tests/test_repeated_edited_nearest_neighbours.py | 0 .../{ => prototype_selection}/tests/test_tomek_links.py | 0 imblearn/under_sampling/tests/__init__.py | 0 12 files changed, 0 insertions(+), 0 deletions(-) rename imblearn/under_sampling/{ => prototype_generation}/tests/test_cluster_centroids.py (100%) rename imblearn/under_sampling/{ => prototype_selection}/tests/test_allknn.py (100%) rename imblearn/under_sampling/{ => prototype_selection}/tests/test_condensed_nearest_neighbour.py (100%) rename imblearn/under_sampling/{ => prototype_selection}/tests/test_edited_nearest_neighbours.py (100%) rename imblearn/under_sampling/{ => prototype_selection}/tests/test_instance_hardness_threshold.py (100%) rename imblearn/under_sampling/{ => prototype_selection}/tests/test_nearmiss.py (100%) rename imblearn/under_sampling/{ => prototype_selection}/tests/test_neighbourhood_cleaning_rule.py (100%) rename imblearn/under_sampling/{ => prototype_selection}/tests/test_one_sided_selection.py (100%) rename imblearn/under_sampling/{ => prototype_selection}/tests/test_random_under_sampler.py (100%) rename imblearn/under_sampling/{ => prototype_selection}/tests/test_repeated_edited_nearest_neighbours.py (100%) rename imblearn/under_sampling/{ => prototype_selection}/tests/test_tomek_links.py (100%) delete mode 100644 imblearn/under_sampling/tests/__init__.py diff --git a/imblearn/under_sampling/tests/test_cluster_centroids.py b/imblearn/under_sampling/prototype_generation/tests/test_cluster_centroids.py similarity index 100% rename from imblearn/under_sampling/tests/test_cluster_centroids.py rename to imblearn/under_sampling/prototype_generation/tests/test_cluster_centroids.py diff --git a/imblearn/under_sampling/tests/test_allknn.py b/imblearn/under_sampling/prototype_selection/tests/test_allknn.py similarity index 100% rename from imblearn/under_sampling/tests/test_allknn.py rename to imblearn/under_sampling/prototype_selection/tests/test_allknn.py diff --git a/imblearn/under_sampling/tests/test_condensed_nearest_neighbour.py b/imblearn/under_sampling/prototype_selection/tests/test_condensed_nearest_neighbour.py similarity index 100% rename from imblearn/under_sampling/tests/test_condensed_nearest_neighbour.py rename to imblearn/under_sampling/prototype_selection/tests/test_condensed_nearest_neighbour.py diff --git a/imblearn/under_sampling/tests/test_edited_nearest_neighbours.py b/imblearn/under_sampling/prototype_selection/tests/test_edited_nearest_neighbours.py similarity index 100% rename from imblearn/under_sampling/tests/test_edited_nearest_neighbours.py rename to imblearn/under_sampling/prototype_selection/tests/test_edited_nearest_neighbours.py diff --git a/imblearn/under_sampling/tests/test_instance_hardness_threshold.py b/imblearn/under_sampling/prototype_selection/tests/test_instance_hardness_threshold.py similarity index 100% rename from imblearn/under_sampling/tests/test_instance_hardness_threshold.py rename to imblearn/under_sampling/prototype_selection/tests/test_instance_hardness_threshold.py diff --git a/imblearn/under_sampling/tests/test_nearmiss.py b/imblearn/under_sampling/prototype_selection/tests/test_nearmiss.py similarity index 100% rename from imblearn/under_sampling/tests/test_nearmiss.py rename to imblearn/under_sampling/prototype_selection/tests/test_nearmiss.py diff --git a/imblearn/under_sampling/tests/test_neighbourhood_cleaning_rule.py b/imblearn/under_sampling/prototype_selection/tests/test_neighbourhood_cleaning_rule.py similarity index 100% rename from imblearn/under_sampling/tests/test_neighbourhood_cleaning_rule.py rename to imblearn/under_sampling/prototype_selection/tests/test_neighbourhood_cleaning_rule.py diff --git a/imblearn/under_sampling/tests/test_one_sided_selection.py b/imblearn/under_sampling/prototype_selection/tests/test_one_sided_selection.py similarity index 100% rename from imblearn/under_sampling/tests/test_one_sided_selection.py rename to imblearn/under_sampling/prototype_selection/tests/test_one_sided_selection.py diff --git a/imblearn/under_sampling/tests/test_random_under_sampler.py b/imblearn/under_sampling/prototype_selection/tests/test_random_under_sampler.py similarity index 100% rename from imblearn/under_sampling/tests/test_random_under_sampler.py rename to imblearn/under_sampling/prototype_selection/tests/test_random_under_sampler.py diff --git a/imblearn/under_sampling/tests/test_repeated_edited_nearest_neighbours.py b/imblearn/under_sampling/prototype_selection/tests/test_repeated_edited_nearest_neighbours.py similarity index 100% rename from imblearn/under_sampling/tests/test_repeated_edited_nearest_neighbours.py rename to imblearn/under_sampling/prototype_selection/tests/test_repeated_edited_nearest_neighbours.py diff --git a/imblearn/under_sampling/tests/test_tomek_links.py b/imblearn/under_sampling/prototype_selection/tests/test_tomek_links.py similarity index 100% rename from imblearn/under_sampling/tests/test_tomek_links.py rename to imblearn/under_sampling/prototype_selection/tests/test_tomek_links.py diff --git a/imblearn/under_sampling/tests/__init__.py b/imblearn/under_sampling/tests/__init__.py deleted file mode 100644 index e69de29bb..000000000 From caed659ca98ab2f61277015e57adf8e9f57150d0 Mon Sep 17 00:00:00 2001 From: Guillaume Lemaitre Date: Thu, 6 Apr 2017 14:23:56 +0200 Subject: [PATCH 8/8] FIX remove useless import --- imblearn/under_sampling/__init__.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/imblearn/under_sampling/__init__.py b/imblearn/under_sampling/__init__.py index cedd9562e..c38534f96 100644 --- a/imblearn/under_sampling/__init__.py +++ b/imblearn/under_sampling/__init__.py @@ -3,10 +3,8 @@ a dataset. """ -from . import prototype_generation from .prototype_generation import ClusterCentroids -from . import prototype_selection from .prototype_selection import RandomUnderSampler from .prototype_selection import TomekLinks from .prototype_selection import NearMiss