def fit(self, X, y, sample_weight=None):
        X, y, sample_weight = check_xyw(X, y, sample_weight=sample_weight)
        self._mask = numpy.array(y == self.uniform_label)
        assert sum(self._mask) > 0, 'No events of uniform class!'
        self._masked_weight = sample_weight[self._mask]

        X_part = numpy.array(take_features(X, self.uniform_features))[self._mask, :]
        # computing knn indices
        neighbours = NearestNeighbors(n_neighbors=self.n_neighbours, algorithm='kd_tree').fit(X_part)
        _, self._groups_indices = neighbours.kneighbors(X_part)
        self._group_weights = ut.compute_group_weights(self._groups_indices, sample_weight=self._masked_weight)
Initialize the SudokuImageParser class and model.
dataset/ETHPy150Open anaderi/lhcb_trigger_ml/hep_ml/metrics.py/AbstractKnnMetrics.fit--crossover with--dataset/ETHPy150Open GoogleCloudPlatform/appengine-opencv-sudoku-python/sudoku_image_parser.py/SudokuImageParser.__init__