pydvl.valuation.scorers.utils
¶
compose_score
¶
compose_score(
scorer: SupervisedScorer,
transformation: Callable[[float], float],
name: str,
) -> SupervisedScorer
Composes a scoring function with an arbitrary scalar transformation.
Useful to squash unbounded scores into ranges manageable by data valuation methods.
Example
PARAMETER | DESCRIPTION |
---|---|
scorer
|
The object to be composed.
TYPE:
|
transformation
|
A scalar transformation |
name
|
A string representation for the composition, for
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
SupervisedScorer
|
The composite SupervisedScorer. |