Oracle

class deslib.static.oracle.Oracle(pool_classifiers)[source]

Abstract method that always selects the base classifier that predicts the correct label if such classifier exists. This method is often used to measure the upper-limit performance that can be achieved by a dynamic classifier selection technique. It is used as a benchmark by several dynamic selection algorithms

Parameters:
pool_classifiers : list of classifiers

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

References

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.

predict(X, y)[source]

Prepare the labels using the Oracle model.

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.

Returns:
predicted_labels : array of shape = [n_samples]

Predicted class for each sample in X.

score(X, y)[source]

Prepare the labels using the Oracle model.

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.

Returns:
accuracy : Classification accuracy of the Oracle model.