Expand description
Scoring: a lightweight metric abstraction usable standalone or, optionally,
backed by smartcore::metrics.
The Scorer trait is deliberately tiny — a single score call over
y_true / y_pred. Built-in scorers (accuracy, MAE, MSE, RMSE, R²) are
implemented directly here so the crate needs no modeling dependency. For
metrics that already exist in mature form elsewhere (F1, ROC-AUC, …), enable
the smartcore-metrics feature to get smartcore_adapter rather than
reimplementing them.
User-defined metrics are first-class: wrap any closure with
make_scorer.
Modules§
- smartcore_
adapter - Feature-gated adapters wrapping
smartcore::metricsasScorers.
Structs§
- Accuracy
- Classification accuracy: the fraction of predictions that exactly match.
- Closure
Scorer - A
Scorerbacked by an arbitrary closure — the analogue of scikit-learn’smake_scorer, so users are never limited to the built-ins. - Mean
Absolute Error - Mean absolute error.
- Mean
Squared Error - Mean squared error.
- R2Score
- Coefficient of determination, R².
- Root
Mean Squared Error - Root mean squared error.
Traits§
- Scorer
- A scoring metric over true and predicted target vectors.
Functions§
- make_
scorer - Wrap a closure as a
Scorer.