Kaggle and Model-Free Prediction
Kaggle hosts the datasets and competitions we use for the rest of the course. This lecture covers how a competition is set up — what files you are given and what you submit back — and then establishes a model-free baseline: a prediction made from simple rules rather than from a trained model. Any model we build later has to beat that baseline to be worth its complexity.
Topics
- Rule-Based Prediction — two baselines on the Titanic data (predict everyone died; predict by gender), building the submission CSV with
.loc[]and.apply(), and scoring both on Kaggle. - The Heuristic Challenge — the in-class exercise: you invent the rules, on a booking-cancellation dataset nobody has told you anything about, and submit to a private leaderboard for this class only.
How a Kaggle Competition Works
A Kaggle competition normally provides at least three files:
- the training data (for classification, the target is included)
- the testing data (you need to predict the target)
- the sample submission file (shows you the format your submission must follow)
Go to the Titanic competition page and download all three before class.
Datasets
- Titanic Competition — the competition we submit to throughout this lecture.
- titanic_dataset.zip — the same three Titanic files, bundled here if you cannot reach Kaggle.
- California Housing Dataset — the regression dataset we return to in later lectures.
Matplotlib
We covered all parts in the Matplotlib and Pandas Charting sections at https://www.harrywang.me/blog/data-science-intro#matplotlib
Rule-Based Prediction
Based on the EDA, we could develop simple rule-based predictions, which can serve as the baseline for the comparison with predictions based on machine…