Submit Model to Kaggle Competition

Greetings, I want some advice on submitting my model to Kaggle for competition. I do not know how to convert my model to csv file that the competition requires. Anybody have a use-case example that I can follow? Thank you in advance!

Congrats on taking part in kaggle. It seems like kaggle wants you to submit model predictions in csv format and not the model weights. Here’s a link on this topic.

If that’s not the case, please update your post with a link to the contest / screenshot of the submission guideline.

Thank you for your reply! Yes, they need it in csv format. Here is the link to competition. It is the BBC news classification on W2 assignment. I am having a hard time converting my tensor model to the CSV format they require. If anybody has examples of how to convert these, please do let me know. Thank you in advance!

Please submit the predictions for the test file. To confirm, download the sample solution and see that the ids match between the test and sample submission files (lines below in bash):

# get article ids in the test file
$ cut -f1 -d, BBC\ News\ Test.csv > test_ids
# first 10 rows of the test file
$ head test_ids 
ArticleId
1018
1319
1138
459
1020
51
2025
1479
27
# get article ids in the sample solution file
$ cut -f1 -d, BBC\ News\ Sample\ Solution.csv > test_solution_ids
# Empty line means that no difference exists between both files
$ diff test_ids test_solution_ids 
$

Your submission should contain a header of ArticleId,Category followed by rows of the predictions of form <article id>,<category name>

Here are a few rows from the sample solution:

$ head BBC\ News\ Sample\ Solution.csv 
ArticleId,Category
1018,sport
1319,tech
1138,business
459,entertainment
1020,politics
51,sport
2025,tech
1479,business
27,entertainment

This is a little hard for me to follow as I am not that familiar with bash. In any case, how do you use the model learnt in the lesson to predict the pandas, tabular, csv format in the first place? It would be great if I could see the continuation of the assignment after the model.fit part, where we compare the results of the test and validation.

Please see the section Step 8: Make Test Predictions.
You can use numpy / pandas or even just plain python to write the results out. Only results matter for the submission. Do not submit model weights.