Skip to content

Your first competition

New to Kaggle? Start with three questions. What does one row represent? Which value are you trying to predict? How will your prediction be scored?

Switch between the files in this bike rental example
train.csv
DayWeatherRentals
MondaySunny120
TuesdaySunny132

Look at the days with known rental counts. What pattern do you see?

test.csv
DayWeather
WednesdaySunny

You know Wednesday's weather. How many bikes will people rent?

submission.csv
DayPredicted rentals
Wednesday126

Average the first two days, then enter 126 in the submission file.

Your first competition:
what are you predicting?

Kaggle hosts data science competitions. In many prediction challenges, everyone starts with the same data, predicts outcomes they cannot yet see, and gets scored against the same measure.

Try forecasting bike rentals, then work out your score.

Explore Kaggle competitions
Bike rental forecastPractice data

A single value is missing.

One station, three sunny weekdays. You know how many bikes people rented on the first two days. How many will they rent today?

Start with a simple guess.

Take the average of the first two days: (120 + 132) ÷ 2 = 126. That gives you a baseline to compare with your next idea.

How far off were you?

Suppose people rented 130 bikes on Wednesday. Here, we measure the absolute error for that day. Smaller is better. Each competition publishes its own scoring rules.

Your guess126
Actual rentals130
Error4 bikes

Meet the three files
in a competition.

In the Titanic challenge, one file gives you examples to learn from, another lists the passengers to predict, and the third shows how to submit your predictions.

Explore the Titanic challenge
Training settrain.csv
The training set lists 891 passengers with known outcomes. Each row represents one person, and Survived is the column you want to predict. Set aside some rows before training so you can test the model on answers it has never seen.
Test settest.csv
The test set lists another 418 passengers. You can see clues such as age and ticket class. Your model must supply each missing outcome: 0 for a passenger who died or 1 for a survivor.
Sample submissiongender_submission.csv
The sample gives you the expected column names and passenger IDs. Its predictions come from a simple rule; the actual test outcomes are hidden. Check for duplicate or missing IDs when you export your file.

Reading your first
competition brief

Open the Titanic competition page and make a few notes before you touch the code. What will you submit? Which clues can you use? How will you know whether your predictions are any good?

Open the Titanic brief
  1. Put the task in one sentence

    In Overview, read the task and find Evaluation. For Titanic, assign every test passenger a 0 or 1 to predict whether they survived. Accuracy is the number you get right divided by the number of passengers scored.

  2. Follow one passenger across a row

    Open Data and find passenger 3 in the training table. Pclass = 3 means third class, Age = 26 gives their age, and Survived = 1 tells you they survived. At prediction time you can use the first two fields. The third is the answer you must supply.

  3. Decide when to submit

    Read Rules for eligibility and data use, then note the competition's submission method and limits. Compare methods on your own practice records first. Keep a version you can run from the beginning before submitting it.

Which passengers
does this rule miss?

Try one fixed rule on passengers 7 through 12 in the Titanic training set. Predict 1 for first or second class and 0 for third class. Use these six rows to test it.

Predictions for six passengers
Passenger IDClassPrediction
7First1
8Third0
9Third0
10Second1
11Third0
12First1
Source: Titanic training data

Predict first, then check

Count each passenger once. Circle the IDs you get right, then try another rule on the same six people. How many would you get right if you predicted 0 for everyone?

Reveal the six outcomes

In passenger order, the outcomes are 0, 0, 1, 1, 1, 1. The class rule gets passengers 8, 10 and 12 right (3/6). Predicting 0 for everyone gets only 7 and 8 right (2/6).

Look again at passengers 8, 9 and 11. All travelled in third class, yet their outcomes differ. Checking individual mistakes can reveal what a rule overlooks, even when two scores look similar. Six passengers only tell us how the rule did on this exercise.

Write your first
submission file

Use the same class rule. In the test set, passengers 892 and 893 travelled in third class, and passenger 894 in second. Pair each prediction with its ID. Your file should begin like this.

submission.csv First 3 predictions
PassengerId,Survived
892,0
893,0
894,1

Read the output before you upload

Column names and order
Compare the header with the official sample. Check the spelling of PassengerId and Survived. If an extra column of numbers starting at 0 appears on the left, export again without the table index.
Rows and passenger IDs
The full file has 418 prediction rows plus a header. Each test ID should appear exactly once. A row count alone will miss one duplicate paired with one missing passenger.
Predictions and notes
Make sure each prediction is 0 or 1 and keep the sample order. Add a note such as “Ticket class only; all IDs checked.” When you change the rule, you can trace each file back to the version that produced it.
Try a lab with real records

Before you enter:
questions from families

Where should someone who has never coded begin?

Open a table and pick one row. Explain each field in your own words, then write one rule for filtering the rows. Explore the one-to-one syllabus to see how that first step leads into data analysis.

Does submitting a prediction earn a medal?

A successful submission means Kaggle accepted your file. Each competition sets its own rankings and awards. Titanic is a getting-started exercise and does not award competition medals.

Why test predictions locally first?

Set aside some known answers before training and check them only after predicting. Seven correct out of ten gives 70% accuracy. Next time, change one thing and use the same ten records so you can tell whether it helped.

How can I tell what my child has learned?

Ask them to explain one prediction, investigate one mistake, and rerun their notebook from the start. You can then see which data they used and how they compared their results. See an example of mentor feedback.