whatisgithub

What is machinelearning-samples?

dotnet/machinelearning-samples — explained in plain English

Analysis updated 2026-06-26

4,683PowerShellAudience · developerComplexity · 2/5Setup · easy

In one sentence

A collection of ready-to-run ML.NET sample projects showing .NET developers how to add AI features like sentiment analysis, fraud detection, image classification, and recommendations directly in C# or F#.

Mindmap

mindmap
  root((ML.NET Samples))
    Tasks covered
      Sentiment analysis
      Fraud detection
      Image classification
      Recommendations
    Tech stack
      C#
      F#
      ML.NET
      .NET SDK
    Sample types
      Console apps
      Full UI apps
    Audience
      .NET developers
      ML beginners
    Use cases
      Learn ML in .NET
      Add AI to apps
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

What do people build with it?

USE CASE 1

Learn how to build a sentiment analysis feature in a C# application that classifies text as positive or negative.

USE CASE 2

Add a product or movie recommendation engine to a .NET application using the ML.NET collaborative filtering samples.

USE CASE 3

Implement image classification or object detection in a desktop or web app without leaving the .NET ecosystem.

What is it built with?

C#F#.NETML.NET

How does it compare?

dotnet/machinelearning-samplesdisassembler0/win10-initial-setup-scriptmantvydasb/redteaming-tactics-and-techniques
Stars4,6834,6524,590
LanguagePowerShellPowerShellPowerShell
Setup difficultyeasyeasyhard
Complexity2/52/54/5
Audiencedevelopergeneraldeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 30min

Requires the .NET SDK, image classification samples may need additional model files or a GPU for training.

So what is it?

This repository is a collection of sample projects that show how to use ML.NET, Microsoft's machine learning framework for the .NET ecosystem. ML.NET lets C# and F# developers add AI-powered features to their applications without switching to Python or another language. The samples are organized into two types. The first type is simple console applications that each demonstrate one specific machine learning task, meant to help a developer understand how a particular technique works. The second type is complete end-to-end applications with web or desktop user interfaces, showing how a trained model fits into a real product. The scenarios covered include sentiment analysis (deciding whether a piece of text is positive or negative), spam detection, credit card fraud detection, price prediction, sales forecasting, product and movie recommendations, image classification, object detection, handwriting recognition, and more. Each sample comes with the code needed to load data, train a model, and make predictions. The samples are written for .NET developers who are new to machine learning and want a practical starting point using tools and languages they already know. Most samples are provided in both C# and F#. No prior machine learning experience is assumed, though familiarity with .NET development is expected. This repository holds only the sample code. If you encounter a bug in the ML.NET framework itself rather than in a sample, the project README directs you to file the issue in the main ML.NET repository instead.

Copy-paste prompts

Prompt 1
Using the ML.NET machinelearning-samples pattern, write C# code to train a binary classifier that detects spam emails from a CSV dataset.
Prompt 2
Show me how to load a pre-trained ML.NET model in an ASP.NET Core web API and call it to make real-time predictions on incoming requests.
Prompt 3
Convert the ML.NET credit card fraud detection sample from C# to F# and explain the key differences in the code.
Prompt 4
Walk me through the ML.NET image classification sample and explain how to swap in my own dataset of product photos.

Frequently asked questions

What is machinelearning-samples?

A collection of ready-to-run ML.NET sample projects showing .NET developers how to add AI features like sentiment analysis, fraud detection, image classification, and recommendations directly in C# or F#.

What language is machinelearning-samples written in?

Mainly PowerShell. The stack also includes C#, F#, .NET.

How hard is machinelearning-samples to set up?

Setup difficulty is rated easy, with roughly 30min to a first successful run.

Who is machinelearning-samples for?

Mainly developer.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.