explaingit

dotnet/machinelearning

9,328C#Audience · developerComplexity · 3/5Setup · easy

TLDR

ML.NET is Microsoft's free, open-source machine learning library for C# and .NET developers, train models, run predictions, and load TensorFlow or ONNX models, all without leaving the .NET ecosystem.

Mindmap

mindmap
  root((ML.NET))
    ML Tasks
      Classification
      Forecasting
      Anomaly detection
    Model Support
      TensorFlow
      ONNX
    Platforms
      Windows
      Linux
      macOS ARM64
    Audience
      C# developers
      .NET teams
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Add text classification, spam detection, or product recommendations to a C# app without switching to Python

USE CASE 2

Load a pre-trained TensorFlow or ONNX model and run predictions inside a .NET production service

USE CASE 3

Forecast future values from historical time-series data using a few lines of C#

USE CASE 4

Detect anomalies in sensor or business data by training a model on your own data pipeline

Tech stack

C#.NETF#TensorFlowONNX

Getting it running

Difficulty · easy Time to first run · 30min

Install with a single 'dotnet add package Microsoft.ML' command, no Python runtime or separate ML environment needed.

In plain English

ML.NET is Microsoft's open-source machine learning framework for .NET developers. Machine learning is the practice of training software on example data so it can make predictions or find patterns on new data, and ML.NET brings that capability to developers who already work in C#, F#, or other .NET languages without requiring them to switch to Python or R. The library covers common machine learning tasks such as classification (sorting items into categories), forecasting (predicting future values from historical data), and anomaly detection (spotting unusual patterns). It handles loading data from files and databases, transforming it into a form the algorithms can use, and training the model. Once trained, a model can be saved and loaded back into a production application. ML.NET also supports loading models created with TensorFlow and ONNX, two widely used formats from other machine learning ecosystems. This means a team could train a model using other tools and then run it inside a .NET application using ML.NET as the runtime. Adding the library to a project is a single command: dotnet add package Microsoft.ML. From there, developers write C# code to define a data pipeline, train a model, and call it with new inputs. Microsoft provides tutorials, sample projects, and a getting-started guide aimed at developers with no prior machine learning experience. The framework runs on Windows, Linux, and macOS, and supports ARM64 processors including Apple M1 chips. It works with both modern .NET Core and the older .NET Framework. The project is actively maintained by Microsoft and is free and open source.

Copy-paste prompts

Prompt 1
Write C# code using ML.NET to train a binary classifier that predicts whether a customer review is positive or negative.
Prompt 2
Show me how to load a pre-trained ONNX image classification model in ML.NET and run it on new images in a C# console app.
Prompt 3
I have a CSV of monthly sales figures. Write ML.NET C# code to train a time-series forecasting model and predict next month's value.
Prompt 4
How do I save a trained ML.NET model to disk and then load it in a separate ASP.NET Core endpoint to serve live predictions?
Prompt 5
Walk me through building an ML.NET anomaly detection pipeline in C# that flags unusual values in a stream of sensor readings.
Open on GitHub → Explain another repo

← dotnet on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.