pydvl.reporting.scores
¶
compute_removal_score
¶
compute_removal_score(
u: ModelUtility,
values: ValuationResult,
training_data: Dataset,
percentages: NDArray[float_] | Iterable[float],
*,
remove_best: bool = False,
progress: bool = False,
) -> dict[float, float]
Fits a model and computes its score on a test set after incrementally removing a percentage of data points from the training set, based on their values.
PARAMETER | DESCRIPTION |
---|---|
u
|
Utility object with model, test data, and scoring function.
TYPE:
|
training_data
|
Dataset from which to remove data points.
TYPE:
|
values
|
Data values of data instances in the training set.
TYPE:
|
percentages
|
Sequence of removal percentages. |
remove_best
|
If True, removes data points in order of decreasing valuation.
TYPE:
|
progress
|
If True, display a progress bar.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
dict[float, float]
|
Dictionary that maps the percentages to their respective scores. |