v0.6.9 Release - #439
Conversation
Relax Precision, Recall and F1 (structs and free functions) from Number + RealNumber + FloatNumber to Number. Classification metrics need only equality and a canonical class key, so ordered integer labels (u16, i32, ...) now work. This lets the same y feed RandomForestClassifier::fit (Number + Ord) and cross_validate with &precision / &recall / &f1. Class keys are derived through a shared label_bits helper (to_f64 widening) instead of RealNumber::to_f64_bits raw transmutation; float-input scores are unchanged. - add integer-label unit tests to precision/recall/f1 - add regression test: cross_validate(RandomForestClassifier, ..., &precision) with Vec<u16> labels (#322) - bump patch 0.6.8 -> 0.6.9
- label_bits: replace unwrap with expect for a clear panic message when a custom Number impl fails to_f64 conversion - regression test: use DenseMatrix<f32> features, mirroring the exact report in #322
ReviewVerified locally on the
Code correctness looks solid:
One inconsistency worth fixing before/after merge (not caught by tests/clippy since it's an unused path):
ClassificationMetrics::<u16>::precision();
// error[E0599]: trait bounds not satisfied: `u16: RealNumber`, `u16: FloatNumber`So the struct-based entry point still can't be used with integer labels even though Minor nit: the CHANGELOG entry says labels "no longer need to implement Otherwise LGTM — approve after the |
precision/recall/f1 on ClassificationMetrics<T> still required Number + RealNumber + FloatNumber, so the struct-based entry point could not be used with integer labels even though Precision/Recall/F1 and the free functions accept any Number (#322). Split roc_auc_score into its own impl block with the bounds AUC itself needs. Also complete the CHANGELOG wording: FloatNumber was dropped from the bounds too.
No description provided.