'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_classes * (n_classes-1) / 2)
Returns the decision function of the sample for each class
in the model.
If decision_function_shape=\'ovr\', the shape is (n_samples,
n_classes)'

def decision_function(self, X):

    dec = self._decision_function(X)
    if ((self.decision_function_shape == 'ovr') and (len(self.classes_) > 2)):
        return _ovr_decision_function((dec < 0), (- dec), len(self.classes_))
    return dec
