🎓 Section 6 · Capstone & Career 🟢 Practical Skills MODULE 32

Kaggle — Competitions and Datasets

⏱️ 18 min read
📖 Practice & Community
🧩 4 Quiz Questions
🏗️ 1 Challenge
Your progress in Section 650%
🎯 What you'll learn: What Kaggle actually is — competitions, datasets, notebooks, and a community built around all three — and how to use it to keep practicing after this course. How to find a beginner-friendly dataset or competition like the well-known Titanic or House Prices "Getting Started" challenges, how to learn technique by reading other people's public notebooks, how to structure and make your first submission, and the basics of Kaggle's built-in notebook environment.

What Kaggle Actually Is

Kaggle is a website built around practicing and sharing data science work. It's free to join, and once you're in you'll mainly bump into four things: competitions you can enter, datasets anyone can browse or download, notebooks (hosted, runnable Jupyter notebooks other users publish), and a community of people discussing all of it. Owned by Google since 2017, it's the single most common place beginners go after a course like this one to keep practicing on data that isn't hand-built for them.

None of this replaces what you've learned in this course — pandas, Matplotlib/Seaborn, and scikit-learn are exactly what you'll use on Kaggle too. What Kaggle adds is a constant supply of new, real datasets and problems, plus a way to see how other people approached the exact same problem.

🏆
Competitions
Structured problems with a fixed dataset, an evaluation metric, and a leaderboard. Some award prizes; many are just for practice.
🗂️
Datasets
Thousands of public datasets you can search, preview, and download — a much bigger library than any one course can provide.
📓
Notebooks
Runnable Jupyter notebooks published by other users, attached to a dataset or competition, that you can read or fork.
💬
Community
Discussion threads on every competition and dataset — often where the most useful tips and gotchas get shared.
🧭
Think of it as a very large, very public classroom
Every competition and dataset has other people's work attached to it — public notebooks, discussion threads, and a leaderboard. That's the real value for a beginner: it isn't just more data, it's more worked examples to learn from.

Finding a Beginner-Friendly Dataset or Competition

Kaggle hosts competitions at every level, from casual practice to serious prize money with strict rules. As a beginner, you want the ones Kaggle itself labels as "Getting Started" — they never close, award no prize money, and exist purely so newcomers have somewhere low-stakes to practice the full workflow. Two of them are practically rites of passage:

🚢
Titanic: Machine Learning from Disaster
Predict whether a passenger survived, from features like class, age, and fare. A binary classification problem — the same shape as your Student Performance Predictor project.
🏠
House Prices: Advanced Regression Techniques
Predict a home's sale price from the Ames Housing dataset's ~80 features. A regression problem, and a good next step once Titanic feels comfortable.
🔍
Any dataset you're curious about
Not every competition fits — you can just as easily pick a plain dataset from the Datasets tab and run your own EDA on it, competition-free.
1
Open the Competitions tab and filter by "Getting Started"
This filters out the prize competitions and shows only the practice-oriented ones meant for newcomers.
2
Read the Overview and Data tabs first
Overview explains the problem and the evaluation metric; Data explains every column. Skipping this step is the most common beginner mistake.
3
Note the evaluation metric
Titanic is scored on accuracy; House Prices is scored on a log-based error metric. Knowing this before you model changes what you optimize for.
4
Open a Notebook against the competition's data — no download required
You can start writing code against the competition's train.csv and test.csv immediately from Kaggle's own hosted notebook environment (more on this in Section 5).
Titanic maps directly onto what you already know
Predicting survival from a handful of features is structurally identical to the Student Performance Predictor you built in Lesson 30 — clean the data, engineer a couple of features, train a classifier, evaluate it. It's the same workflow on a new, real dataset.

Learning From Public Notebooks

Every competition and dataset has a Code (formerly "Kernels") tab listing notebooks other users have published against it. Sort by "Most Votes" and you'll find well-explained walkthroughs near the top — often written specifically to teach, not just to score well.

1
Read two or three top notebooks before writing your own code
Look at how they explore the data, which features they engineer, and which model they reach for first. You're not copying the answer — you're seeing the range of reasonable approaches.
2
Use "Copy & Edit" to fork a notebook into your own workspace
This gives you a running copy you can freely modify without touching the original — a safe way to experiment with someone else's approach.
3
Change something, and see what happens
Swap the model, add a feature, tweak a hyperparameter. Watching your score move (or not) after a specific change is where the real learning happens.
a typical opening cell in a public Titanic notebook
PYTHON
import pandas as pd

# Kaggle notebooks can read competition files straight from
# the attached /kaggle/input/ directory — no manual download needed
train = pd.read_csv('/kaggle/input/titanic/train.csv')
test = pd.read_csv('/kaggle/input/titanic/test.csv')

print(train.shape, test.shape)
train.head()
⚠️
Copying a notebook isn't the same as learning from it
Forking someone's notebook and submitting it unchanged gets you a leaderboard score, but it doesn't build the skill this course is for. Read the reasoning in each cell, not just the code — and try to predict what a cell will do before you run it.

