Skip to content

MAINT: create private modules when they should #452

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
4 changes: 2 additions & 2 deletions imblearn/combine/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
over-sampling and under-sampling.
"""

from .smote_enn import SMOTEENN
from .smote_tomek import SMOTETomek
from ._smote_enn import SMOTEENN
from ._smote_tomek import SMOTETomek

__all__ = ['SMOTEENN', 'SMOTETomek']
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
from __future__ import division

import logging
import warnings

from sklearn.base import clone
from sklearn.utils import check_X_y
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
from __future__ import division

import logging
import warnings

from sklearn.base import clone
from sklearn.utils import check_X_y
Expand Down
4 changes: 2 additions & 2 deletions imblearn/datasets/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
imbalanced data.
"""

from .imbalance import make_imbalance
from ._imbalance import make_imbalance

from .zenodo import fetch_datasets
from ._zenodo import fetch_datasets

__all__ = ['make_imbalance', 'fetch_datasets']
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

from sklearn.utils import check_X_y

from ..under_sampling.prototype_selection import RandomUnderSampler
from ..under_sampling import RandomUnderSampler
from ..utils import check_sampling_strategy

LOGGER = logging.getLogger(__name__)
Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions imblearn/ensemble/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
under-sampled subsets combined inside an ensemble.
"""

from .easy_ensemble import EasyEnsemble
from .balance_cascade import BalanceCascade
from ._easy_ensemble import EasyEnsemble
from ._balance_cascade import BalanceCascade

from .classifier import BalancedBaggingClassifier
from ._classifier import BalancedBaggingClassifier

__all__ = ['EasyEnsemble', 'BalancedBaggingClassifier', 'BalanceCascade']
File renamed without changes.
File renamed without changes.
12 changes: 6 additions & 6 deletions imblearn/metrics/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
metrics and pairwise metrics and distance computations.
"""

from .classification import sensitivity_specificity_support
from .classification import sensitivity_score
from .classification import specificity_score
from .classification import geometric_mean_score
from .classification import make_index_balanced_accuracy
from .classification import classification_report_imbalanced
from ._classification import sensitivity_specificity_support
from ._classification import sensitivity_score
from ._classification import specificity_score
from ._classification import geometric_mean_score
from ._classification import make_index_balanced_accuracy
from ._classification import classification_report_imbalanced

__all__ = [
'sensitivity_specificity_support', 'sensitivity_score',
Expand Down
File renamed without changes.
10 changes: 5 additions & 5 deletions imblearn/over_sampling/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
perform over-sampling.
"""

from .adasyn import ADASYN
from .random_over_sampler import RandomOverSampler
from .smote import SMOTE
from .smote import BorderlineSMOTE
from .smote import SVMSMOTE
from ._adasyn import ADASYN
from ._random_over_sampler import RandomOverSampler
from ._smote import SMOTE
from ._smote import BorderlineSMOTE
from ._smote import SVMSMOTE

__all__ = ['ADASYN', 'RandomOverSampler',
'SMOTE', 'BorderlineSMOTE', 'SVMSMOTE']
File renamed without changes.
File renamed without changes.
22 changes: 11 additions & 11 deletions imblearn/under_sampling/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@
a dataset.
"""

from .prototype_generation import ClusterCentroids
from ._prototype_generation import ClusterCentroids

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
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__ = [
'ClusterCentroids', 'RandomUnderSampler', 'InstanceHardnessThreshold',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
methods that generate new samples in order to balance the dataset.
"""

from .cluster_centroids import ClusterCentroids
from ._cluster_centroids import ClusterCentroids

__all__ = ['ClusterCentroids']
22 changes: 22 additions & 0 deletions imblearn/under_sampling/_prototype_selection/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
"""
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 ._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', 'InstanceHardnessThreshold', 'NearMiss',
'TomekLinks', 'EditedNearestNeighbours', 'RepeatedEditedNearestNeighbours',
'AllKNN', 'OneSidedSelection', 'CondensedNearestNeighbour',
'NeighbourhoodCleaningRule'
]
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from sklearn.utils import safe_indexing

from ..base import BaseCleaningSampler
from .edited_nearest_neighbours import EditedNearestNeighbours
from ._edited_nearest_neighbours import EditedNearestNeighbours
from ...utils import check_neighbors_object
from ...utils import Substitution
from ...utils.deprecation import deprecate_parameter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from sklearn.utils import check_random_state, safe_indexing

from ..base import BaseCleaningSampler
from .tomek_links import TomekLinks
from ._tomek_links import TomekLinks
from ...utils import Substitution
from ...utils._docstring import _random_state_docstring

Expand Down
22 changes: 0 additions & 22 deletions imblearn/under_sampling/prototype_selection/__init__.py

This file was deleted.

10 changes: 5 additions & 5 deletions imblearn/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@

from ._docstring import Substitution

from .validation import check_neighbors_object
from .validation import check_target_type
from .validation import hash_X_y
from .validation import check_ratio
from .validation import check_sampling_strategy
from ._validation import check_neighbors_object
from ._validation import check_target_type
from ._validation import hash_X_y
from ._validation import check_ratio
from ._validation import check_sampling_strategy

__all__ = [
'Substitution', 'check_neighbors_object', 'check_target_type', 'hash_X_y',
Expand Down
File renamed without changes.