Table of Contents
Submitting to Kaggle sounds trivial until your first CSV gets rejected for a reason the error message won’t explain. Here’s how the two formats work and how not to burn your limited daily submissions on nothing.
CSV submissions
Most competitions want a CSV with an ID column and one or more prediction columns. Titanic, for example:
PassengerId,Survived
892,0
893,1
894,0
...
The rules that actually bite:
- Column names have to match the sample submission file exactly.
- Row count has to equal the test set. Not one more, not one fewer.
- No extra columns, and no index column (this is the one that gets everyone).
Code Competition submissions
Some competitions make you submit a notebook that generates predictions at runtime instead of a finished CSV. In those:
- Data comes from
/kaggle/input/<competition-slug>/ - Output goes to
/kaggle/working/submission.csv - Internet is off during the run
- Every dependency has to be bundled or already in the Kaggle environment
The workflow, start to finish
- Train on the training data
- Predict on the test set
- Build a DataFrame with exactly the required columns
- Save it:
df.to_csv("submission.csv", index=False) - Submit:
kaggle competitions submit -c <name> -f submission.csv -m "description" - Check the score:
kaggle competitions submissions -c <name>
In my toolkit, the SubmissionGenerator handles steps 3 through 5 so I can’t
fat-finger the format.
Don’t waste your daily submissions
Most competitions give you 5 to 10 submissions a day, which disappears fast. What keeps me honest:
- Trust local cross-validation to judge a model before spending a real submission on it.
- Save submissions for genuine experiments, not tiny tweaks you already know the answer to.
- Give every submission a message that says what changed, so you can match scores to decisions later.
- Near the deadline, spend your remaining submissions on your best models, not on exploration.