Regression and AI in practice
Regression and AI in practice
- Some AI tasks predict a number rather than a category — that's regression.
- Both are supervised learning.
- Real systems combine trained models into a pipeline.
Regression vs classification
- Classification predicts a category (cat/dog, spam/not-spam).
- Regression predicts a number (a house price, tomorrow's temperature).
- Both are supervised; the choice depends on whether the answer is a number or a label.
The difference between regression and classification is that regression predicts:
Regression outputs a continuous number (price, temperature); classification outputs a category.
Which is a classification task?
Cat-vs-dog is a category (classification); the others predict numbers (regression).
Linear regression
- Linear regression fits a straight line (or hyperplane):
- The coefficients are chosen to minimise the sum of squared errors against the training data.
- Use it when the relationship looks roughly linear and you want an interpretable model; curved data needs polynomial, tree or neural-network regression — same idea (model + loss + minimise).
Linear regression chooses its coefficients to:
It fits the line/hyperplane that makes the squared differences from the data points as small as possible.
AI in a real scenario
- Most scenarios use a deep model trained on labelled data, often several combined:
- Face identification: trained on labelled faces → a camera captures a face → image recognition extracts a representation → match against registered customers.
- Reading a label aloud: image recognition finds text → OCR extracts characters → machine translation → text-to-speech.
- By the time a user interacts, the model only does fast forward-pass inference — the intelligence is in the learned patterns.
When a user interacts with a trained model, the system does:
Training happened earlier; using the model is a single forward pass to get a prediction.
A "read a sign aloud" feature typically chains which models?
Several trained models form a pipeline: find the text, extract characters, translate, then speak.
You've got it
- classification predicts a category; regression predicts a number (both supervised)
- linear regression fits a line by minimising the sum of squared errors
- real systems chain trained models into a pipeline (e.g. image recognition → OCR → translation → TTS)
- using a trained model is just a fast forward pass (inference)