Metrics (rojak.turbulence.metrics)#
Binary classification and association metrics for verifying turbulence diagnostics
This module provides dask- and xarray-aware implementations of metrics used to verify binary/categorical
turbulence forecasts against observed truth. Most functions accept dask.array.Array or dask-backed
xarray.DataArray inputs so that metrics can be computed lazily over large, chunked datasets.
The functionality is broadly grouped into:
Curve-based metrics summarising performance across all classification thresholds:
binary_classification_curve(),received_operating_characteristic(), andarea_under_curve().Point metrics computed from a 2x2 confusion matrix of true/false positives/negatives (see
confusion_matrix()), such asaccuracy(),f1_score(),matthews_corr_coeff(),critical_success_index(),gilbert_skill_score(), andtrue_skill_score().Association measures for (optionally multidimensional and/or stratified) binary variables, built on top of
contingency_table()andContingencyTable, such assample_odds_ratio(),relative_risk(), their conditional/marginal/stratified counterparts, andodds_ratio_from_table()andrelative_risk_from_table()for counts that are already tabulated, along with the multidimensional skill scoresmatthews_corr_coeff_multidim()andjaccard_index_multidim().
Functions
|
Compute the Accuracy (ACC) |
|
Area under the curve |
|
Binary classification curve |
Binary classification curve with cumulative sum on labels |
|
|
Sample odds ratio between two binary variables, conditional on one or more control variables |
|
Compute the confusion matrix |
|
Contingency Table for multidimensional arrays |
|
Compute the Critical Success Index (CSI) or the Jaccard Similarity Coefficient Score |
|
Compute the F1 Score |
|
Compute the Gilbt Skill Score |
|
Jaccard Index or Critical Success Index for multidimensional data |
|
Marginal (pooled) sample odds ratio between two binary variables, aggregated over one or more control variables |
|
Compute the Matthew's Correlation Coefficient |
|
Matthews Correlation Coefficient for multidimensional arrays |
|
Mean Absolute Error (MAE) |
|
Compute the (log) sample odds ratio directly from a |
|
Received operating characteristic or ROC curve |
|
Relative risk of an outcome with respect to an exposure variable |
|
Compute the (log) relative risk directly from a |
|
Sample odds ratio between two binary variables |
|
Sensitivity statistical metric |
|
Specificity statistical metric :param true_negative: :param false_positive: |
|
Compute contingency tables stratified by one or more control variables |
|
Relative risk of an outcome with respect to an exposure variable, stratified by one or more control variables |
|
True Skill Score (TSS) statistic |
Classes
|
|
|