{
  "id": 317140,
  "title": "Doubts regarding the sample submission format",
  "url": "/competitions/iwildcam2022-fgvc9/discussion/317140",
  "author_name": "",
  "post_date": "2022-04-05T16:10:48.264398900Z",
  "votes": 3,
  "comment_count": 4,
  "views": 0,
  "content": "<p>Hi All,<br>\nI was just trying to understand what exactly the model needs to predict and therefore searching for the prediction data format. I could not find any csv/json file (ex: sample_submission.csv) in this competition. I would really appreciate any suggestions/thoughts on this. Thanks in advance!</p>",
  "messages": [
    {
      "id": "1746278",
      "postDate": "04/05/2022 16:10:48",
      "content": "<p>Hi All,<br>\nI was just trying to understand what exactly the model needs to predict and therefore searching for the prediction data format. I could not find any csv/json file (ex: sample_submission.csv) in this competition. I would really appreciate any suggestions/thoughts on this. Thanks in advance!</p>",
      "rawMarkdown": "Hi All,\nI was just trying to understand what exactly the model needs to predict and therefore searching for the prediction data format. I could not find any csv/json file (ex: sample_submission.csv) in this competition. I would really appreciate any suggestions/thoughts on this. Thanks in advance!",
      "votes": null
    },
    {
      "id": "1746363",
      "postDate": "04/05/2022 17:34:58",
      "content": "<p>Hi <a href=\"https://www.kaggle.com/nanditab35\" target=\"_blank\">@nanditab35</a>!</p>\n<p>The submission format is explained in the Evaluation page: <a href=\"https://www.kaggle.com/competitions/iwildcam2022-fgvc9/overview/evaluation\" target=\"_blank\">https://www.kaggle.com/competitions/iwildcam2022-fgvc9/overview/evaluation</a> Let me know if that's not clear enough.</p>\n<p>Ștefan</p>",
      "rawMarkdown": "Hi @nanditab35!\n\nThe submission format is explained in the Evaluation page: https://www.kaggle.com/competitions/iwildcam2022-fgvc9/overview/evaluation Let me know if that's not clear enough.\n\nȘtefan",
      "votes": null
    },
    {
      "id": "1746380",
      "postDate": "04/05/2022 17:49:29",
      "content": "<p>I got it. Thank you for your reply.</p>",
      "rawMarkdown": "I got it. Thank you for your reply.",
      "votes": null
    },
    {
      "id": "1746388",
      "postDate": "04/05/2022 17:58:09",
      "content": "<p>Hi <a href=\"https://www.kaggle.com/nanditab35\" target=\"_blank\">@nanditab35</a>.</p>\n<p>Here's how I created my sample_submission.csv file.  Let me know if anything isn't clear.</p>\n<pre><code>import json\nimport pandas as pd\nfrom pathlib import Path\n\nDATA_ROOT = Path(\"your path\")\nJSON_FILENAME = DATA_ROOT / \"iwildcam2022_test_information.json\"\n\nwith open(JSON_FILENAME) as f:\n     data = json.load(f)\n\n# extract unique sequence ids from list of test images\nim_sequence_ids = [im['seq_id'] for im in data['images']]\nunique_seqs = set(im_sequence_ids)\n\n# we know total number of sequences from Kaggle \"Submit Predictions\" page\nassert len(unique_seqs) == 11028, \"expected 11028 sequence ids\"\n\nsequences = sorted(list(unique_seqs))\n\n# use Pandas to create dataframe and output as csv\ndata_dict = {\"Id\":sequences, \"Predicted\": [0] * len(sequences)}\n\ndf = pd.DataFrame(data_dict)\nprint(df.head())\n\ndf.to_csv(\"sample.submission.csv\", header=True, index=False)\n</code></pre>",
      "rawMarkdown": "Hi @nanditab35.\n\nHere's how I created my sample_submission.csv file.  Let me know if anything isn't clear.\n```\nimport json\nimport pandas as pd\nfrom pathlib import Path\n\nDATA_ROOT = Path(\"your path\")\nJSON_FILENAME = DATA_ROOT / \"iwildcam2022_test_information.json\"\n\nwith open(JSON_FILENAME) as f:\n     data = json.load(f)\n\n# extract unique sequence ids from list of test images\nim_sequence_ids = [im['seq_id'] for im in data['images']]\nunique_seqs = set(im_sequence_ids)\n\n# we know total number of sequences from Kaggle \"Submit Predictions\" page\nassert len(unique_seqs) == 11028, \"expected 11028 sequence ids\"\n\nsequences = sorted(list(unique_seqs))\n\n# use Pandas to create dataframe and output as csv\ndata_dict = {\"Id\":sequences, \"Predicted\": [0] * len(sequences)}\n\ndf = pd.DataFrame(data_dict)\nprint(df.head())\n\ndf.to_csv(\"sample.submission.csv\", header=True, index=False)\n```",
      "votes": null
    },
    {
      "id": "1746403",
      "postDate": "04/05/2022 18:11:15",
      "content": "<p>This is really helpful, Thank you!</p>",
      "rawMarkdown": "This is really helpful, Thank you!",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 1746363,
      "author_name": "stefanistrate",
      "author_url": "",
      "post_date": "04/05/2022 17:34:58",
      "content": "<p>Hi <a href=\"https://www.kaggle.com/nanditab35\" target=\"_blank\">@nanditab35</a>!</p>\n<p>The submission format is explained in the Evaluation page: <a href=\"https://www.kaggle.com/competitions/iwildcam2022-fgvc9/overview/evaluation\" target=\"_blank\">https://www.kaggle.com/competitions/iwildcam2022-fgvc9/overview/evaluation</a> Let me know if that's not clear enough.</p>\n<p>Ștefan</p>",
      "votes": null,
      "replies": [
        {
          "id": 1746380,
          "author_name": "nanditab35",
          "author_url": "",
          "post_date": "04/05/2022 17:49:29",
          "content": "<p>I got it. Thank you for your reply.</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 1746388,
      "author_name": "cjturner",
      "author_url": "",
      "post_date": "04/05/2022 17:58:09",
      "content": "<p>Hi <a href=\"https://www.kaggle.com/nanditab35\" target=\"_blank\">@nanditab35</a>.</p>\n<p>Here's how I created my sample_submission.csv file.  Let me know if anything isn't clear.</p>\n<pre><code>import json\nimport pandas as pd\nfrom pathlib import Path\n\nDATA_ROOT = Path(\"your path\")\nJSON_FILENAME = DATA_ROOT / \"iwildcam2022_test_information.json\"\n\nwith open(JSON_FILENAME) as f:\n     data = json.load(f)\n\n# extract unique sequence ids from list of test images\nim_sequence_ids = [im['seq_id'] for im in data['images']]\nunique_seqs = set(im_sequence_ids)\n\n# we know total number of sequences from Kaggle \"Submit Predictions\" page\nassert len(unique_seqs) == 11028, \"expected 11028 sequence ids\"\n\nsequences = sorted(list(unique_seqs))\n\n# use Pandas to create dataframe and output as csv\ndata_dict = {\"Id\":sequences, \"Predicted\": [0] * len(sequences)}\n\ndf = pd.DataFrame(data_dict)\nprint(df.head())\n\ndf.to_csv(\"sample.submission.csv\", header=True, index=False)\n</code></pre>",
      "votes": null,
      "replies": [
        {
          "id": 1746403,
          "author_name": "nanditab35",
          "author_url": "",
          "post_date": "04/05/2022 18:11:15",
          "content": "<p>This is really helpful, Thank you!</p>",
          "votes": null,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "1746278": "Hi All,\nI was just trying to understand what exactly the model needs to predict and therefore searching for the prediction data format. I could not find any csv/json file (ex: sample_submission.csv) in this competition. I would really appreciate any suggestions/thoughts on this. Thanks in advance!",
    "1746363": "Hi @nanditab35!\n\nThe submission format is explained in the Evaluation page: https://www.kaggle.com/competitions/iwildcam2022-fgvc9/overview/evaluation Let me know if that's not clear enough.\n\nȘtefan",
    "1746380": "I got it. Thank you for your reply.",
    "1746388": "Hi @nanditab35.\n\nHere's how I created my sample_submission.csv file.  Let me know if anything isn't clear.\n```\nimport json\nimport pandas as pd\nfrom pathlib import Path\n\nDATA_ROOT = Path(\"your path\")\nJSON_FILENAME = DATA_ROOT / \"iwildcam2022_test_information.json\"\n\nwith open(JSON_FILENAME) as f:\n     data = json.load(f)\n\n# extract unique sequence ids from list of test images\nim_sequence_ids = [im['seq_id'] for im in data['images']]\nunique_seqs = set(im_sequence_ids)\n\n# we know total number of sequences from Kaggle \"Submit Predictions\" page\nassert len(unique_seqs) == 11028, \"expected 11028 sequence ids\"\n\nsequences = sorted(list(unique_seqs))\n\n# use Pandas to create dataframe and output as csv\ndata_dict = {\"Id\":sequences, \"Predicted\": [0] * len(sequences)}\n\ndf = pd.DataFrame(data_dict)\nprint(df.head())\n\ndf.to_csv(\"sample.submission.csv\", header=True, index=False)\n```",
    "1746403": "This is really helpful, Thank you!"
  },
  "source": "meta"
}