Regression: Predicting a Continuous Value
Unit ID: ML-M03-U02 Estimated active time: 30-40 minutes
Why this matters
Sometimes the target is a number.
In this module, one target is:
quiz_score_day10
The question is:
Using early activity data, can we make a first prediction of a learner's day-10 quiz score?
This is regression because the output is a number.
The idea
Regression models predict numeric values. The prediction may be 62.4, 81.7, or 43.1.
For the first regression model, we use only numeric day-3 features such as:
- prior Python score;
- diagnostic score;
- lessons started by day 3;
- practice minutes by day 3;
- quiz attempts by day 3; and
- last activity gap.
The model does not know the true day-10 score when making the prediction.
Predict
Which feature do you think might help predict day-10 quiz score?
Choose one and explain why:
practice_minutes_day3day3_last_activity_gap_hourslearner_id
learner_id should not be used as a real signal. It is only an identifier.
Run or inspect
A simple first candidate is linear regression.
The learner-facing question is not "Is linear regression the best possible model?"
The better question is:
Does a simple numeric model improve on predicting the training median for every learner?
That comparison is the heart of this unit.
Change one thing
If the target were completed_module1_by_day10, regression would no longer be the right first task. That target is a class: completed or not completed.
Practice
In the worked notebook:
- Load
module_03_regression_baseline_v1.csv. - Create
Xfrom the numeric feature columns. - Create
yfromquiz_score_day10. - Split into train and test.
- Fit a median baseline.
- Fit a linear regression model.
Check and explain
Answer:
If the linear regression has lower error than the median baseline, what does that suggest?
Do not say it proves the model is ready. Say it suggests the selected features contain useful signal for this synthetic task.
Takeaway
Regression predicts a number. A first regression model should beat a simple numeric baseline before we take it seriously.
