ML.NET.Classification.Metrics.Library is an extension library for ML.NET that adds detailed ROC curve generation and AUC calculation complementing ML.NET’s built-in metrics with richer visualization and custom threshold analysis
- ROC curve generation: Produces FPR/TPR arrays by sweeping (threshold bins + 1) from 1.0 to 0.0, giving a smooth approximation
- Custom threshold bins: Choose the number of bins to balance speed and fidelity
- Consistent AUC: Computes AUC via trapezoidal integration over the same ROC points, ensuring the curve and scalar metric stay aligned
- Interop-ready: Returns strongly-typed .NET structs, making results easy to visualize in charts, diagnostics, or reporting tools
- Add the NuGet package:
- dotnet add package ML.NET.Classification.Metrics --version 0.1.0
- Import the namespace in your code
- using ML.NET.Metrics.Evaluation;
- .NET 8.0
- Windows x64 native binary