Expand description
H-Measure
The hmeasure crate provides a Rust implementation of the H-measure. The H-measure is a coherent alternative to the widely used AUC measure (Area Under the ROC Curve) for assessing the relative quality of binary classifiers. Whereas the AUC implicitly assumes a different cost distribution for the “cost of being wrong” depending on the classifier it is applied to, the H-Measure, by contrast, enables the researcher to fix the cost distribution consistently across all classifiers studied. The “cost of being wrong” is an inherent property of the subject being modelled and should not depend on the specific model being used to model the subject. H-Measure enables that consistency, whereas AUC does not.
The H-measure was introduced by David J. Hand in the paper:
“Measuring classifier performance: a coherent alternative to the area under the ROC curve” Mach Learn (2009) 77: 103–123 https://link.springer.com/article/10.1007/s10994-009-5119-5
A rust pyo3-based wrapper to expose the hmeasure crate in python is provided at: https://github.com/robinwiseman/pyhmeasure
Benchmark comparisons of the Rust hmeasure implementation with an equivalent python implementation are also provided.
A discussion with further examples is provided in Chapter 2 of: https://github.com/robinwiseman/finML/blob/aa12845f01454c24f36f4df0d1cb6e0993ea7c7f/src/finML_2022.pdf
Structs§
- Beta
Params - A struct to hold the Beta distribution parameters.
- Binary
Class Params - A struct to hold the Beta distribution parameters for each class.
- Binary
Class Scores - A struct to hold the scores for each binary class.
- Binary
Classifier Scores - A struct to enable consistent, reproducible, generation of scores for a pair of binary classes.
- Cost
Ratio Density - CostRatioDensity: a struct to enable generating cost distributions using the Beta distribution
- HMeasure
- HMeasure: a struct to enable generating the H-Measure metric, given a cost distribution and binary classification scores for a pair of classes (class0 and class1). Priors for the class scores may be optionally specified, or inferred from the data provided. The scores are generated exogenously by a model (the hmeasure module is agnostic to the source of the scores).
- HMeasure
Results - HMeasureResults: a struct to receive the results of the HMeasure calculation and enable saving to file