What is semi-supervised learning, and when is it useful?
Semi-supervised learning trains on a small labelled set plus a large unlabelled set. It helps when labels are expensive but raw data is cheap, for example medical scans or speech recordings.
Explain it simply
Imagine a coaching institute with 10,000 old question papers, but only 200 have been solved by a teacher with full marking. Paying teachers to solve all 10,000 is costly. Semi-supervised learning uses the 200 solved papers to learn the basics, then also studies the structure of the other 9,800 to improve.
Labels are the expensive part of most real projects. A radiologist's time costs far more than a stored X-ray image.
Example
A common recipe is self-training:
1. Train a model on the 200 labelled examples.
2. Predict labels for the 9,800 unlabelled examples.
3. Keep only predictions where confidence is above, say, 0.95.
4. Add those as pseudo-labels to the training set and retrain.
5. Repeat for a few rounds.Other approaches include label propagation, which spreads labels to nearby points in a graph, and consistency training, which asks the model to give the same prediction for slightly altered copies of one input.
Scikit-learn offers SelfTrainingClassifier and LabelPropagation. Unlabelled rows are marked with -1 in the target array.
What to say in the interview
"Semi-supervised learning sits between supervised and unsupervised. I use it when I have few labels and lots of raw data from the same distribution. The risk is that early wrong pseudo-labels get reinforced, so I keep a high confidence threshold and evaluate on a properly labelled validation set."
Common mistakes
- Using it when the unlabelled data comes from a different distribution than the labelled data.
- Evaluating on pseudo-labelled rows instead of truly labelled ones.