Single Best

class deslib.static.single_best.SingleBest(pool_classifiers)[source]

Classification method that selects the classifier in the pool with highest score to be used for classification. Usually, the performance of the single best classifier is estimated based on the validation data.

Parameters:
pool_classifiers : list of classifiers

The generated_pool of classifiers trained for the corresponding classification problem. The classifiers should support methods “predict”.

References

Britto, Alceu S., Robert Sabourin, and Luiz ES Oliveira. “Dynamic selection of classifiers—a comprehensive review.” Pattern Recognition 47.11 (2014): 3665-3680.

Kuncheva, Ludmila I. Combining pattern classifiers: methods and algorithms. John Wiley & Sons, 2004.

R. M. O. Cruz, R. Sabourin, and G. D. Cavalcanti, “Dynamic classifier selection: Recent advances and perspectives,” Information Fusion, vol. 41, pp. 195 – 216, 2018.

fit(X, y)[source]

Fit the model by selecting the base classifier with the highest accuracy in the dataset. The single best classifier is kept in self.best_clf and its index is kept in self.best_clf_index.

Parameters:
X : array of shape = [n_samples, n_features]

The data to be classified

y : array of shape = [n_samples]

Class labels of each sample in X.

predict(X)[source]

Predict the label of each sample in X and returns the predicted label.

Parameters:
X : array of shape = [n_samples, n_features]

The data to be classified

Returns:
predicted_labels : array of shape = [n_samples]

Predicted class for each sample in X.

predict_proba(X)[source]
Estimates the posterior probabilities for each class for each sample in X. The returned probability
estimates for all classes are ordered by the label of classes.
Parameters:
X : array of shape = [n_samples, n_features]

The data to be classified

Returns:
predicted_proba : array of shape = [n_samples, n_classes]

Posterior probabilities estimates for each class.