Metrics

Evaluation metrics

source

rpd

 rpd (y:numpy.ndarray, y_hat:numpy.ndarray)

Ratio of Performance to Deviation

Type Details
y ndarray Target true value
y_hat ndarray Target predicted value
y = np.array([1, 2, 3, 4])
y_hat = np.array([2, 3, 4, 5])
is_close(rpd(y, y_hat), 1.29, eps=0.001)
True

source

rpiq

 rpiq (y:numpy.ndarray, y_hat:numpy.ndarray)

Ratio of Performance to Inter-Quartile

Type Details
y ndarray Target true value
y_hat ndarray Target predicted value
y = np.array([1, 2, 3, 4])
y_hat = np.array([2, 3, 4, 5])
is_close(rpiq(y, y_hat), 1.5)
True

source

stb

 stb (y:numpy.ndarray, y_hat:numpy.ndarray)

Standardized Bias

Type Details
y ndarray Target true value
y_hat ndarray Target predicted value
y = np.array([1, 2, 3, 4])
y_hat = np.array([2, 3, 4, 5])
is_close(stb(y, y_hat), -0.666, eps=0.001)
True

source

mape

 mape (y:numpy.ndarray, y_hat:numpy.ndarray)

Mean Absolute Percentage Error

Type Details
y ndarray Target true value
y_hat ndarray Target predicted value
y = np.array([1, 2, 3, 4])
y_hat = np.array([2, 3, 4, 5])
is_close(mape(y, y_hat), 52.083, eps=0.001)
True

source

lccc

 lccc (y:numpy.ndarray, y_hat:numpy.ndarray)

Lin’s concordance correlation coefficient

Type Details
y ndarray Target true value
y_hat ndarray Target predicted value
y = np.array([1, 2, 3, 4])
y_hat = np.array([2, 3, 4, 5])
is_close(lccc(y, y_hat), 0.714, eps=0.001)
True

source

eval_reg

 eval_reg (y:numpy.ndarray, y_hat:numpy.ndarray, is_log:bool=True)

Return metrics bundle (rpd, rpiq, r2, lccc, rmse, mse, mae, mape, bias, stb)

Type Default Details
y ndarray Target true value
y_hat ndarray Target predicted value
is_log bool True True if evaluated values are log-10 transformed
eval_reg(y, y_hat)
{'rpd': 1.2909944487358056,
 'rpiq': 1.5,
 'r2': 0.19999999999999996,
 'lccc': 0.7142857142857144,
 'rmse': 45226.70146053103,
 'mse': 2045454525.0,
 'mae': 24997.5,
 'mape': 900.0,
 'bias': -1.0,
 'stb': -0.6666666666666666}