Aggregation

deslib.util.aggregation.average_rule(classifier_ensemble, X)[source]

Apply the average_rule rule to predict the label of each sample in X.

Parameters:
classifier_ensemble : list of shape = [n_classifiers]

containing the ensemble of classifiers used in the aggregation scheme.

X : array of shape = [n_samples, n_features]

The input data.

Returns:
list_proba : array of shape = [n_classifiers, n_samples, n_classes]

probabilities predicted by each base classifier in the ensemble for all samples in X.

deslib.util.aggregation.get_ensemble_votes(classifier_ensemble, X)[source]

Calculates the votes obtained by each based classifier in the ensemble for sample in X

Parameters:
classifier_ensemble : list of shape = [n_classifiers]

containing the ensemble of classifiers used in the aggregation scheme.

X : array of shape = [n_samples, n_features]

The input data.

Returns:
votes : array of shape = [n_samples, n_classifiers]

The votes obtained by each base classifier

deslib.util.aggregation.majority_voting(classifier_ensemble, X)[source]

Apply the majority voting rule to predict the label of each sample in X.

Parameters:
classifier_ensemble : list of shape = [n_classifiers]

containing the ensemble of classifiers used in the aggregation scheme.

X : array of shape = [n_samples, n_features]

The input data.

Returns:
predicted_label : array of shape = [n_samples]

The label of each query sample predicted using the majority voting rule

deslib.util.aggregation.majority_voting_rule(votes)[source]

Applies the majority voting rule to the estimated votes.

Parameters:
votes : array of shape = [n_samples, n_classifiers],

The votes obtained by each classifier for each sample.

Returns:
predicted_label : array of shape = [n_samples]

The label of each query sample predicted using the majority voting rule

deslib.util.aggregation.predict_proba_ensemble(classifier_ensemble, X)[source]

Estimates the posterior probabilities of the give ensemble for each sample in X.

Parameters:
classifier_ensemble : list of shape = [n_classifiers]

containing the ensemble of classifiers used in the aggregation scheme.

X : array of shape = [n_samples, n_features]

The input data.

Returns:
list_proba : array of shape = [n_classifiers, n_samples, n_classes]

probabilities predicted by each base classifier in the ensemble for all samples in X.

deslib.util.aggregation.predict_proba_ensemble_weighted(classifier_ensemble, weights, X)[source]

Estimates the posterior probabilities for each sample in X.

Parameters:
classifier_ensemble : list of shape = [n_classifiers]

containing the ensemble of classifiers used to estimate the probabilities.

weights : array of shape = [n_samples, n_classifiers]

Weights associated to each base classifier for each sample

X : array of shape = [n_samples, n_features]

The input data.

Returns:
list_proba : array of shape = [n_classifiers, n_samples, n_classes]

probabilities predicted by each base classifier in the ensemble for all samples in X.

deslib.util.aggregation.weighted_majority_voting(classifier_ensemble, weights, X)[source]

Apply the weighted majority voting rule to predict the label of each sample in X. The size of the weights vector should be equal to the size of the ensemble.

Parameters:
classifier_ensemble : list of shape = [n_classifiers]

containing the ensemble of classifiers used in the aggregation scheme.

weights : array of shape = [n_samples, n_classifiers]

Weights associated to each base classifier for each sample

X : array of shape = [n_samples, n_features]

The input data.

Returns:
predicted_label : array of shape = [n_samples]

The label of each query sample predicted using the majority voting rule

deslib.util.aggregation.weighted_majority_voting_rule(votes, weights)[source]

Applies the weighted majority voting rule based on the votes obtained by each base classifier and their respective weights.

Parameters:
votes : array of shape = [n_samples, n_classifiers],

The votes obtained by each classifier for each sample.

weights : array of shape = [n_samples, n_classifiers]

Weights associated to each base classifier for each sample

Returns:
predicted_label : array of shape = [n_samples]

The label of each query sample predicted using the majority voting rule