def sigmoid_kernel(X, Y=None, gamma=None, coef0=1):
 (X, Y) = check_pairwise_arrays(X, Y)
 if (gamma is None):
  gamma = (1.0 / X.shape[1])
 K = safe_sparse_dot(X, Y.T, dense_output=True)
 K *= gamma
 K += coef0
 np.tanh(K, K)
 return K

def sigmoid_kernel ( X , Y = None , gamma = None , coef0 = 1 ) : ( X , Y ) = check_pairwise_arrays ( X , Y ) if ( gamma is None ) : gamma = ( 1.0 / X . shape [ 1 ] ) K = safe_sparse_dot ( X , Y . T , dense_output = True ) K *= gamma K += coef0 np . tanh ( K , K ) return K
compute the sigmoid kernel between x and y:: k = tanh read more in the :ref:user guide <sigmoid_kernel> .