Skip to content

This repo hosts the code for the Getting Started with ML.NET O'Reilly course

License

Notifications You must be signed in to change notification settings

carlotta94c/intro-to-ml-in-dot-net

Repository files navigation

Introduction to ML.NET

This repository contains the exercise material for the O'Reilly course Introduction to ML.NET - Machine Learning for .NET developers.

Nowadays, machine learning is everywhere and we use ML-empowered applications every day: when choosing the next TV series to watch based on Netflix recommendations, for example, or when asking Alexa to play our favorite song.

If you think of yourself as a developer, you might see machine learning as a separate art, practiced by an elite group of data scientists and statisticians. You might be uncertain about how it fits into application development. During this training you'll learn how ML.NET framework is designed to democratize the art of machine learning, making it accessible to all developers and making a smoother experience of integrating a trained model into an existing or a new .NET solution.

Exercise 1 - Training a classification model in ML.NET

The key learning objective of this exercise is building a data classification model in ML.NET using Visual Studio Model Builder and integrate it into a console app. The model will be trained to predict a potential sleep disorder starting from information about the sleep habits and lifestyles of the patient. The application enables the user to interact with the model and get the predictions through the console.

Exercise 2 - Fine-tuning a text classification model with Model Builder

The key learning objective of this exercise is building a text classifier in ML.NET able to predict if a news title is fake or not. The model will be consumed into an ASP.NET Razor Pages web app, enabling the user to interact with the model trough the console, get the predictions and also re-train the machine learning pipeline with hyper parameters to improve model performance.

Exercise 3 - Embed a text classifier into a Razor Pages web app

The key learning objective of this exercise is embedding the text classifier model obtained in exercise 2 into an ASP.NET Razor Pages web app, enabling the user to interact with the model and get the predictions through a simple GUI. The app can be deployed into the Azure Cloud using Azure Web App service, building a CI/CD pipeline using GitHub Workflow Actions.

Pre-requisites

To set up your local environment and run the ML.NET projects you need to configure the following pre-requisites:

Optional steps

If you'd like to deploy your web app on the cloud you'd need a pair of additional prerequisites:

If you'd like to run the advanced exercises with Polyglot Notebooks you need to additionally install:

Advanced exercises

Getting started with Polyglot Notebooks in Visual Studio Code

The exercises above leverage Model Builder to automatize some steps of the ML workflow and generate the base code. In this exercise, we create and execute our first Polyglot Notebooks and learn how to share variables across different language kernels.

Training a classification model with AutoML and Polyglot Notebooks

The key learning objective of this exercise is building a data classification model using the same dataset as in Exercise 1, but with a code-first approach using Polyglot Notebooks and AutoML API.

Sentence similarity with Model Builder

Sentence Similarity is an advanced Natural Language Processing (NLP) scenario supported by ML.NET and by the Model Builder extension of Visual Studio. This exercise goal is to fine-tune the TorchSharp implementation of the NAS-BERT model available in ML.NET with a custom dataset for the sentence similarity task.

Useful Resources

About

This repo hosts the code for the Getting Started with ML.NET O'Reilly course

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published