How machine learning builds a model
- Labelled examples Emails people have already marked as spam or not spam.
- Learning program Studies the examples and finds the patterns by itself.
- Model A set of learned patterns.
- Prediction The model judges new emails it has never seen.
| Item | Ordinary programming | Machine learning |
|---|---|---|
| Input | Data + hand-written rules | Data + correct answers (examples) |
| Output | Answers | A model (learned rules) that can give answers |
| When the world changes | A person rewrites the rules | Retrain the model on new examples |
| Good for | Clear, fixed logic (tax slabs, interest formulas) | Patterns too complex to write down (faces, speech, spam) |
Ordinary programming: data + rules give answers. Machine learning: data + answers give the rules (the model).
Splitting labelled data before training
- Labelled data Split into two parts before training.
- Training set Used to learn; commonly about 80%.
- Test set Kept hidden during training; commonly about 20%.
- Final check Shows how well the model handles examples it has never seen.
- Machine learning means learning patterns from examples rather than following hand-written rules.
- Features are the inputs; the label is the answer to be predicted; the model links them.
- Keep a test set aside and judge the model only on data it has not seen.