

def fit(self, X, y, sample_weight=None):
    if (self.uniform_variables is None):
        raise ValueError('Please set uniform variables')
    if (len(self.uniform_variables) == 0):
        raise ValueError('The set of uniform variables cannot be empty')
    if (len(X) != len(y)):
        raise ValueError('Different size of X and y')
    assert np.in1d(y, [0, 1]).all(), 'only two-class classification is implemented'
    X_train_vars = self.get_train_vars(X)
    if (self.smoothing is None):
        self.smoothing = (10.0 / self.efficiency_steps)
    neighbours_matrix = computeKnnIndicesOfSameClass(self.uniform_variables, X, y, n_neighbours=self.knn)
    self.target_efficiencies = np.linspace(0, 1, (self.efficiency_steps + 2))[1:(- 1)]
    self.classifiers = []
    for efficiency in self.target_efficiencies:
        classifier = uBoostBDT(uniform_variables=self.uniform_variables, uniform_label=self.uniform_label, train_variables=None, target_efficiency=efficiency, n_neighbors=self.knn, n_estimators=self.n_estimators, base_estimator=self.base_estimator, random_state=self.random_state, bagging=self.bagging, smoothing=self.smoothing, algorithm=self.algorithm)
        self.classifiers.append(classifier)
    self.classifiers = map_on_cluster(self.ipc_profile, _train_classifier, self.classifiers, (self.efficiency_steps * [X_train_vars]), (self.efficiency_steps * [y]), (self.efficiency_steps * [sample_weight]), (self.efficiency_steps * [neighbours_matrix]))
    return self

dataset/ETHPy150Open anaderi/lhcb_trigger_ml/hep_ml/uboost.py uBoostClassifier.fit/original