Skip to content
Samples for ML.NET, an open source and cross-platform machine learning framework for .NET.
Branch: master
Clone or download
Latest commit 73d6453 Apr 23, 2019
Type Name Latest commit message Commit time
Failed to load latest commit information.
datasets Minor changes Apr 23, 2019
docs Minor changes Apr 23, 2019
images Restructured Heart Disease sample and added the heart disease dataset… Apr 12, 2019
samples Minor changes Apr 23, 2019
.gitattributes Clustering_Iris sample updated Oct 24, 2018
.gitignore #117: Migrated BikeSharingDemand sample to F# (ML.NET v0.7) Nov 9, 2018
.vsts-dotnet-ci.yml Migrate remaining inprogress samples to v1.0.0-preview (#360) Apr 10, 2019 Update Oct 2, 2018
LICENSE Initial commit Jun 4, 2018 Minor changes Apr 23, 2019 Initial commit Jun 4, 2018
build.ps1 Centralize build Jun 4, 2018

ML.NET Samples

ML.NET is still new, and as we are developing it, we would love to get your feedback! Please fill out the brief survey below and help shape the future of ML.NET by telling us about your usage and interest in Machine Learning and ML.NET.

Take the survey now!

At the end of the survey, you can leave your name and e-mail address (optional) so that an engineer on the .NET team can reach out to you to talk a little bit more about your experiences and thoughts. We appreciate your contribution!

ML.NET is a cross-platform open-source machine learning framework that makes machine learning accessible to .NET developers. In this GitHub repo, we provide samples which will help you get started with ML.NET and how to infuse ML into existing and new .NET apps.

There are two types of samples/apps in the repo:

  • Getting Started - ML.NET code focused samples for each ML task or area, usually implemented as simple console apps.

  • End-End apps - Real world examples of web, desktop, mobile, and other applications infused with Machine Learning using ML.NET

The official ML.NET samples are divided in multiple categories depending on the scenario and machine learning problem/task, accessible through the following table:

ML Task



Binary classification

Binary classification chart
Task of classifying the elements of a given set into two groups, predicting which group each one belongs to.

Sentiment analysis     C#     F#   Getting started icon

Spam Detection     C#     F#   Getting started icon

Fraud detection    C#    F#    Getting started icon

Heart disease detection    C#    F#    Getting started icon

Multi-class classification

Multi-class classification
Task of classifying instances into one of three or more classes, predicting which group each one belongs to.

Issues classification     C#    F#    End-to-end app icon

Iris flowers classification    C#    F#    Getting started icon

MNIST    C#    F#     Getting started icon


regression icon
The task is to predict a numeric value with given input variable data. It is widely used for forecasting and 'how much / how many' predictions.

Price prediction     C#     F#   Getting started icon

Sales forecast     C#    End-to-end app icon

Demand prediction     C#    F#    Getting started icon


Recommendations icon
Recommender systems are typically based on content based and collaborative filtering methods. A collaborative method predicts what items/products a user might like based on his past actions/likes/ratings compared to other users.

Movie recommender     C#    Getting started icon C#    End-to-end app icon

Product recommender     C#     F#   Getting started icon


Clustering plotting
ML task of grouping a set of objects in such a way that objects in the same group (called a cluster) are more similar to each other than to those in other groups. It is an exploratory task. It does not classify items across particular labels.

Customer segmentation     C#     F#   Getting started icon

Clustering Iris flowers     C#     F#   Getting started icon

Anomaly detection

anomaly detection chart
Task's goal is the identification of rare items, events or observations which raise suspicions by differing significantly from the majority of the data.Usually problems such as bank fraud, structural defects or medical problems

Spike Detection-Shampoo Sales     C#     F#     Getting started icon C#    End-to-end app icon

Spike Detection-PowerMeter Readings     C#     F#   Getting started icon


Ranking logo
Construction of ranking models for information retrieval systems so the items are ordered/ranked based on user's input variables such as likes/dislike, context, interests, etc.

Coming soon

Deep Learning

DeepLearning logo
Deep learning is a subset of machine learning. Deep learning architectures such as deep neural networks, are usually applied to fields such as computer vision (object detection, image classification, style transfer), speech recognition, natural language processing and audio recognition.

TensorFlow(ML.NET Scoring)    C#     F#    Getting started icon

TensorFlow(ML.NET Estimator)    C#     F#    Getting started icon

Object detection with ONNX model    C#     F#    Getting started icon

Style Transfer Coming soon    End-to-end app icon

Cross Cutting ML.Net Samples: The below samples are created for cross cutting scenarios like Scalable WebAPI services, Datasets stored in Database etc.

Sample Name


ML Scenarios

Scalable WebAPI

Binary classification chart
This sample explains how to optimize your code when running an ML.NET model on an ASP.NET Core WebAPI service

Sentiment analysis     C#     Getting started icon

NuGet feed configuration: Usually you just need to use the regular NuGet feed (, however, during a few days before releasing a minor release (such as 0.9, 0.10, 0.11, etc.) we'll be using Preview NuGet packages available in MyGet (such as 0.11.0-preview-27128-1), not available in the regular NuGet feed.

If that is the case, please use this MyGet feed in Visual Studio or your NuGet feed configuration:

Additional Community Samples

In addition to the ML.NET samples provided by .NET Foundation, we're also highlighting samples created by the community shocased in this separated page: ML.NET Community Samples

Those Community Samples are not maintained by .NET Foundation but by their owners. If you have created any cool ML.NET sample, please, add its info into this REQUEST issue and we'll publish its information in the mentioned page, eventually.

Translations of Samples:

Learn more

See ML.NET Guide for detailed information on tutorials, ML basics, etc.

API reference

Check out the ML.NET API Reference to see the breadth of APIs available.


We welcome contributions! Please review our contribution guide.


Please join our community on Gitter Join the chat at

This project has adopted the code of conduct defined by the Contributor Covenant to clarify expected behavior in our community. For more information, see the .NET Foundation Code of Conduct.


ML.NET Samples are licensed under the MIT license.

Datasets are licensed under the original terms that the .NET Foundation received such datasets, as specified here.

You can’t perform that action at this time.