tpcp.validate
.NoAgg#
- class tpcp.validate.NoAgg(_value: T)[source]#
Wrapper to wrap one or multiple output values of a scorer to prevent aggregation of these values.
If one of the values in the return dictionary of a multi-value score function is wrapped with this class, the scorer will not aggregate the value. This allows to pass arbitary data from the score function through the scorer. As example, this could be some general metadata, some non-numeric scores, or an array of values (e.g. when the actual score is the mean of such values).
Examples
>>> def score_func(pipe, dataset): ... ... ... return {"score_val_1": score, "some_metadata": NoAgg(metadata)} >>> my_scorer = Scorer(score_func)
Methods
aggregate
(_)Return nothing, indicating no aggregation.
Return the value wrapped by aggregator.
Examples using tpcp.validate.NoAgg
#
Custom Scorer