holisticai.security.metrics.data_minimization_score#

holisticai.security.metrics.data_minimization_score(y_true: Series, y_pred: Series, y_pred_dm: dict[str, Series], return_results=False, learning_task: str | None = None)[source]#

Calculate the accuracy ratio for data minimization. The accuracy ratio is the ratio of the accuracy of the data minimization model to the accuracy of the original model.

Parameters

y_true: pd.Series

The true labels.

y_pred: pd.Series

The predicted labels.

y_pred_dm: dict[str, pd.Series]

The predicted labels for each data minimization technique.

return_results: bool

Whether to return the results or not. Default is False.

learning_task: str (Optional)

The learning task. Can be either “classification” or “regression”. If None, it will be inferred from the data.

Returns

float: The accuracy ratio for data minimization. pd.DataFrame: The results of the data minimization if return_results is True.