πΊ Antique
500 rows, 5 features, some labels unknown β classical sklearn beats deep learning here.
πThe task, in plain English
A tiny tabular dataset: 500 samples, 5 features. Labels are 1, β1, or 0 β where 0 means unknown. Classify the unknowns. That's it. No images, no GPUs, no transformers.
| Input | 500 Γ 5 numeric table |
|---|---|
| Output | Labels for the unlabeled rows |
| Really tests | scikit-learn fluency, semi-supervised thinking, and not overfitting 500 rows |
π§The baseline you're given
Train a basic classifier on the labeled rows only, predict the rest. Limitations: throws away the structure in the unlabeled data; tiny data makes validation noisy; feature scales may be uncalibrated.
πBaseline vs. solution
- Fits only on labeled rows
- Single model, single train/val split
- No use of unlabeled structure
- Cross-validation, not one split β with 500 rows, a single split lies to you
- Semi-supervised tricks:
sklearn.semi_supervisedlabel propagation / self-training (predict unknowns, add confident ones to training, repeat) - Compare several cheap models (logistic regression, random forest, gradient boosting, SVM) β 5 minutes each
- Scale features; plot them β with 5 features you can literally LOOK at the data
π§Explain it like I'm brand new
Why this task exists: to catch people who reach for deep learning on 500 rows. Small tabular data is classical-ML territory: fit/predict in scikit-learn, cross-validate honestly, and exploit the unlabeled rows (their positions in feature space are information even without labels β points in the same cluster probably share a label; that intuition is "label propagation").
The muscle: the sklearn workflow β fit β predict β cross_val_score β
which you can run in your head. This is the Week-2 checkpoint of your 30-day plan for a reason.
π¬The Gemma 4 playthrough (2000-token limit)
sklearn: X (labeled rows, shape (n,5)), y in {-1,1}. Write ONLY code to compare LogisticRegression, RandomForest, GradientBoosting, and SVC with 5-fold cross_val_score (accuracy), with StandardScaler in a Pipeline, printing meanΒ±std per model. Max 25 lines.Now ONLY code for sklearn SelfTrainingClassifier wrapping the best model, using X_all where unknown labels are -1... wait, my unknowns are 0 and real labels are 1/-1. Handle relabeling so sklearn's convention (-1 = unlabeled) is respected. Max 20 lines.
π―Takeaways & what Day 1 might do with this
- Pattern family: classical ML on tiny data. Deep learning is a hammer; not everything is a nail.
- Trust only cross-validation on small data β single-split scores swing wildly.