Making Your First Submission

A "Getting Started" competition gives you three files: train.csv (features plus the answer, for training), test.csv (features only, for prediction), and sample_submission.csv (a template showing exactly the column names and row order your submission file must match). Your job is to predict the missing answer for every row in test.csv and format it exactly like the sample.

building and saving a submission file
PYTHON
from sklearn.ensemble import RandomForestClassifier

# same pattern as the Student Performance Predictor in Lesson 30:
# clean -> engineer features -> train -> predict on the unseen test set
model = RandomForestClassifier(n_estimators=200, random_state=42)
model.fit(X_train, y_train)

predictions = model.predict(X_test)

# must match sample_submission.csv exactly: same columns, same row order
submission = pd.DataFrame({
    'PassengerId': test['PassengerId'],
    'Survived': predictions
})
submission.to_csv('submission.csv', index=False)
1
Match the sample submission's format exactly
Same column names, same column order, same number of rows. A mismatched format is the single most common reason a first submission gets rejected.
2
Use the "Submit Predictions" button
Upload your CSV directly from the competition page, or submit it straight from a Kaggle notebook without leaving the browser.
3
Check your score on the public leaderboard
You'll get an immediate score against a portion of the true answers. Don't judge yourself against the very top of the leaderboard — plenty of high entries there are heavily tuned or blended by experienced competitors.
A mediocre first score is a completely normal starting point
The goal of your first submission isn't a great leaderboard position — it's proving the whole pipeline works end to end: read data, train, predict, format, submit. Every improvement after that is just iteration.

Kaggle's Notebook Environment Basics

Kaggle Notebooks are a browser-based, hosted Jupyter environment — you don't need Python installed locally to use them. They come with pandas, NumPy, Matplotlib, and scikit-learn already available, and they attach directly to any dataset or competition without a manual download.

Add Data
Attach any public dataset (or a competition's files) to your notebook — it appears under /kaggle/input/, ready to read with pandas.
Accelerator Option
Notebooks can be switched to run with a GPU or TPU for heavier workloads, on top of the default CPU environment — useful once you go beyond scikit-learn-sized data.
💾
Save Version
"Save & Run All" re-executes your whole notebook top to bottom and stores that exact output — the same "runs cleanly end to end" habit from Lesson 31's portfolio advice.
🌐
Make It Public
A public notebook gets a shareable URL and can be linked from your GitHub README or LinkedIn — a second home for your project alongside GitHub.
💡
You can still work locally if you prefer
Nothing about Kaggle requires you to abandon your local Jupyter or VS Code setup — most datasets and competition files can be downloaded and used exactly like the CSVs you've worked with throughout this course. The hosted notebook is a convenience, not a requirement.

Lesson Summary

Kaggle combines competitions, datasets, hosted notebooks, and a community around all three.
"Getting Started" competitions like Titanic and House Prices never close and exist purely for practice.
Reading top-voted public notebooks before coding shows you a range of reasonable approaches.
A submission must match sample_submission.csv's exact columns and row order.
Kaggle Notebooks are a free, pre-configured, browser-based Jupyter environment tied directly to the data.
🧩 Knowledge Check — Lesson 32
Answer all 4 questions to test your understanding. Instant feedback on every answer.
1. What is Kaggle, as described in this lesson?
2. What are Kaggle's "Getting Started" competitions, like Titanic and House Prices, meant for?
3. According to this lesson, what's a good move when starting a new competition, before writing your own code?
4. What must a submission.csv file match in order to be accepted?
💪
Try It Yourself — Lesson 32
Your first Kaggle submission · Practical Level

Create a free Kaggle account if you don't already have one, then complete the following against the Titanic: Machine Learning from Disaster competition.

Task 1: Read before you code 📓

Open the Titanic competition's Overview and Data tabs, then read at least two top-voted public notebooks in its Code tab. Note down one idea or feature each notebook used that you wouldn't have thought of on your own.
Task 2: Make a real submission 🚀

Using the same workflow as your Student Performance Predictor from Lesson 30 (clean → engineer features → train a classifier → predict), build a submission.csv matching Titanic's sample_submission.csv format exactly, and submit it for a public leaderboard score.
💡 Show hints if you're stuck
  • Start simple — even predicting "everyone died" or "everyone with a low fare died" gives you a baseline score to beat.
  • The Sex, Pclass, and Age columns are the classic starting features for Titanic.
  • Your first score doesn't need to be impressive — it just needs to prove your whole pipeline runs end to end.
Finished this lesson?
Mark it complete to track your progress.
🎉

Lesson 32 Complete!

You know what Kaggle actually is, how to find a beginner-friendly competition like Titanic or House Prices, how to learn from other people's public notebooks, how to structure and submit a real prediction, and the basics of Kaggle's hosted notebook environment. Next up: a roadmap for what to learn after this course.

Module 32 of 34 Section 6 — Capstone & Career Roadmap