Machine learning is the practice of letting a program learn from examples. Most real projects follow the same loop: collect data, train a model, test it, and improve it.
Types of learning
- Supervised learning: each example has a correct label (a CV marked "good fit" or "poor fit"). The model learns to predict the label.
- Unsupervised learning: no labels. The model finds structure by itself, for example grouping similar jobs together (clustering).
- Self-supervised learning: the labels come from the data itself. A language model hides the next word in a sentence and learns to predict it. This is how large language models are pretrained.
Classification and regression
Classification predicts a category (spam or not spam). Regression predicts a number (a salary estimate). Many questions can be framed either way.
Training, validation and test sets
Never judge a model on the data it learned from. Split your data into three parts:
- Training set: what the model learns from.
- Validation set: used while building, to compare options and tune settings.
- Test set: kept untouched until the end for an honest final score.
Overfitting and underfitting
A model that overfits memorises its training examples and fails on new ones. A model that underfits is too simple to capture the pattern at all. Good results on training data but poor results on the test set is the classic sign of overfitting.
Judging a model
- Accuracy: share of predictions that are correct. Misleading when one class is rare.
- Precision: of the items the model flagged, how many were really positive.
- Recall: of all the real positives, how many the model found.
- F1 score: a single number balancing precision and recall.