8
8
# * Fast Optimization for t-SNE:
9
9
# https://cseweb.ucsd.edu/~lvdmaaten/workshops/nips2010/papers/vandermaaten.pdf
10
10
11
- import warnings
12
11
from time import time
13
12
import numpy as np
14
13
from scipy import linalg
21
20
from ..utils import check_random_state
22
21
from ..utils ._openmp_helpers import _openmp_effective_n_threads
23
22
from ..utils .validation import check_non_negative
24
- from ..utils ._param_validation import Interval , StrOptions , Hidden
23
+ from ..utils ._param_validation import Interval , StrOptions
25
24
from ..decomposition import PCA
26
25
from ..metrics .pairwise import pairwise_distances , _VALID_METRICS
27
26
@@ -678,14 +677,6 @@ class TSNE(ClassNamePrefixFeaturesOutMixin, TransformerMixin, BaseEstimator):
678
677
679
678
.. versionadded:: 0.22
680
679
681
- square_distances : True, default='deprecated'
682
- This parameter has no effect since distance values are always squared
683
- since 1.1.
684
-
685
- .. deprecated:: 1.1
686
- `square_distances` has no effect from 1.1 and will be removed in
687
- 1.3.
688
-
689
680
Attributes
690
681
----------
691
682
embedding_ : array-like of shape (n_samples, n_components)
@@ -778,7 +769,6 @@ class TSNE(ClassNamePrefixFeaturesOutMixin, TransformerMixin, BaseEstimator):
778
769
"method" : [StrOptions ({"barnes_hut" , "exact" })],
779
770
"angle" : [Interval (Real , 0 , 1 , closed = "both" )],
780
771
"n_jobs" : [None , Integral ],
781
- "square_distances" : ["boolean" , Hidden (StrOptions ({"deprecated" }))],
782
772
}
783
773
784
774
# Control the number of exploration iterations with early_exaggeration on
@@ -805,7 +795,6 @@ def __init__(
805
795
method = "barnes_hut" ,
806
796
angle = 0.5 ,
807
797
n_jobs = None ,
808
- square_distances = "deprecated" ,
809
798
):
810
799
self .n_components = n_components
811
800
self .perplexity = perplexity
@@ -822,7 +811,6 @@ def __init__(
822
811
self .method = method
823
812
self .angle = angle
824
813
self .n_jobs = n_jobs
825
- self .square_distances = square_distances
826
814
827
815
def _check_params_vs_input (self , X ):
828
816
if self .perplexity >= X .shape [0 ]:
@@ -837,14 +825,7 @@ def _fit(self, X, skip_num_points=0):
837
825
"with the sparse input matrix. Use "
838
826
'init="random" instead.'
839
827
)
840
- if self .square_distances != "deprecated" :
841
- warnings .warn (
842
- (
843
- "The parameter `square_distances` has not effect and will be "
844
- "removed in version 1.3."
845
- ),
846
- FutureWarning ,
847
- )
828
+
848
829
if self .learning_rate == "auto" :
849
830
# See issue #18018
850
831
self .learning_rate_ = X .shape [0 ] / self .early_exaggeration / 4
0 commit comments