CampusLearn
← BIT 304 Data Science and Analytics

Predictive Modelling: Regression and Classification

Notes

Targets and model families Predictive modelling learns patterns from historical examples to estimate outcomes for new observations. A feature is an input variable, while the target is the outcome being predicted. Regression predicts a numerical quantity, such as delivery cost; classification predicts a category, such as whether a loan becomes overdue. Linear regression models a numerical target as an intercept plus weighted inputs. Classification algorithms may produce probabilities that are converted into labels using a threshold. Features must be available at prediction time: information collected after the outcome creates leakage and can produce misleadingly strong evaluation scores. Evaluation and responsible interpretation Split data into training and evaluation sets so that performance is assessed on examples not used to fit the model. For time-dependent problems, preserve time order rather than allowing future observations to inform earlier predictions. Overfitting occurs when a model learns training-specific noise and generalises poorly. Mean absolute error averages absolute prediction mistakes for regression. For classification, precision measures the share of predicted positives that are actually positive, while recall measures the share of actual positives detected. Accuracy alone can conceal poor performance on rare outcomes. Examine error costs, fairness and operational usefulness before deployment. Practical example An Eldoret SACCO evaluates an overdue-loan classifier on 100 loans. Twenty are actually overdue. The model flags 25 loans, of which 15 are genuinely overdue and ten are false alarms. It misses five overdue loans. Precision is 15 divided by 25, or 60 percent; recall is 15 divided by 20, or 75 percent. The remaining 70 loans are correctly classified as not overdue, so accuracy is 85 percent. Lowering the alert threshold may increase recall while generating more false alarms. Staff should assess follow-up capacity and harm to members before selecting a threshold, rather than optimising accuracy alone.

Quiz

1. A classifier flags 25 loans and 15 are truly overdue. What is its precision?

2. Which task calls for regression rather than classification?

3. Which input would create leakage when predicting future overdue loans?

Sign in to submit and securely grade your quiz.