@@ -1290,6 +1290,18 @@ def polynomial_kernel(X, Y=None, degree=3, gamma=None, coef0=1):
1290
1290
return K
1291
1291
1292
1292
1293
+ @validate_params (
1294
+ {
1295
+ "X" : ["array-like" , "sparse matrix" ],
1296
+ "Y" : ["array-like" , "sparse matrix" , None ],
1297
+ "gamma" : [
1298
+ Interval (Real , 0 , None , closed = "left" ),
1299
+ None ,
1300
+ Hidden (np .ndarray ),
1301
+ ],
1302
+ "coef0" : [Interval (Real , None , None , closed = "neither" )],
1303
+ }
1304
+ )
1293
1305
def sigmoid_kernel (X , Y = None , gamma = None , coef0 = 1 ):
1294
1306
"""Compute the sigmoid kernel between X and Y.
1295
1307
@@ -1299,10 +1311,10 @@ def sigmoid_kernel(X, Y=None, gamma=None, coef0=1):
1299
1311
1300
1312
Parameters
1301
1313
----------
1302
- X : ndarray of shape (n_samples_X, n_features)
1314
+ X : {array-like, sparse matrix} of shape (n_samples_X, n_features)
1303
1315
A feature array.
1304
1316
1305
- Y : ndarray of shape (n_samples_Y, n_features), default=None
1317
+ Y : {array-like, sparse matrix} of shape (n_samples_Y, n_features), default=None
1306
1318
An optional second feature array. If `None`, uses `Y=X`.
1307
1319
1308
1320
gamma : float, default=None
0 commit comments