

def select(self, ensemble, x):
    if ensemble.in_agreement(x):
        return (Ensemble([ensemble.classifiers[0]]), None)
    classifiers = ensemble.classifiers
    [idx] = self.knn.kneighbors(x, return_distance=False)
    (X, y) = (self.Xval[idx], self.yval[idx])
    scores = np.asarray([clf.score(X, y) for clf in classifiers])
    return (Ensemble([classifiers[np.argmax(scores)]]), None)

dataset/ETHPy150Open viisar/brew/brew/selection/dynamic/ola.py OLA2.select/original