SufficiencyOutput#

class dataeval.workflows.SufficiencyOutput(steps: ndarray[Any, dtype[uint32]], params: dict[str, ndarray[Any, dtype[float64]]], measures: dict[str, ndarray[Any, dtype[float64]]])#

Output class for Sufficiency workflow

steps#

Array of sample sizes

Type:

NDArray

params#

Inverse power curve coefficients for the line of best fit for each measure

Type:

Dict[str, NDArray]

measures#

Average of values observed for each sample size step for each measure

Type:

Dict[str, NDArray]

inv_project(targets: Mapping[str, ArrayLike]) dict[str, ndarray[Any, dtype[float64]]]#

Calculate training samples needed to achieve target model metric values.

Parameters:

targets (Mapping[str, ArrayLike]) – Mapping of target metric scores (from 0.0 to 1.0) that we want to achieve, where the key is the name of the metric.

Returns:

List of the number of training samples needed to achieve each corresponding entry in targets

Return type:

dict[str, NDArray]

plot(class_names: Sequence[str] | None = None) list[Figure]#

Plotting function for data sufficience tasks

Parameters:

class_names (Sequence[str] | None, default None) – List of class names

Returns:

List of Figures for each measure

Return type:

list[plt.Figure]

Raises:

ValueError – If the length of data points in the measures do not match

project(projection: int | Iterable[int]) SufficiencyOutput#

Projects the measures for each value of X

Parameters:

projection (int | Iterable[int]) – Step or steps to project

Returns:

Dataclass containing the projected measures per projection

Return type:

SufficiencyOutput

Raises:

ValueError – If the length of data points in the measures do not match If projection is not numerical