MulticlassStrategy#
- class mlquantify.multiclass.MulticlassStrategy[source]#
Base class for multiclass decomposition strategies.
A strategy turns a binary quantifier into a multiclass one: it decomposes the problem, fits/predicts the binary sub-quantifiers, and recombines their outputs into per-class prevalences. Register new strategies (e.g. ECOC, hierarchical) with
register_strategyand they become usable through the quantifier’sstrategyattribute with no change to the dispatch.Subclasses implement
fit,predict,aggregateandfit_predict, returning prevalences before the sharedvalidate_prevalencesnormalization applied byBinaryQuantifier.- aggregate(quantifier, classes, args_dict, n_jobs=None)[source]#
Return per-class prevalences from pre-computed predictions.
- fit(quantifier, X, y, n_jobs=None, fit_args=None, fit_kwargs=None)[source]#
Return
{key: fitted_binary_quantifier}for the decomposition.