File tree Expand file tree Collapse file tree 2 files changed +3
-1
lines changed Expand file tree Collapse file tree 2 files changed +3
-1
lines changed Original file line number Diff line number Diff line change 15
15
from scipy .sparse import csc_matrix
16
16
17
17
from ..base import BaseEstimator , ClusterMixin
18
- from ..utils ._param_validation import Interval , StrOptions
18
+ from ..utils ._param_validation import Interval , StrOptions , validate_params
19
19
from ..utils import check_random_state , as_float_array
20
20
from ..metrics .pairwise import pairwise_kernels , KERNEL_PARAMS
21
21
from ..neighbors import kneighbors_graph , NearestNeighbors
@@ -190,6 +190,7 @@ def discretize(
190
190
return labels
191
191
192
192
193
+ @validate_params ({"affinity" : ["array-like" , "sparse matrix" ]})
193
194
def spectral_clustering (
194
195
affinity ,
195
196
* ,
Original file line number Diff line number Diff line change @@ -152,6 +152,7 @@ def test_function_param_validation(func_module):
152
152
153
153
PARAM_VALIDATION_CLASS_WRAPPER_LIST = [
154
154
("sklearn.cluster.affinity_propagation" , "sklearn.cluster.AffinityPropagation" ),
155
+ ("sklearn.cluster.spectral_clustering" , "sklearn.cluster.SpectralClustering" ),
155
156
("sklearn.covariance.ledoit_wolf" , "sklearn.covariance.LedoitWolf" ),
156
157
("sklearn.covariance.oas" , "sklearn.covariance.OAS" ),
157
158
("sklearn.decomposition.dict_learning" , "sklearn.decomposition.DictionaryLearning" ),
You can’t perform that action at this time.
0 commit comments