'Fit underlying estimators.
Parameters
X : (sparse) array-like, shape = [n_samples, n_features]
Data.
y : array-like, shape = [n_samples]
Multi-class targets.
Returns
self'

def fit(self, X, y):

    (X, y) = check_X_y(X, y, accept_sparse=['csr', 'csc'])
    check_classification_targets(y)
    self.classes_ = np.unique(y)
    if (len(self.classes_) == 1):
        raise ValueError('OneVsOneClassifier    can    not    be    fit    when    only    one    class    is    present.')
    n_classes = self.classes_.shape[0]
    estimators_indices = list(zip(*Parallel(n_jobs=self.n_jobs)((delayed(_fit_ovo_binary)(self.estimator, X, y, self.classes_[i], self.classes_[j]) for i in range(n_classes) for j in range((i + 1), n_classes)))))
    self.estimators_ = estimators_indices[0]
    try:
        self.pairwise_indices_ = (estimators_indices[1] if self._pairwise else None)
    except AttributeError:
        self.pairwise_indices_ = None
    return self
