15
15
from ..isotonic import IsotonicRegression
16
16
from ..metrics import euclidean_distances
17
17
from ..utils import check_array , check_random_state , check_symmetric
18
- from ..utils ._param_validation import Hidden , Interval , StrOptions
18
+ from ..utils ._param_validation import Hidden , Interval , StrOptions , validate_params
19
19
from ..utils .parallel import Parallel , delayed
20
20
21
21
@@ -167,6 +167,27 @@ def _smacof_single(
167
167
return X , stress , it + 1
168
168
169
169
170
+ @validate_params (
171
+ {
172
+ "dissimilarities" : ["array-like" ],
173
+ "metric" : ["boolean" ],
174
+ "n_components" : [Interval (Integral , 1 , None , closed = "left" )],
175
+ "init" : ["array-like" , None ],
176
+ "n_init" : [Interval (Integral , 1 , None , closed = "left" )],
177
+ "n_jobs" : [Integral , None ],
178
+ "max_iter" : [Interval (Integral , 1 , None , closed = "left" )],
179
+ "verbose" : ["verbose" ],
180
+ "eps" : [Interval (Real , 0 , None , closed = "left" )],
181
+ "random_state" : ["random_state" ],
182
+ "return_n_iter" : ["boolean" ],
183
+ "normalized_stress" : [
184
+ "boolean" ,
185
+ StrOptions ({"auto" }),
186
+ Hidden (StrOptions ({"warn" })),
187
+ ],
188
+ },
189
+ prefer_skip_nested_validation = True ,
190
+ )
170
191
def smacof (
171
192
dissimilarities ,
172
193
* ,
@@ -204,7 +225,7 @@ def smacof(
204
225
205
226
Parameters
206
227
----------
207
- dissimilarities : ndarray of shape (n_samples, n_samples)
228
+ dissimilarities : array-like of shape (n_samples, n_samples)
208
229
Pairwise dissimilarities between the points. Must be symmetric.
209
230
210
231
metric : bool, default=True
@@ -218,7 +239,7 @@ def smacof(
218
239
``init`` is used to determine the dimensionality of the embedding
219
240
space.
220
241
221
- init : ndarray of shape (n_samples, n_components), default=None
242
+ init : array-like of shape (n_samples, n_components), default=None
222
243
Starting configuration of the embedding to initialize the algorithm. By
223
244
default, the algorithm is initialized with a randomly chosen array.
224
245
0 commit comments