Train and evaluate a small model
Separate training from evaluation and explain the limits of a score.
Learning goal
- Separate training from evaluation and explain the limits of a score.
Use scikit-learn to fit regression and classification models. Iris has four measurements: sepal length and width, and petal length and width. Split data before fitting. Learn from the training portion and evaluate on held-out examples. A high training score can coexist with poor results on new data; this is overfitting. Keep preprocessing fitted to training data too, so evaluation information does not leak into learning.
A closer look
The neighbor count k and tree depth are hyperparameters chosen outside fitting; coefficients can be learned parameters. Use a validation split or cross-validation to choose settings, then reserve the test set for the final estimate. Repeatedly tuning to test results makes that estimate optimistic. Report the split, baseline, score, and errors. One small Iris experiment is a first project, not proof that a model works for every population or task.
Explain it yourself
A model scores 100% on the data it learned from. What should you check next?
Compare with an explanation
Evaluate on appropriate unseen data and inspect errors and leakage. Training accuracy alone is not enough.
You mark this yourself. Nothing is graded here.