MLoop.Extensibility 0.45.1

dotnet add package MLoop.Extensibility --version 0.45.1
                    
NuGet\Install-Package MLoop.Extensibility -Version 0.45.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="MLoop.Extensibility" Version="0.45.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="MLoop.Extensibility" Version="0.45.1" />
                    
Directory.Packages.props
<PackageReference Include="MLoop.Extensibility" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add MLoop.Extensibility --version 0.45.1
                    
#r "nuget: MLoop.Extensibility, 0.45.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package MLoop.Extensibility@0.45.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=MLoop.Extensibility&version=0.45.1
                    
Install as a Cake Addin
#tool nuget:?package=MLoop.Extensibility&version=0.45.1
                    
Install as a Cake Tool

MLoop.Extensibility

Optional extensibility API for MLoop - enables code-based customization of AutoML pipeline.

Overview

MLoop.Extensibility provides interfaces for extending MLoop's AutoML capabilities through:

  • Hooks: Execute custom logic at lifecycle points (pre-train, post-train, etc.)
  • Custom Metrics: Optimize for business outcomes instead of generic accuracy

Features

  • ✅ Completely Optional: Works without any extensions
  • ✅ Zero-Overhead: < 1ms impact when not used
  • ✅ Type-Safe: Full C# type system with IDE support
  • ✅ Auto-Discovery: Convention-based discovery from filesystem

Quick Start

Install Package

dotnet add package MLoop.Extensibility

Create a Hook

using MLoop.Extensibility;

public class DataValidationHook : IMLoopHook
{
    public string Name => "Data Validation";

    public async Task<HookResult> ExecuteAsync(HookContext ctx)
    {
        var rowCount = ctx.DataView.Preview().RowView.Length;

        if (rowCount < 100)
        {
            return HookResult.Abort("Need at least 100 rows");
        }

        ctx.Logger.Info($"✅ Validation passed: {rowCount} rows");
        return HookResult.Continue();
    }
}

Create a Custom Metric

using MLoop.Extensibility;

public class ProfitMetric : IMLoopMetric
{
    public string Name => "Expected Profit";
    public bool HigherIsBetter => true;

    public async Task<double> CalculateAsync(MetricContext ctx)
    {
        var metrics = ctx.MLContext.BinaryClassification.Evaluate(ctx.Predictions);

        // Optimize for profit instead of accuracy
        return (metrics.PositiveRecall * 100.0) +  // $100 per True Positive
               (metrics.FalsePositiveRate * -50.0); // -$50 per False Positive
    }
}

API Reference

Interfaces

  • IMLoopHook - Lifecycle hook interface
  • IMLoopMetric - Custom metric interface

Context Classes

  • HookContext - Provides data and ML context to hooks
  • MetricContext - Provides predictions for metric calculation
  • HookResult - Return value for hooks (Continue or Abort)

Logger

  • ILogger - Logging interface for hook output

Documentation

For complete documentation, see:

License

MIT

Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on MLoop.Extensibility:

Package Downloads
MLoop.Core

MLoop Core - training (a trainer search over ML.NET trainers), prediction and model management on ML.NET

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.45.1 44 10/24/2026
0.45.0 53 10/23/2026
0.44.0 63 10/23/2026
0.43.0 67 10/23/2026
0.42.0 97 10/22/2026
0.41.0 103 10/21/2026
0.40.0 96 10/21/2026
0.39.0 97 10/21/2026
0.38.0 94 10/21/2026
0.37.1 95 10/21/2026
0.37.0 92 10/21/2026
0.36.0 96 10/20/2026
0.35.0 103 10/20/2026