pyfli.cm_stats.goodness_of_fit#
Residual-based goodness of fit: sum of squared residuals, RMSE and the coefficient of determination R2, for NumPy arrays or torch tensors.
Functions
|
|
|
Coefficient of determination |
|
Root-mean-square residual |
|
|
- sum_squared_residuals(residuals, axis=-1)[source]#
sum(residuals^2)along axis (None: all elements).
- rmse(residuals, axis=-1)[source]#
Root-mean-square residual
sqrt(mean(residuals^2))along axis (None: all elements).
- r_squared(residuals, data, axis=-1, empty_value=0.0, threshold=0.0, dtype=None)[source]#
Coefficient of determination
1 - SS_res / SS_totalong axis, withSS_tot = sum((data - mean(data))^2). WhereSS_tot <= threshold(a flat decay) the result is empty_value. dtype sets the precision of the ratio (default: that ofSS_res).