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

_is_torch(x)

r_squared(residuals, data[, axis, ...])

Coefficient of determination 1 - SS_res / SS_tot along axis, with SS_tot = sum((data - mean(data))^2).

rmse(residuals[, axis])

Root-mean-square residual sqrt(mean(residuals^2)) along axis (None: all elements).

sum_squared_residuals(residuals[, axis])

sum(residuals^2) along axis (None: all elements).

sum_squared_residuals(residuals, axis=-1)[source]#

sum(residuals^2) along axis (None: all elements).

Parameters:
Return type:

Any

rmse(residuals, axis=-1)[source]#

Root-mean-square residual sqrt(mean(residuals^2)) along axis (None: all elements).

Parameters:
Return type:

Any

r_squared(residuals, data, axis=-1, empty_value=0.0, threshold=0.0, dtype=None)[source]#

Coefficient of determination 1 - SS_res / SS_tot along axis, with SS_tot = sum((data - mean(data))^2). Where SS_tot <= threshold (a flat decay) the result is empty_value. dtype sets the precision of the ratio (default: that of SS_res).

Parameters:
Return type:

Any