===== Lab: Machine Learning: Supervised and Unsupervised ===== ==== Before the lab ==== * **Reading:** * AIMA: **Chapter 19, Sections 19.1-19.4 and 19.9**. Focus on forms of learning, supervised learning, decision trees, generalization, model selection, data splitting, evaluation, and the machine-learning development process. * **Technical preparation:** * Open today's notebook and run all setup cells and the first code cell in **Segment 1** to verify that the notebook works in your environment. __The output should be a five-row table in which each row represents one wine from the dataset used throughout the lab.__ ==== Entry quiz ==== * 08:30 -- [[https://forms.cloud.microsoft/e/sV5gw7ecRc|MS Forms]] * 10:00 -- [[https://forms.cloud.microsoft/e/44yDuc3xKw|MS Forms]] ==== Q&A ==== - A decision tree classifies every training example correctly, while a simpler tree makes several mistakes. Which model should we choose? - A team tests twenty model variants and reports the one with the highest test-set accuracy. Is that still a fair test of future performance? - A dataset has three known classes, but clustering produces three groups that do not match them. Has the clustering failed? - Removing one feature lowers classification accuracy but improves the clustering score. Is that contradictory? ==== Notebook ==== **Notebook:** [[https://colab.research.google.com/drive/1G9H71-axX8l-Gtep0BWlj8GUTcD5_odh?usp=sharing|HCAI_Lab_Machine_Learning.ipynb]] (Work in Google Colab or download the .ipynb file to local environment) Work in groups of 2-4. Every group member must be able to explain the results. ==== Challenge ==== Work in groups of **2-4** on the [[https://www.kaggle.com/competitions/spaceship-titanic|Spaceship Titanic challenge]] using the provided **[[https://colab.research.google.com/drive/1b1lsiBtq-_NypdPGYetRlfiLDeiVhbCk?usp=sharing|Starter Notebook]]**. Predict which passengers were transported to another dimension. Start with the working classification baseline, then improve it through controlled experiments with feature representation, preprocessing, model selection, and evaluation. Use cross-validation to compare your changes, and keep one successful and one unsuccessful experiment. Next, hide the target labels and investigate whether the passengers form meaningful clusters. Describe at least one cluster and discuss whether the discovered groups align with `Transported` and why such alignment is not required. Participation in the Kaggle leaderboard is optional. Start the challenge during the lab and continue it as part of the **self-study regarding classes**. Selected groups may share their models and findings at the next lab, and effective solutions may receive bonus points. ==== Learn more! ==== * [[https://www.mlvisualization.com/|ML Visualization]] -- Interactive ML Encyclopedia. Experiment with decision boundaries, regularization, ensembles, clustering, dimensionality reduction, and evaluation directly in the browser. * [[https://www.explain-ai.org/calibration|Calibration Lab]] -- An interactive experiment showing why predicted confidence may not correspond to actual correctness. * [[https://developers.google.com/machine-learning/guides/rules-of-ml|Rules of Machine Learning]] -- Google's practical lessons on baselines, pipelines, feature engineering, monitoring, training-serving skew, and deploying ML systems. * [[https://github.com/microsoft/responsible-ai-toolbox|Responsible AI Toolbox]] -- Explore model errors, feature importance, counterfactuals, fairness, and data imbalance in one model-assessment environment. * [[https://christophm.github.io/interpretable-ml-book/index.html|Interpretable Machine Learning]] -- A critical guide to feature importance, SHAP, LIME, counterfactual explanations, surrogate models, and their limitations.