What is a regression problem? Please provide an example.
Hello, I'll try to explain this problem, hoping it helps you.
What is a Regression Problem?
You can understand it this way: in machine learning, we often need to make predictions. The prediction targets can be divided into two types:
- Predicting a category: For example, predicting whether an email is "spam" or "normal mail," or whether an image contains a "cat" or a "dog." This type of problem is like a multiple-choice question, where the answer is one of a few fixed options. This is called a Classification Problem.
- Predicting a specific numerical value: For example, predicting tomorrow's temperature in degrees, or the price of a house in millions. This type of problem is like a fill-in-the-blank question, where the answer is a continuously varying number. This, is a Regression Problem.
So, a Regression Problem is simply about predicting a continuous, specific numerical value. Its goal is to find a "formula" or "model" to understand the relationship between a set of influencing factors (which we call "features") and a numerical outcome (which we call "labels").
A Few Real-Life Examples
This might still sound a bit abstract, so let's look at a few concrete examples to make it clearer.
Example One: Predicting House Prices (The Most Classic Example)
This is one of the most common applications of regression.
- What are you predicting?
- The specific price of a house, e.g.,
$1.235 million
. This is a specific numerical value.
- The specific price of a house, e.g.,
- What information do you need to help you predict?
- House size (square meters)
- Number of bedrooms
- House location (e.g., how far from the city center)
- Floor level
- Year built
- How is it done?
- A machine learning model learns from information and final prices of thousands of houses that have already been sold. Through learning, it finds the mathematical relationship between factors like size, location, and house price.
- When you provide it with information about a new house, it can estimate a specific price based on the learned relationships.
Example Two: Predicting Tomorrow's Temperature
Weather forecasting is a typical regression application.
- What are you predicting?
- The specific temperature at 12 PM tomorrow, e.g.,
26.5℃
.
- The specific temperature at 12 PM tomorrow, e.g.,
- What information do you need to help you predict?
- Today's temperature, humidity, wind speed
- Historical weather data for the same period
- Atmospheric pressure
- How is it done?
- The model learns from historical meteorological data, identifying patterns between these factors and future temperature changes, thereby predicting a specific temperature value.
Example Three: Predicting Video Views
As a video creator, you might want to know how many views a newly published video will get.
- What are you predicting?
- The number of views within 24 hours of video release, e.g.,
58,432 views
.
- The number of views within 24 hours of video release, e.g.,
- What information do you need to help you predict?
- Video duration
- Video tags
- Release time (Is it Friday evening or Monday morning?)
- Average performance of your past videos
- How is it done?
- The model analyzes various features of your (or all creators') past videos and their corresponding view counts, finding a pattern that can predict views.
Simple Summary
Regression | Classification | |
---|---|---|
Goal | Predict a specific numerical value | Predict a fixed category |
Question | "How much/How many?" | "Which one?" |
Examples | House prices, temperature, scores | Spam or not, cat or dog in image |
Hope this explanation makes it easier for you to understand what a regression problem is!