Exercise 6: Machine learning 1
Implement a machine learning model in Python, including feature engineering, train–test splitting, model training, cross-validation, and evaluation.
https://github.com/justmarkham/scikit-learn-videos
NOTE: see Data Analytics with Python.pdf
Python
Implementation in Python with scikit-learn (20 min)
Walk through a simple, reproducible pipeline:
- Load dataset (toy dataset or small real-world example)
- Train–test split
- Preprocessing pipeline (e.g., StandardScaler + model)
- Fit logistic regression vs. one non-linear model (e.g., decision tree or SVM)
- Compare performance metrics
- Show how to inspect confusion matrix & classification report
Highlight: - Consistent API (fit, predict, score) - Use of Pipeline - Keeping code structured and reproducible
TipSession 6 survey
Before you wrap up, please complete the Session 6 survey here: ?meta:surveys.session_06.url. Thank you 🙏