'Distance of the samples X to the separating hyperplane.
Parameters
X : array-like, shape (n_samples, n_features)
Returns
X : array-like, shape (n_samples, n_class * (n_class-1) / 2)
Returns the decision function of the sample for each class
in the model.'

def _decision_function(self, X):

    X = self._validate_for_predict(X)
    X = self._compute_kernel(X)
    if self._sparse:
        dec_func = self._sparse_decision_function(X)
    else:
        dec_func = self._dense_decision_function(X)
    if ((self._impl in ['c_svc', 'nu_svc']) and (len(self.classes_) == 2)):
        return (- dec_func.ravel())
    return dec_func
