What Is Regression in Machine Learning?
Regression is a supervised machine learning task that predicts a continuous numerical value from one or more input features. Regression is defined in Wikipedia as:
In statistical modeling, regression analysis is a set of statistical processes for estimating the relationships between a dependent variable (often called the ‘outcome’ or ‘response’ variable) and one or more independent variables (often called ‘predictors,’ ‘covariates,’ ‘explanatory variables’ or ‘features’). The most common form of regression analysis is linear regression. One finds the line (or a more complex linear combination) that most closely fits the data according to a specific mathematical criterion.
In plain terms, you want to predict a numerical value from other numerical values, as described in the TensorFlow Developer Certificate course. In Machine Learning, regression analysis is widely used for prediction and forecasting. For instance, you can use regression models to predict house sale prices, modelled against the number of bedrooms, bathrooms, or garages.
Other applications of regression include predicting how many people will buy an app, forecasting seasonal sales,
and even predicting bounding-box coordinates in an object detection task.
With regression, you are answering the questions “How many?” and “How much?”
Building a Regression Model in TensorFlow: Three Steps
When you build neural networks in TensorFlow with the Keras Sequential API, you generally follow three steps:
- create a model and define the input, hidden and output layers, and the number of neurons in each layer;
- compile the model with the required loss function, optimiser, and evaluation metrics;
- fit the model to find patterns between features and labels.
In the code below, I create a simple regression model with input features stored in X and output stored in y. For demonstration purposes, I kept the data small — just enough to show how you build a regression model and then improve it by adjusting hyperparameters at the compile and fit steps.
Improving Regression Model Performance: Hyperparameter Tuning
🔒 Subscribe to keep reading.
Evaluating Regression Models with Larger Datasets
🔒 Subscribe to keep reading.
Train, Validation, and Test Dataset Splits
🔒 Subscribe to keep reading.
Evaluating Model Predictions with MAE and MSE
🔒 Subscribe to keep reading.
Final Thoughts
🔒 Subscribe to keep reading.
References
🔒 Subscribe to keep reading.
You've hit a Deep Dive tutorial.
I spend dozens of hours researching, coding, and breaking things to write these guides. This content is free, but reserved for my subscriber community. Drop your email below to unlock this guide (and all past/future deep dives):
Full content temporarily unavailable — refresh in a moment
Already a subscriber? Use the magic link from your last newsletter, or reset your password.
Log in to unlock
New subscribers get an inbox mail: Set a password to unlock articles. The form does not log you in — use the same email afterwards.