A20 - A20 index
\[\text{A20}(y, \hat{y}) =\]
Best possible score is 1.0, bigger value is better. Range = [0, 1]
a20-index evaluated metric by showing the number of samples that fit the prediction values with a deviation of ±20% compared to experimental values
I developed this metric based on a10-index
Latex equation code:
\text{A20}(y, \hat{y}) =
Example to use A20 metric:
from numpy import array
from permetrics.regression import RegressionMetric
## For 1-D array
y_true = array([3, -0.5, 2, 7])
y_pred = array([2.5, 0.0, 2, 8])
evaluator = RegressionMetric(y_true, y_pred, decimal=5)
print(evaluator.a20_index())
## For > 1-D array
y_true = array([[0.5, 1], [-1, 1], [7, -6]])
y_pred = array([[0, 2], [-1, 2], [8, -5]])
evaluator = RegressionMetric(y_true, y_pred, decimal=5)
print(evaluator.a20(multi_output="raw_values"))