{
  "id": 400313,
  "title": "Changes to the Competition API",
  "url": "/competitions/predict-student-performance-from-game-play/discussion/400313",
  "author_name": "",
  "post_date": "2023-04-07T17:56:44.570907300Z",
  "votes": 12,
  "comment_count": 14,
  "views": 0,
  "content": "<p>Hi Kagglers,</p>\n<p>The API was recently updated to fix reported bugs (this fix has been finalized), however the change requires all submissions to switch the order of the arguments to the iter_test object.</p>\n<p>Specifically, you will need to make the following change to any previous inference notebooks:</p>\n<p>Change <br>\n<code>for (sample_submission, test) in iter_test:</code><br>\nTo<br>\n<code>for (test, sample_submission) in iter_test:</code></p>\n<p>Any code using the previous order will run into an error, which will unfortunately cause issues when rerunning old submissions. However, this change was necessary to fix the issues we were seeing.</p>\n<p>We acknowledge that the change caused problems for a number of people, and we apologize for the frustration this caused! Although it doesn’t fully compensate for lost time, we will be extending the competition by a week to make up for lost submissions due to the update.</p>\n<p>If you have any questions or continue to run into errors, please respond in this thread.</p>\n<p>Many thanks!</p>",
  "messages": [
    {
      "id": "2213621",
      "postDate": "04/07/2023 17:56:44",
      "content": "<p>Hi Kagglers,</p>\n<p>The API was recently updated to fix reported bugs (this fix has been finalized), however the change requires all submissions to switch the order of the arguments to the iter_test object.</p>\n<p>Specifically, you will need to make the following change to any previous inference notebooks:</p>\n<p>Change <br>\n<code>for (sample_submission, test) in iter_test:</code><br>\nTo<br>\n<code>for (test, sample_submission) in iter_test:</code></p>\n<p>Any code using the previous order will run into an error, which will unfortunately cause issues when rerunning old submissions. However, this change was necessary to fix the issues we were seeing.</p>\n<p>We acknowledge that the change caused problems for a number of people, and we apologize for the frustration this caused! Although it doesn’t fully compensate for lost time, we will be extending the competition by a week to make up for lost submissions due to the update.</p>\n<p>If you have any questions or continue to run into errors, please respond in this thread.</p>\n<p>Many thanks!</p>",
      "rawMarkdown": "Hi Kagglers,\n\nThe API was recently updated to fix reported bugs (this fix has been finalized), however the change requires all submissions to switch the order of the arguments to the iter_test object.\n\nSpecifically, you will need to make the following change to any previous inference notebooks:\n\nChange \n`for (sample_submission, test) in iter_test:`\nTo\n`for (test, sample_submission) in iter_test:`\n\nAny code using the previous order will run into an error, which will unfortunately cause issues when rerunning old submissions. However, this change was necessary to fix the issues we were seeing.\n\nWe acknowledge that the change caused problems for a number of people, and we apologize for the frustration this caused! Although it doesn’t fully compensate for lost time, we will be extending the competition by a week to make up for lost submissions due to the update.\n\nIf you have any questions or continue to run into errors, please respond in this thread.\n\nMany thanks!",
      "votes": null
    },
    {
      "id": "2213780",
      "postDate": "04/07/2023 20:58:45",
      "content": "<p><a href=\"https://www.kaggle.com/philculliton\" target=\"_blank\">@philculliton</a> Hi Phil, it would be great if you could fix the sample data in the Kaggle API so that it only provides <strong>1 session_id</strong> per for-loop iteration. </p>\n<p>Currently the Kaggle API provides <strong>3 session_id</strong> per for-loop during commit and the Kaggle API provides <strong>1 session_id</strong> per for-loop during submit. And the old API provided <strong>1 session_id</strong> per for-loop during commit.</p>\n<p>All old notebook are broken because <strong>two reasons</strong> (not one reason like you say):</p>\n<ul>\n<li><code>sample_submission, test</code> has changed to <code>test, sample_submission</code></li>\n<li>commit Kaggle API provides <strong>3 session_id</strong> instead of <strong>1 session_id</strong> like it used to </li>\n</ul>\n<p>Additionally old notebooks break because the double train data size causes memory errors, but that isn't an error regarding the Kaggle API.</p>",
      "rawMarkdown": "philculliton Hi Phil, it would be great if you could fix the sample data in the Kaggle API so that it only provides **1 session_id** per for-loop iteration. \n\nCurrently the Kaggle API provides **3 session_id** per for-loop during commit and the Kaggle API provides **1 session_id** per for-loop during submit. And the old API provided **1 session_id** per for-loop during commit.\n\nAll old notebook are broken because **two reasons** (not one reason like you say):\n* `sample_submission, test` has changed to `test, sample_submission`\n* commit Kaggle API provides **3 session_id** instead of **1 session_id** like it used to \n\nAdditionally old notebooks break because the double train data size causes memory errors, but that isn't an error regarding the Kaggle API.",
      "votes": null
    },
    {
      "id": "2213855",
      "postDate": "04/07/2023 22:33:56",
      "content": "<p>It would also be great if the basic submission demo is updated.<br>\n<a href=\"https://www.kaggle.com/code/philculliton/basic-submission-demo\" target=\"_blank\">https://www.kaggle.com/code/philculliton/basic-submission-demo</a></p>",
      "rawMarkdown": "It would also be great if the basic submission demo is updated.\n[https://www.kaggle.com/code/philculliton/basic-submission-demo](https://www.kaggle.com/code/philculliton/basic-submission-demo)",
      "votes": null
    },
    {
      "id": "2213935",
      "postDate": "04/08/2023 01:03:29",
      "content": "<p>In regards to this, I was getting some errors on submissions to the hidden test set that were not present when I ran with the API on the test set.  Do we expect 3 total loops in the iteration, one for each level group?  Or are there many more loops on the hidden test set?</p>",
      "rawMarkdown": "In regards to this, I was getting some errors on submissions to the hidden test set that were not present when I ran with the API on the test set.  Do we expect 3 total loops in the iteration, one for each level group?  Or are there many more loops on the hidden test set?",
      "votes": null
    },
    {
      "id": "2213936",
      "postDate": "04/08/2023 01:05:05",
      "content": "<p>Hi <a href=\"https://www.kaggle.com/cdeotte\" target=\"_blank\">@cdeotte</a>, can I confirm with you that during <strong>submission</strong> it is still <strong>1 session_id, 1 level_group</strong> per for-loop iteration? <br>\nThat means, it is the same as before except the order of <code>test, sample_submission</code>?<br>\nThanks a lot!</p>",
      "rawMarkdown": "Hi @cdeotte, can I confirm with you that during **submission** it is still **1 session_id, 1 level_group** per for-loop iteration? \nThat means, it is the same as before except the order of `test, sample_submission`?\nThanks a lot!",
      "votes": null
    },
    {
      "id": "2214000",
      "postDate": "04/08/2023 04:25:40",
      "content": "<p>When the change is done, you can see the 3 different session_ids in sample_submission<br>\n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F1903540%2Fcfb4695ef21dc9ce147169c9c6a0835b%2Fsample_problem.jpg?generation=1680927882047910&amp;alt=media\" alt=\"\"></p>",
      "rawMarkdown": "When the change is done, you can see the 3 different session_ids in sample_submission\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F1903540%2Fcfb4695ef21dc9ce147169c9c6a0835b%2Fsample_problem.jpg?generation=1680927882047910&alt=media)",
      "votes": null
    },
    {
      "id": "2214154",
      "postDate": "04/08/2023 07:33:11",
      "content": "<p>Thank you, Chris. You expressed very precisely what I was struggling with.</p>\n<p>It means that there are the following difficulties:</p>\n<ul>\n<li>If the submission code assumes 1 session_id, <strong>an error occurs when saving the notebook.</strong></li>\n<li>If the submission code assumes 3 session_id, <strong>an error occurs after submission.</strong></li>\n</ul>\n<p>We need to write the submission code for both 1 session_id and 3 session_id.<br>\nThis is a bit unnatural.</p>",
      "rawMarkdown": "Thank you, Chris. You expressed very precisely what I was struggling with.\n\nIt means that there are the following difficulties:\n\n- If the submission code assumes 1 session_id, **an error occurs when saving the notebook.**\n- If the submission code assumes 3 session_id, **an error occurs after submission.**\n\nWe need to write the submission code for both 1 session_id and 3 session_id.\nThis is a bit unnatural.",
      "votes": null
    },
    {
      "id": "2214871",
      "postDate": "04/08/2023 20:19:47",
      "content": "<p>Hello, <a href=\"https://www.kaggle.com/danielphalen\" target=\"_blank\">@danielphalen</a> <br>\nThe hidden test looks like 1 session_id and 1 level_group in every loop.<br>\nTherefore, I assume that the number of loops is the number of session_id * 3. <br>\nYes, it is so many loops.<br>\nI hope this will help.</p>",
      "rawMarkdown": "Hello, @danielphalen \nThe hidden test looks like 1 session_id and 1 level_group in every loop.\nTherefore, I assume that the number of loops is the number of session_id * 3. \nYes, it is so many loops.\nI hope this will help.",
      "votes": null
    },
    {
      "id": "2214873",
      "postDate": "04/08/2023 20:22:08",
      "content": "<p>Hello, <a href=\"https://www.kaggle.com/boscoyung\" target=\"_blank\">@boscoyung</a> <br>\nI have confirmed that the hidden test is almost certainly 1 session_id and 1 level_group in every loop.<br>\nThe way I did it is the following code.</p>\n<pre><code> (test, sample_submission)  iter_test:\n     (test[].nunique() == ) &amp; (test[].nunique() == ):\n        *****my prediction code*****\n    :\n        sample_submission[] = \n        env.predict(sample_submission)\n</code></pre>\n<p>The submission was successful and I got the normal score. My score did not decrease.<br>\nI hope this helps you.</p>",
      "rawMarkdown": "Hello, @boscoyung \nI have confirmed that the hidden test is almost certainly 1 session_id and 1 level_group in every loop.\nThe way I did it is the following code.\n```python\nfor (test, sample_submission) in iter_test:\n    if (test['level_group'].nunique() == 1) & (test['session_id'].nunique() == 1):\n        *****my prediction code*****\n    else:\n        sample_submission['correct'] = 2\n        env.predict(sample_submission)\n```\n\nThe submission was successful and I got the normal score. My score did not decrease.\nI hope this helps you.",
      "votes": null
    },
    {
      "id": "2214940",
      "postDate": "04/08/2023 22:15:45",
      "content": "<p>Thanks for that.  Do you know if the order is<br>\n<code>for session_id in session_ids:</code><br>\n<code>for level_group in level_groups:</code><br>\nor the other way around?</p>",
      "rawMarkdown": "Thanks for that.  Do you know if the order is\n`for session_id in session_ids:`\n`        for level_group in level_groups:`\nor the other way around?",
      "votes": null
    },
    {
      "id": "2214955",
      "postDate": "04/08/2023 23:10:36",
      "content": "<p>Thanks <a href=\"https://www.kaggle.com/tanakaakinori\" target=\"_blank\">@tanakaakinori</a> !</p>",
      "rawMarkdown": "Thanks @tanakaakinori !",
      "votes": null
    },
    {
      "id": "2215651",
      "postDate": "04/09/2023 13:37:58",
      "content": "<p>I'm sorry, I do not know the order in the Hidden test.<br>\nBut I just know that.<br>\nBefore the Kaggle API updated, the Sample test worked like this in the Notebook.</p>\n<pre><code> (sample_submission, test)  iter_test:\n    (test.level_group.values[])\n    (session_id = test.session_id.values[])\n</code></pre>\n<p>0-4<br>\n20090109393214576<br>\n0-4<br>\n20090312143683264<br>\n0-4<br>\n20090312331414616<br>\n5-12<br>\n20090109393214576<br>\n5-12<br>\n20090312143683264<br>\n5-12<br>\n20090312331414616<br>\n13-22<br>\n20090109393214576<br>\n13-22<br>\n20090312143683264<br>\n13-22<br>\n20090312331414616</p>",
      "rawMarkdown": "I'm sorry, I do not know the order in the Hidden test.\nBut I just know that.\nBefore the Kaggle API updated, the Sample test worked like this in the Notebook.\n```python\nfor (sample_submission, test) in iter_test:\n    print(test.level_group.values[0])\n    print(session_id = test.session_id.values[0])\n```\n0-4\n20090109393214576\n0-4\n20090312143683264\n0-4\n20090312331414616\n5-12\n20090109393214576\n5-12\n20090312143683264\n5-12\n20090312331414616\n13-22\n20090109393214576\n13-22\n20090312143683264\n13-22\n20090312331414616",
      "votes": null
    },
    {
      "id": "2273789",
      "postDate": "05/25/2023 12:07:59",
      "content": "<p>Could you please explain what u said in detail.<br>\nI am having Submission Scoring Error, which i couldn't solve for two days.</p>\n<pre><code>limits = {'0-4':(1,4), '5-12':(4,14), '13-22':(14,19)}\nfor (test, sample_submission) in iter_test:\n    test = test.sort_values(by='index')\n    grp = test.level_group.values[0]\n    session_id = test.session_id.values[0]\n    a,b = limits[grp]\n    df = model_data_1(test, grp)\n    preds = []\n    for q in range(a, b):\n        model = models[q-1]   \n        pred = model.predict_proba(df)[0, 1]\n        mask = sample_submission.session_id.str.contains(f'q{q}')\n        sample_submission.loc[mask,'correct'] = int(pred &gt; threshold[q-1]) \n    #sample_submission = sample_submission[['session_id', 'correct']]\n    print(preds)\n    env.predict(sample_submission)\n</code></pre>\n<p>could you help me in solving the error, by pointing out mistake if any.<br>\nThank You</p>",
      "rawMarkdown": "Could you please explain what u said in detail.\nI am having Submission Scoring Error, which i couldn't solve for two days.\n```\nlimits = {'0-4':(1,4), '5-12':(4,14), '13-22':(14,19)}\nfor (test, sample_submission) in iter_test:\n    test = test.sort_values(by='index')\n    grp = test.level_group.values[0]\n    session_id = test.session_id.values[0]\n    a,b = limits[grp]\n    df = model_data_1(test, grp)\n    preds = []\n    for q in range(a, b):\n        model = models[q-1]   \n        pred = model.predict_proba(df)[0, 1]\n        mask = sample_submission.session_id.str.contains(f'q{q}')\n        sample_submission.loc[mask,'correct'] = int(pred > threshold[q-1]) \n    #sample_submission = sample_submission[['session_id', 'correct']]\n    print(preds)\n    env.predict(sample_submission)\n \n```\ncould you help me in solving the error, by pointing out mistake if any.\nThank You",
      "votes": null
    },
    {
      "id": "2273793",
      "postDate": "05/25/2023 12:11:05",
      "content": "<p>Is the above problem in API fixed?<br>\nI am having Submission Scoring Error, which i couldn't solve for two days.</p>\n<pre><code>limits = {'0-4':(1,4), '5-12':(4,14), '13-22':(14,19)}\nfor (test, sample_submission) in iter_test:\n    test = test.sort_values(by='index')\n    grp = test.level_group.values[0]\n    session_id = test.session_id.values[0]\n    a,b = limits[grp]\n    df = model_data_1(test, grp)\n    preds = []\n    for q in range(a, b):\n        model = models[q-1]   \n        pred = model.predict_proba(df)[0, 1]\n        mask = sample_submission.session_id.str.contains(f'q{q}')\n        sample_submission.loc[mask,'correct'] = int(pred &gt; threshold[q-1]) \n    #sample_submission = sample_submission[['session_id', 'correct']]\n    print(preds)\n    env.predict(sample_submission)\n</code></pre>\n<p>could you help me in solving the error, by pointing out mistake if any.<br>\nThank You</p>",
      "rawMarkdown": "Is the above problem in API fixed?\nI am having Submission Scoring Error, which i couldn't solve for two days.\n```\nlimits = {'0-4':(1,4), '5-12':(4,14), '13-22':(14,19)}\nfor (test, sample_submission) in iter_test:\n    test = test.sort_values(by='index')\n    grp = test.level_group.values[0]\n    session_id = test.session_id.values[0]\n    a,b = limits[grp]\n    df = model_data_1(test, grp)\n    preds = []\n    for q in range(a, b):\n        model = models[q-1]   \n        pred = model.predict_proba(df)[0, 1]\n        mask = sample_submission.session_id.str.contains(f'q{q}')\n        sample_submission.loc[mask,'correct'] = int(pred > threshold[q-1]) \n    #sample_submission = sample_submission[['session_id', 'correct']]\n    print(preds)\n    env.predict(sample_submission)\n```\ncould you help me in solving the error, by pointing out mistake if any.\nThank You",
      "votes": null
    },
    {
      "id": "2301568",
      "postDate": "06/14/2023 03:16:15",
      "content": "<p>The change of API caused much more effect than expected. For example, I have one normal submission which scored 0.703 before, and I select it as final submission. However,  with the new API running, it went wrong with the hint \"Submission Scoring Error\". But I can not deselect it.</p>\n<p>Hope Kaggle team can fix this problem! </p>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F14268627%2Ff0d0e088d5b1972c890c3e18c4df5a5f%2Fsssss.png?generation=1686712469412276&amp;alt=media\" alt=\"\"></p>",
      "rawMarkdown": "The change of API caused much more effect than expected. For example, I have one normal submission which scored 0.703 before, and I select it as final submission. However,  with the new API running, it went wrong with the hint \"Submission Scoring Error\". But I can not deselect it.\n\nHope Kaggle team can fix this problem! \n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F14268627%2Ff0d0e088d5b1972c890c3e18c4df5a5f%2Fsssss.png?generation=1686712469412276&alt=media)",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 2213780,
      "author_name": "cdeotte",
      "author_url": "",
      "post_date": "04/07/2023 20:58:45",
      "content": "<p><a href=\"https://www.kaggle.com/philculliton\" target=\"_blank\">@philculliton</a> Hi Phil, it would be great if you could fix the sample data in the Kaggle API so that it only provides <strong>1 session_id</strong> per for-loop iteration. </p>\n<p>Currently the Kaggle API provides <strong>3 session_id</strong> per for-loop during commit and the Kaggle API provides <strong>1 session_id</strong> per for-loop during submit. And the old API provided <strong>1 session_id</strong> per for-loop during commit.</p>\n<p>All old notebook are broken because <strong>two reasons</strong> (not one reason like you say):</p>\n<ul>\n<li><code>sample_submission, test</code> has changed to <code>test, sample_submission</code></li>\n<li>commit Kaggle API provides <strong>3 session_id</strong> instead of <strong>1 session_id</strong> like it used to </li>\n</ul>\n<p>Additionally old notebooks break because the double train data size causes memory errors, but that isn't an error regarding the Kaggle API.</p>",
      "votes": null,
      "replies": [
        {
          "id": 2213935,
          "author_name": "danielphalen",
          "author_url": "",
          "post_date": "04/08/2023 01:03:29",
          "content": "<p>In regards to this, I was getting some errors on submissions to the hidden test set that were not present when I ran with the API on the test set.  Do we expect 3 total loops in the iteration, one for each level group?  Or are there many more loops on the hidden test set?</p>",
          "votes": null,
          "replies": [
            {
              "id": 2214871,
              "author_name": "tanakaakinori",
              "author_url": "",
              "post_date": "04/08/2023 20:19:47",
              "content": "<p>Hello, <a href=\"https://www.kaggle.com/danielphalen\" target=\"_blank\">@danielphalen</a> <br>\nThe hidden test looks like 1 session_id and 1 level_group in every loop.<br>\nTherefore, I assume that the number of loops is the number of session_id * 3. <br>\nYes, it is so many loops.<br>\nI hope this will help.</p>",
              "votes": null,
              "replies": [
                {
                  "id": 2214940,
                  "author_name": "danielphalen",
                  "author_url": "",
                  "post_date": "04/08/2023 22:15:45",
                  "content": "<p>Thanks for that.  Do you know if the order is<br>\n<code>for session_id in session_ids:</code><br>\n<code>for level_group in level_groups:</code><br>\nor the other way around?</p>",
                  "votes": null,
                  "replies": [
                    {
                      "id": 2215651,
                      "author_name": "tanakaakinori",
                      "author_url": "",
                      "post_date": "04/09/2023 13:37:58",
                      "content": "<p>I'm sorry, I do not know the order in the Hidden test.<br>\nBut I just know that.<br>\nBefore the Kaggle API updated, the Sample test worked like this in the Notebook.</p>\n<pre><code> (sample_submission, test)  iter_test:\n    (test.level_group.values[])\n    (session_id = test.session_id.values[])\n</code></pre>\n<p>0-4<br>\n20090109393214576<br>\n0-4<br>\n20090312143683264<br>\n0-4<br>\n20090312331414616<br>\n5-12<br>\n20090109393214576<br>\n5-12<br>\n20090312143683264<br>\n5-12<br>\n20090312331414616<br>\n13-22<br>\n20090109393214576<br>\n13-22<br>\n20090312143683264<br>\n13-22<br>\n20090312331414616</p>",
                      "votes": null,
                      "replies": []
                    }
                  ]
                }
              ]
            }
          ]
        },
        {
          "id": 2213936,
          "author_name": "boscoyung",
          "author_url": "",
          "post_date": "04/08/2023 01:05:05",
          "content": "<p>Hi <a href=\"https://www.kaggle.com/cdeotte\" target=\"_blank\">@cdeotte</a>, can I confirm with you that during <strong>submission</strong> it is still <strong>1 session_id, 1 level_group</strong> per for-loop iteration? <br>\nThat means, it is the same as before except the order of <code>test, sample_submission</code>?<br>\nThanks a lot!</p>",
          "votes": null,
          "replies": [
            {
              "id": 2214873,
              "author_name": "tanakaakinori",
              "author_url": "",
              "post_date": "04/08/2023 20:22:08",
              "content": "<p>Hello, <a href=\"https://www.kaggle.com/boscoyung\" target=\"_blank\">@boscoyung</a> <br>\nI have confirmed that the hidden test is almost certainly 1 session_id and 1 level_group in every loop.<br>\nThe way I did it is the following code.</p>\n<pre><code> (test, sample_submission)  iter_test:\n     (test[].nunique() == ) &amp; (test[].nunique() == ):\n        *****my prediction code*****\n    :\n        sample_submission[] = \n        env.predict(sample_submission)\n</code></pre>\n<p>The submission was successful and I got the normal score. My score did not decrease.<br>\nI hope this helps you.</p>",
              "votes": null,
              "replies": [
                {
                  "id": 2214955,
                  "author_name": "boscoyung",
                  "author_url": "",
                  "post_date": "04/08/2023 23:10:36",
                  "content": "<p>Thanks <a href=\"https://www.kaggle.com/tanakaakinori\" target=\"_blank\">@tanakaakinori</a> !</p>",
                  "votes": null,
                  "replies": []
                }
              ]
            }
          ]
        },
        {
          "id": 2214154,
          "author_name": "tanakaakinori",
          "author_url": "",
          "post_date": "04/08/2023 07:33:11",
          "content": "<p>Thank you, Chris. You expressed very precisely what I was struggling with.</p>\n<p>It means that there are the following difficulties:</p>\n<ul>\n<li>If the submission code assumes 1 session_id, <strong>an error occurs when saving the notebook.</strong></li>\n<li>If the submission code assumes 3 session_id, <strong>an error occurs after submission.</strong></li>\n</ul>\n<p>We need to write the submission code for both 1 session_id and 3 session_id.<br>\nThis is a bit unnatural.</p>",
          "votes": null,
          "replies": [
            {
              "id": 2273789,
              "author_name": "navinkumarmnk",
              "author_url": "",
              "post_date": "05/25/2023 12:07:59",
              "content": "<p>Could you please explain what u said in detail.<br>\nI am having Submission Scoring Error, which i couldn't solve for two days.</p>\n<pre><code>limits = {'0-4':(1,4), '5-12':(4,14), '13-22':(14,19)}\nfor (test, sample_submission) in iter_test:\n    test = test.sort_values(by='index')\n    grp = test.level_group.values[0]\n    session_id = test.session_id.values[0]\n    a,b = limits[grp]\n    df = model_data_1(test, grp)\n    preds = []\n    for q in range(a, b):\n        model = models[q-1]   \n        pred = model.predict_proba(df)[0, 1]\n        mask = sample_submission.session_id.str.contains(f'q{q}')\n        sample_submission.loc[mask,'correct'] = int(pred &gt; threshold[q-1]) \n    #sample_submission = sample_submission[['session_id', 'correct']]\n    print(preds)\n    env.predict(sample_submission)\n</code></pre>\n<p>could you help me in solving the error, by pointing out mistake if any.<br>\nThank You</p>",
              "votes": null,
              "replies": []
            }
          ]
        },
        {
          "id": 2273793,
          "author_name": "navinkumarmnk",
          "author_url": "",
          "post_date": "05/25/2023 12:11:05",
          "content": "<p>Is the above problem in API fixed?<br>\nI am having Submission Scoring Error, which i couldn't solve for two days.</p>\n<pre><code>limits = {'0-4':(1,4), '5-12':(4,14), '13-22':(14,19)}\nfor (test, sample_submission) in iter_test:\n    test = test.sort_values(by='index')\n    grp = test.level_group.values[0]\n    session_id = test.session_id.values[0]\n    a,b = limits[grp]\n    df = model_data_1(test, grp)\n    preds = []\n    for q in range(a, b):\n        model = models[q-1]   \n        pred = model.predict_proba(df)[0, 1]\n        mask = sample_submission.session_id.str.contains(f'q{q}')\n        sample_submission.loc[mask,'correct'] = int(pred &gt; threshold[q-1]) \n    #sample_submission = sample_submission[['session_id', 'correct']]\n    print(preds)\n    env.predict(sample_submission)\n</code></pre>\n<p>could you help me in solving the error, by pointing out mistake if any.<br>\nThank You</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 2213855,
      "author_name": "darryldias",
      "author_url": "",
      "post_date": "04/07/2023 22:33:56",
      "content": "<p>It would also be great if the basic submission demo is updated.<br>\n<a href=\"https://www.kaggle.com/code/philculliton/basic-submission-demo\" target=\"_blank\">https://www.kaggle.com/code/philculliton/basic-submission-demo</a></p>",
      "votes": null,
      "replies": [
        {
          "id": 2214000,
          "author_name": "darryldias",
          "author_url": "",
          "post_date": "04/08/2023 04:25:40",
          "content": "<p>When the change is done, you can see the 3 different session_ids in sample_submission<br>\n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F1903540%2Fcfb4695ef21dc9ce147169c9c6a0835b%2Fsample_problem.jpg?generation=1680927882047910&amp;alt=media\" alt=\"\"></p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 2301568,
      "author_name": "littlstar123",
      "author_url": "",
      "post_date": "06/14/2023 03:16:15",
      "content": "<p>The change of API caused much more effect than expected. For example, I have one normal submission which scored 0.703 before, and I select it as final submission. However,  with the new API running, it went wrong with the hint \"Submission Scoring Error\". But I can not deselect it.</p>\n<p>Hope Kaggle team can fix this problem! </p>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F14268627%2Ff0d0e088d5b1972c890c3e18c4df5a5f%2Fsssss.png?generation=1686712469412276&amp;alt=media\" alt=\"\"></p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "2213621": "Hi Kagglers,\n\nThe API was recently updated to fix reported bugs (this fix has been finalized), however the change requires all submissions to switch the order of the arguments to the iter_test object.\n\nSpecifically, you will need to make the following change to any previous inference notebooks:\n\nChange \n`for (sample_submission, test) in iter_test:`\nTo\n`for (test, sample_submission) in iter_test:`\n\nAny code using the previous order will run into an error, which will unfortunately cause issues when rerunning old submissions. However, this change was necessary to fix the issues we were seeing.\n\nWe acknowledge that the change caused problems for a number of people, and we apologize for the frustration this caused! Although it doesn’t fully compensate for lost time, we will be extending the competition by a week to make up for lost submissions due to the update.\n\nIf you have any questions or continue to run into errors, please respond in this thread.\n\nMany thanks!",
    "2213780": "philculliton Hi Phil, it would be great if you could fix the sample data in the Kaggle API so that it only provides **1 session_id** per for-loop iteration. \n\nCurrently the Kaggle API provides **3 session_id** per for-loop during commit and the Kaggle API provides **1 session_id** per for-loop during submit. And the old API provided **1 session_id** per for-loop during commit.\n\nAll old notebook are broken because **two reasons** (not one reason like you say):\n* `sample_submission, test` has changed to `test, sample_submission`\n* commit Kaggle API provides **3 session_id** instead of **1 session_id** like it used to \n\nAdditionally old notebooks break because the double train data size causes memory errors, but that isn't an error regarding the Kaggle API.",
    "2213855": "It would also be great if the basic submission demo is updated.\n[https://www.kaggle.com/code/philculliton/basic-submission-demo](https://www.kaggle.com/code/philculliton/basic-submission-demo)",
    "2213935": "In regards to this, I was getting some errors on submissions to the hidden test set that were not present when I ran with the API on the test set.  Do we expect 3 total loops in the iteration, one for each level group?  Or are there many more loops on the hidden test set?",
    "2213936": "Hi @cdeotte, can I confirm with you that during **submission** it is still **1 session_id, 1 level_group** per for-loop iteration? \nThat means, it is the same as before except the order of `test, sample_submission`?\nThanks a lot!",
    "2214000": "When the change is done, you can see the 3 different session_ids in sample_submission\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F1903540%2Fcfb4695ef21dc9ce147169c9c6a0835b%2Fsample_problem.jpg?generation=1680927882047910&alt=media)",
    "2214154": "Thank you, Chris. You expressed very precisely what I was struggling with.\n\nIt means that there are the following difficulties:\n\n- If the submission code assumes 1 session_id, **an error occurs when saving the notebook.**\n- If the submission code assumes 3 session_id, **an error occurs after submission.**\n\nWe need to write the submission code for both 1 session_id and 3 session_id.\nThis is a bit unnatural.",
    "2214871": "Hello, @danielphalen \nThe hidden test looks like 1 session_id and 1 level_group in every loop.\nTherefore, I assume that the number of loops is the number of session_id * 3. \nYes, it is so many loops.\nI hope this will help.",
    "2214873": "Hello, @boscoyung \nI have confirmed that the hidden test is almost certainly 1 session_id and 1 level_group in every loop.\nThe way I did it is the following code.\n```python\nfor (test, sample_submission) in iter_test:\n    if (test['level_group'].nunique() == 1) & (test['session_id'].nunique() == 1):\n        *****my prediction code*****\n    else:\n        sample_submission['correct'] = 2\n        env.predict(sample_submission)\n```\n\nThe submission was successful and I got the normal score. My score did not decrease.\nI hope this helps you.",
    "2214940": "Thanks for that.  Do you know if the order is\n`for session_id in session_ids:`\n`        for level_group in level_groups:`\nor the other way around?",
    "2214955": "Thanks @tanakaakinori !",
    "2215651": "I'm sorry, I do not know the order in the Hidden test.\nBut I just know that.\nBefore the Kaggle API updated, the Sample test worked like this in the Notebook.\n```python\nfor (sample_submission, test) in iter_test:\n    print(test.level_group.values[0])\n    print(session_id = test.session_id.values[0])\n```\n0-4\n20090109393214576\n0-4\n20090312143683264\n0-4\n20090312331414616\n5-12\n20090109393214576\n5-12\n20090312143683264\n5-12\n20090312331414616\n13-22\n20090109393214576\n13-22\n20090312143683264\n13-22\n20090312331414616",
    "2273789": "Could you please explain what u said in detail.\nI am having Submission Scoring Error, which i couldn't solve for two days.\n```\nlimits = {'0-4':(1,4), '5-12':(4,14), '13-22':(14,19)}\nfor (test, sample_submission) in iter_test:\n    test = test.sort_values(by='index')\n    grp = test.level_group.values[0]\n    session_id = test.session_id.values[0]\n    a,b = limits[grp]\n    df = model_data_1(test, grp)\n    preds = []\n    for q in range(a, b):\n        model = models[q-1]   \n        pred = model.predict_proba(df)[0, 1]\n        mask = sample_submission.session_id.str.contains(f'q{q}')\n        sample_submission.loc[mask,'correct'] = int(pred > threshold[q-1]) \n    #sample_submission = sample_submission[['session_id', 'correct']]\n    print(preds)\n    env.predict(sample_submission)\n \n```\ncould you help me in solving the error, by pointing out mistake if any.\nThank You",
    "2273793": "Is the above problem in API fixed?\nI am having Submission Scoring Error, which i couldn't solve for two days.\n```\nlimits = {'0-4':(1,4), '5-12':(4,14), '13-22':(14,19)}\nfor (test, sample_submission) in iter_test:\n    test = test.sort_values(by='index')\n    grp = test.level_group.values[0]\n    session_id = test.session_id.values[0]\n    a,b = limits[grp]\n    df = model_data_1(test, grp)\n    preds = []\n    for q in range(a, b):\n        model = models[q-1]   \n        pred = model.predict_proba(df)[0, 1]\n        mask = sample_submission.session_id.str.contains(f'q{q}')\n        sample_submission.loc[mask,'correct'] = int(pred > threshold[q-1]) \n    #sample_submission = sample_submission[['session_id', 'correct']]\n    print(preds)\n    env.predict(sample_submission)\n```\ncould you help me in solving the error, by pointing out mistake if any.\nThank You",
    "2301568": "The change of API caused much more effect than expected. For example, I have one normal submission which scored 0.703 before, and I select it as final submission. However,  with the new API running, it went wrong with the hint \"Submission Scoring Error\". But I can not deselect it.\n\nHope Kaggle team can fix this problem! \n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F14268627%2Ff0d0e088d5b1972c890c3e18c4df5a5f%2Fsssss.png?generation=1686712469412276&alt=media)"
  },
  "source": "meta"
}