pusion.core.simple_average_combiner¶
- class pusion.core.simple_average_combiner.SimpleAverageCombiner¶
Bases:
pusion.core.combiner.UtilityBasedCombiner
The
SimpleAverageCombiner
(AVG) fuses decisions using the arithmetic mean rule. The mean is calculated between decision vectors obtained by multiple ensemble classifiers for a sample. The AVG combiner is unaware of the input problem (multiclass/multilabel) or the assignment type (crisp/continuous).- combine(decision_tensor)¶
Combine decision outputs by averaging the class support of each classifier in the given ensemble.
- Parameters
decision_tensor – numpy.array of shape (n_classifiers, n_samples, n_classes). Tensor of either crisp or continuous decision outputs by different classifiers per sample.
- Returns
A matrix (numpy.array) of crisp assignments which represents fused decisions obtained by the AVG method. Axis 0 represents samples and axis 1 the class assignments which are aligned with axis 2 in
decision_tensor
input tensor.
- class pusion.core.simple_average_combiner.CRSimpleAverageCombiner¶
Bases:
pusion.core.simple_average_combiner.SimpleAverageCombiner
The
CRSimpleAverageCombiner
is a modification ofSimpleAverageCombiner
that also supports complementary-redundant decision outputs. Therefore the input is transformed to a unified tensor representation supporting undefined class assignments. The mean is calculated only for assignments which are defined. To callcombine()
a coverage needs to be set first by the inheritedset_coverage()
method.- combine(decision_outputs)¶
Combine decision outputs by averaging the defined class support of each classifier in the given ensemble. Undefined class supports are excluded from averaging.
- Parameters
decision_outputs – list of numpy.array matrices, each of shape (n_samples, n_classes’), where n_classes’ is classifier-specific and described by the coverage. Each matrix corresponds to one of n_classifiers classifiers and contains either crisp or continuous decision outputs per sample.
- Returns
A matrix (numpy.array) of crisp assignments which represents fused decisions obtained by the AVG method. Axis 0 represents samples and axis 1 the class assignments which are aligned with axis 2 in
decision_tensor
input tensor.