holisticai.explainability.metrics.surrogate_accuracy_degradation#
- holisticai.explainability.metrics.surrogate_accuracy_degradation(y: ndarray | list[float] | Series, y_pred: ndarray | list[float] | Series, y_surrogate: ndarray | list[float] | Series)[source]#
Calculate the difference between the mean squared error of the original model and the surrogate model.
Parameters
- yArrayLike
The true target values.
- y_predArrayLike
The predicted target values of the original model.
- y_surrogateArrayLike
The predicted target values of the surrogate model.
Returns
- float
The difference between the mean squared error of the original model and the surrogate model
Examples
>>> import numpy as np >>> from holisticai.explainability.metrics.surrogate import ( ... surrogate_smape_difference, ... ) >>> y = np.array([1, 2, 3, 4, 5]) >>> y_pred = np.array([1.1, 2.2, 3.3, 4.4, 5.5]) >>> y_surrogate = np.array([1.2, 2.3, 3.4, 4.5, 5.6]) >>> surrogate_smape_difference(y, y_pred, y_surrogate)