'Decision function for the OneVsOneClassifier.
The decision values for the samples are computed by adding the
normalized sum of pair-wise classification confidence levels to the
votes in order to disambiguate between the decision values when the
votes for all the classes are equal leading to a tie.
Parameters
X : array-like, shape = [n_samples, n_features]
Returns
Y : array-like, shape = [n_samples, n_classes]'

def decision_function(self, X):

    check_is_fitted(self, 'estimators_')
    indices = self.pairwise_indices_
    if (indices is None):
        Xs = ([X] * len(self.estimators_))
    else:
        Xs = [X[:, idx] for idx in indices]
    predictions = np.vstack([est.predict(Xi) for (est, Xi) in zip(self.estimators_, Xs)]).T
    confidences = np.vstack([_predict_binary(est, Xi) for (est, Xi) in zip(self.estimators_, Xs)]).T
    Y = _ovr_decision_function(predictions, confidences, len(self.classes_))
    if (self.n_classes_ == 2):
        return Y[:, 1]
    return Y
