Aggregate
Library of implemented Aggregate functions in AUCMEDI.
An Aggregate function can be passed to an ensemble and merges multiple class predictions into a single prediction.
Assembled predictions encoded in a NumPy matrix with shape (N_models, N_classes).
Example: [[0.5, 0.4, 0.1],
[0.4, 0.3, 0.3],
[0.5, 0.2, 0.3]]
-> shape (3, 3)
Merged prediction encoded in a NumPy matrix with shape (1, N_classes).
Example: [[0.4, 0.3, 0.3]]
-> shape (1, 3)
Example
# Recommended: Apply an Ensemble like Augmenting (test-time augmentation) with Majority Vote
preds = predict_augmenting(model, test_datagen, n_cycles=5, aggregate="majority_vote")
# Manual: Apply an Ensemble like Augmenting (test-time augmentation) with Majority Vote
from aucmedi.ensemble.aggregate import MajorityVote
my_agg = MajorityVote()
preds = predict_augmenting(model, test_datagen, n_cycles=5, aggregate=my_agg)
Aggregate functions are based on the abstract base class Aggregate_Base, which allows simple integration of custom aggregate methods for Ensemble.
aggregate_dict = {'mean': AveragingMean, 'median': AveragingMedian, 'majority_vote': MajorityVote, 'softmax': Softmax, 'global_argmax': GlobalArgmax}
module-attribute
ยค
Dictionary of implemented Aggregate functions.