Regression

Learn how to apply regression in ML.NET.

In ML, regression is a type of supervised learning task that involves predicting a continuous numerical value or a set of values. The goal of regression is to build a model that can learn the relationship between a set of input features and the corresponding target variable, allowing us to make predictions for new, unseen data. The following diagram provides an illustration of how a regression prediction works:

Press + to interact
Regression illustrated
Regression illustrated

In a regression task, the input data consists of instances with multiple features or independent variables. These features could represent various characteristics or attributes of the data, such as age, temperature, or income. The target variable, also known as the dependent variable, is the value we want to predict based on the input features. The target variable is continuous or scalar, meaning it can take on any real value within a certain range. Examples of regression tasks include predicting housing prices based on features like location and size, forecasting stock prices based on historical data, or estimating the sales volume based on advertising expenditure and other factors.

Building a regression model

We'll use the following playground setup to demonstrate how a regression model can be trained by an ML.NET CLI command. In this playground, we have a file containing comma-separated data on house prices in Lisbon, Portugal. ...