8000 Fix imports in pip3 ubuntu by suffixing affected files (#15891) · panpiort8/scikit-learn@281e36e · GitHub
[go: up one dir, main page]

Skip to content

Commit 281e36e

Browse files
thomasjpfanPan Jan
authored andcommitted
Fix imports in pip3 ubuntu by suffixing affected files (scikit-learn#15891)
1 parent 3d4db62 commit 281e36e

File tree

13 files changed

+23
-22
lines changed

13 files changed

+23
-22
lines changed

sklearn/_build_utils/deprecated_modules.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@
4747
'SpectralBiclustering'),
4848
('_birch', 'sklearn.cluster.birch', 'sklearn.cluster', 'Birch'),
4949
('_dbscan', 'sklearn.cluster.dbscan_', 'sklearn.cluster', 'DBSCAN'),
50-
('_hierarchical', 'sklearn.cluster.hierarchical', 'sklearn.cluster',
50+
('_agglomerative', 'sklearn.cluster.hierarchical', 'sklearn.cluster',
5151
'FeatureAgglomeration'),
52-
('_k_means', 'sklearn.cluster.k_means_', 'sklearn.cluster', 'KMeans'),
52+
('_kmeans', 'sklearn.cluster.k_means_', 'sklearn.cluster', 'KMeans'),
5353
('_mean_shift', 'sklearn.cluster.mean_shift_', 'sklearn.cluster',
5454
'MeanShift'),
5555
('_optics', 'sklearn.cluster.optics_', 'sklearn.cluster', 'OPTICS'),
@@ -101,7 +101,7 @@
101101
('_kernel_pca', 'sklearn.decomposition.kernel_pca',
102102
'sklearn.decomposition', 'KernelPCA'),
103103
('_nmf', 'sklearn.decomposition.nmf', 'sklearn.decomposition', 'NMF'),
104-
('_online_lda', 'sklearn.decomposition.online_lda',
104+
('_lda', 'sklearn.decomposition.online_lda',
105105
'sklearn.decomposition', 'LatentDirichletAllocation'),
106106
('_online_lda_fast', 'sklearn.decomposition.online_lda_fast',
107107
'sklearn.decomposition', 'mean_change'),
@@ -140,7 +140,7 @@
140140

141141
('_dict_vectorizer', 'sklearn.feature_extraction.dict_vectorizer',
142142
'sklearn.feature_extraction', 'DictVectorizer'),
143-
('_hashing', 'sklearn.feature_extraction.hashing',
143+
('_hash', 'sklearn.feature_extraction.hashing',
144144
'sklearn.feature_extraction', 'FeatureHasher'),
145145
('_stop_words', 'sklearn.feature_extraction.stop_words',
146146
'sklearn.feature_extraction.text', 'ENGLISH_STOP_WORDS'),

sklearn/cluster/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
from ._mean_shift import (mean_shift, MeanShift,
88
estimate_bandwidth, get_bin_seeds)
99
from ._affinity_propagation import affinity_propagation, AffinityPropagation
10-
from ._hierarchical import (ward_tree, AgglomerativeClustering, linkage_tree,
11-
FeatureAgglomeration)
12-
from ._k_means import k_means, KMeans, MiniBatchKMeans
10+
from ._agglomerative import (ward_tree, AgglomerativeClustering,
11+
linkage_tree, FeatureAgglomeration)
12+
from ._kmeans import k_means, KMeans, MiniBatchKMeans
1313
from ._dbscan import dbscan, DBSCAN
1414
from ._optics import (OPTICS, cluster_optics_dbscan, compute_optics_graph,
1515
cluster_optics_xi)

sklearn/cluster/_hierarchical.py renamed to sklearn/cluster/_agglomerative.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
from ._feature_agglomeration import AgglomerationTransform
2626
from ..utils._fast_dict import IntFloatDict
2727
from ..utils.fixes import _astype_copy_false
28-
from ..utils import deprecated
28+
2929

3030
###############################################################################
3131
# For non fully-connected graphs
@@ -249,8 +249,8 @@ def ward_tree(X, connectivity=None, n_clusters=None, return_distance=False):
249249
else:
250250
if n_clusters > n_samples:
251251
raise ValueError('Cannot provide more clusters than samples. '
252-
'%i n_clusters was asked, and there are %i samples.'
253-
% (n_clusters, n_samples))
252+
'%i n_clusters was asked, and there are %i '
253+
'samples.' % (n_clusters, n_samples))
254254
n_nodes = 2 * n_samples - n_clusters
255255

256256
# create inertia matrix
File renamed without changes.

sklearn/cluster/_spectral.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
from ..metrics.pairwise import pairwise_kernels
1616
from ..neighbors import kneighbors_graph, NearestNeighbors
1717
from ..manifold import spectral_embedding
18-
from ._k_means import k_means
18+
from ._kmeans import k_means
1919

2020

2121
def discretize(vectors, copy=True, max_svd_restarts=30, n_iter_max=20,

sklearn/cluster/tests/test_hierarchical.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,9 @@
2222

2323
from sklearn.cluster import ward_tree
2424
from sklearn.cluster import AgglomerativeClustering, FeatureAgglomeration
25-
from sklearn.cluster._hierarchical import (_hc_cut, _TREE_BUILDERS,
26-
linkage_tree, _fix_connectivity)
25+
from sklearn.cluster._agglomerative import (_hc_cut, _TREE_BUILDERS,
26+
linkage_tree,
27+
_fix_connectivity)
2728
from sklearn.feature_extraction.image import grid_to_graph
2829
from sklearn.metrics.pairwise import PAIRED_DISTANCES, cosine_distances,\
2930
manhattan_distances, pairwise_distances

sklearn/cluster/tests/test_k_means.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
from sklearn.metrics.cluster import v_measure_score
2323
from sklearn.cluster import KMeans, k_means
2424
from sklearn.cluster import MiniBatchKMeans
25-
from sklearn.cluster._k_means import _labels_inertia
26-
from sklearn.cluster._k_means import _mini_batch_step
25+
from sklearn.cluster._kmeans import _labels_inertia
26+
from sklearn.cluster._kmeans import _mini_batch_step
2727
from sklearn.datasets import make_blobs
2828
from io import StringIO
2929
from sklearn.metrics.cluster import homogeneity_score
@@ -734,7 +734,7 @@ def test_k_means_function():
734734

735735
def test_x_squared_norms_init_centroids():
736736
# Test that x_squared_norms can be None in _init_centroids
737-
from sklearn.cluster._k_means import _init_centroids
737+
from sklearn.cluster._kmeans import _init_centroids
738738

739739
X_norms = np.sum(X**2, axis=1)
740740
precompute = _init_centroids(
@@ -921,7 +921,7 @@ def test_sample_weight_length():
921921

922922

923923
def test_check_normalize_sample_weight():
924-
from sklearn.cluster._k_means import _check_normalize_sample_weight
924+
from sklearn.cluster._kmeans import _check_normalize_sample_weight
925925
sample_weight = None
926926
checked_sample_weight = _check_normalize_sample_weight(sample_weight, X)
927927
assert _num_samples(X) == _num_samples(checked_sample_weight)

sklearn/decomposition/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
MiniBatchDictionaryLearning, SparseCoder)
1717
from ._factor_analysis import FactorAnalysis
1818
from ..utils.extmath import randomized_svd
19-
from ._online_lda import LatentDirichletAllocation
19+
from ._lda import LatentDirichletAllocation
2020

2121
__all__ = ['DictionaryLearning',
2222
'FastICA',

sklearn/decomposition/tests/test_online_lda.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
import pytest
99

1010
from sklearn.decomposition import LatentDirichletAllocation
11-
from sklearn.decomposition._online_lda import (_dirichlet_expectation_1d,
12-
_dirichlet_expectation_2d)
11+
from sklearn.decomposition._lda import (_dirichlet_expectation_1d,
12+
_dirichlet_expectation_2d)
1313

1414
from sklearn.utils._testing import assert_allclose
1515
from sklearn.utils._testing import assert_array_almost_equal

0 commit comments

Comments
 (0)
0