MLoop.Core
0.42.0
dotnet add package MLoop.Core --version 0.42.0
NuGet\Install-Package MLoop.Core -Version 0.42.0
<PackageReference Include="MLoop.Core" Version="0.42.0" />
<PackageVersion Include="MLoop.Core" Version="0.42.0" />
<PackageReference Include="MLoop.Core" />
paket add MLoop.Core --version 0.42.0
#r "nuget: MLoop.Core, 0.42.0"
#:package MLoop.Core@0.42.0
#addin nuget:?package=MLoop.Core&version=0.42.0
#tool nuget:?package=MLoop.Core&version=0.42.0
MLoop.Core
The in-process library behind the mloop CLI: AutoML training on ML.NET, prediction from a saved
model, data loading with Korean-encoding detection, and the evaluation rules (quality gate, metric
names and directions) the CLI applies.
Most users want the CLI (dotnet tool install -g mloop) or its HTTP server (mloop serve): they
keep MLoop in its own process and add the project layout, experiment tracking and promotion. Use
this package when a host must call the engine in process and work with typed results. It is
versioned with the CLI.
Installation
dotnet add package MLoop.Core
Usage
using Microsoft.ML;
using MLoop.Core.AutoML;
using MLoop.Core.Data;
using MLoop.Core.Models;
using MLoop.Core.Prediction;
var ml = new MLContext(seed: 42);
// Train: AutoML search within the time budget, evaluated on a held-out split.
var runner = new AutoMLRunner(ml, new CsvDataLoader(ml));
var result = await runner.RunAsync(new TrainingConfig
{
ModelName = "default",
DataFile = "train.csv",
LabelColumn = "Target",
Task = "binary-classification",
TimeLimitSeconds = 60,
});
Console.WriteLine($"{result.BestTrainer}: {string.Join(", ", result.Metrics)}");
// Save, then predict rows against the saved model and the schema training captured.
ml.Model.Save(result.Model, inputSchema: null, "model.zip");
var predictions = new PredictionService(ml).Predict(
[new Dictionary<string, object> { ["Age"] = 42f, ["Income"] = 51000f }],
result.Schema!,
"model.zip",
"binary-classification",
labelColumn: "Target");
foreach (var row in predictions.Rows)
Console.WriteLine($"{row.PredictedLabel} {row.Score}");
AutoMLRunner reports progress through IProgress<TrainingProgress> and takes a
CancellationToken. Its optional warningSink and narrationSink receive the warnings and progress text
the CLI prints.
Requirements
- .NET 10.0+
- ML.NET 5.0+
- Time-series tasks (forecasting, time-series anomaly detection) need ML.NET's MKL native library,
which has no osx-arm64 build;
TimeSeriesNativeSupport.IsAvailablesays whether it loaded.
License
MIT License
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- CsvHelper (>= 33.1.0)
- FilePrepper (>= 0.11.1)
- Microsoft.Bcl.Memory (>= 9.0.14)
- Microsoft.CodeAnalysis.CSharp (>= 5.3.0)
- Microsoft.CodeAnalysis.CSharp.Scripting (>= 5.3.0)
- Microsoft.Data.Analysis (>= 0.23.0)
- Microsoft.Extensions.DependencyInjection (>= 10.0.13)
- Microsoft.ML (>= 5.0.1)
- Microsoft.ML.AutoML (>= 0.23.1)
- Microsoft.ML.OnnxConverter (>= 0.23.1)
- Microsoft.ML.TorchSharp (>= 0.23.1)
- Microsoft.ML.Vision (>= 5.0.1)
- MLoop.Extensibility (>= 0.42.0)
- Serilog (>= 4.3.0)
- Serilog.Sinks.Console (>= 6.1.1)
- Spectre.Console (>= 0.55.0)
- YamlDotNet (>= 17.0.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.