{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"pygments_lexer":"ipython3","nbconvert_exporter":"python","version":"3.6.4","file_extension":".py","codemirror_mode":{"name":"ipython","version":3},"name":"python","mimetype":"text/x-python"}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"markdown","source":"# Steps to submit to this competition\n\nThis competition has a different submission workflow than most Kaggle competition. Submissions must be made through a notebook. This is not the same as a [Code Competition](https://www.kaggle.com/docs/competitions#notebooks-only-competitions), where submitted notebooks do inference on an unseen test set; rather, the notebook serves simply as a wrapper around the prediction file which is then scored by a custom metric.\n\nThe submission file name for this competition must be: `submission.tsv`","metadata":{}},{"cell_type":"markdown","source":"## Step 1: Create a new notebook\n\nIf you're here, there's a good chance you know how to do this already. If not, refer to Kaggle's [documentation](https://www.kaggle.com/docs/notebooks).","metadata":{}},{"cell_type":"markdown","source":"## Step 2: Attach your submission to the notebook\n\nYou do this via the notebook panel on the right.\n\n<center>\n<img src=\"https://i.imgur.com/QLdIUly.png\"  width=\"300\">\n</center>\n</p>\n\nYou will be asked to create a dataset that will house your submission\n\n<center>\n<img src=\"https://i.imgur.com/Uj4CIaH.png\"  width=\"400\">\n</center>","metadata":{}},{"cell_type":"markdown","source":"## Step 3: Read and Save (or Copy) you data into your notebook\n\nYou will see the file listed under the dataset name you created. In this example, it's found at:\n\n`/kaggle/input/cafa-5-submission/submission.tsv`\n\nThe default working folder is `/kaggle/working` which is used if you don't explicitly share a save path. You can copy the file, or you may operate on the file if you need to (e.g., if the file was zipped, you should unzip it). For this example, I'm reading/saving the data, but since I'm not making any motifications, I could have just as easily copied it.\n\nPleas note for this competition there should be **no header** for the submission file, and it _must_ be named `submission.tsv`.","metadata":{}},{"cell_type":"code","source":"import numpy as np\nimport pandas as pd \n\nimport os\nfor dirname, _, filenames in os.walk('/kaggle/input'):\n    for filename in filenames:\n        print(os.path.join(dirname, filename))","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","execution":{"iopub.status.busy":"2023-04-18T15:49:34.529446Z","iopub.execute_input":"2023-04-18T15:49:34.529959Z","iopub.status.idle":"2023-04-18T15:49:34.550732Z","shell.execute_reply.started":"2023-04-18T15:49:34.52992Z","shell.execute_reply":"2023-04-18T15:49:34.549784Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"submission = pd.read_csv('/kaggle/input/cafa-5-submission/submission.tsv',\n    sep='\\t', header=None)\n\nsubmission.to_csv('submission.tsv',\n    sep='\\t', header=False, index=False)","metadata":{},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# Step 4: Hit the \"Save Version\" button at the upper right of your notebook\n\nThis will process your notebook. Once it's done, you'll notification at the bottom left of your notebook. You can then open the notebook up in the Viewer.\n\n<center>\n<img src=\"https://i.imgur.com/nQN5F4j.png\"  width=\"500\">\n</center>\n</p>\n\nWith the notebook open in the Viewer, select \"Submit to Competition\" from the dropdown in the upper right (the 3 dots next to Edit).\n\n<center>\n<img src=\"https://i.imgur.com/GPCBzjl.png\"  width=\"700\">\n</center>\n</p>\n    \nYou have the opportunity to make notes for each submission, which is a best practise to help you remember which submissions were which model predictions.\n\n<center>\n<img src=\"https://i.imgur.com/llGfmJB.png\"  width=\"600\">\n</center>","metadata":{}},{"cell_type":"markdown","source":"## Ongoing\n\nYou can continue to use the same notebook to submit to the competition, since you will create a new version of the notebook with every new submission you make, and you will be able to select the versions you want for final scoring at the end of the competition. When you have a new submission, update your datasource by versioning it on the dataset page, and then repeat Steps 3 and 4.\n\nIt's a good habit to make good notes in the submission Description!","metadata":{}}]}