Metrics Lodestar.Metrics - CyrilB1531/lodestar GitHub Wiki

Home › Metrics

Lodestar.Metrics

Evaluation metrics with scikit-learn's exact semantics: classification (precision, recall, F1, F-beta, the confusion matrix, the classification report, ROC-AUC, balanced accuracy, Matthews correlation, Cohen's kappa), regression, clustering and ranking metrics. Averaging, the positive label and zero_division behave as scikit-learn documents them, warnings included as a typed exception when asked for.

Install

dotnet add package Lodestar.Metrics

Example

using Lodestar.Metrics;

int[] yTrue = [1, 1, 1, 1, 0, 0, 0, 0];
int[] yPred = [1, 1, 0, 0, 1, 0, 0, 0];

double f1 = F1.Score(yTrue, yPred);   // 0.5714…

Parity

Replayed against sklearn.metrics. docs/equivalence.md maps each Python call to its C# counterpart, with every deliberate divergence.

Dependencies

A core package (decision 0003), built for net10.0 and netstandard2.0:

  • Lodestar.Abstractions 0.2.0 or later

Documentation