Machine Learning with .NET
Lesson 1 of 1 100% of course

Getting Started with ML.NET (Regression Analysis)

16 · 8 min · 5/23/2026

Sign in to track progress and bookmarks.

What is ML.NET?

ML.NET is an open-source, cross-platform machine learning framework for .NET developers. You can use your existing C# or F# skills to integrate ML into your apps locally, without needing Python!

Scenario: Predicting House Prices

We'll use standard regression to predict a value based on input features.


using Microsoft.ML;
using Microsoft.ML.Data;

// Define Data Structures
public class HouseData {
    public float Size { get; set; }
    public float Price { get; set; }
}

public class Prediction {
    [ColumnName("Score")]
    public float Price { get; set; }
}

// Training Logic
var mlContext = new MLContext();
var dataView = mlContext.Data.LoadFromEnumerable(new List { /* Load data */ });
var pipeline = mlContext.Transforms.Concatenate("Features", "Size")
                .Append(mlContext.Regression.Trainers.Sdca(labelColumnName: "Price"));

var model = pipeline.Fit(dataView);
                    

Test your knowledge

Quizzes linked to this course—pass to earn certificates.

Browse all quizzes
Machine Learning with .NET

On this page

What is ML.NET? Scenario: Predicting House Prices
1. ML.NET Basics
Getting Started with ML.NET (Regression Analysis)