{
  "id": 396270,
  "title": "error while submit ",
  "url": "/competitions/predict-student-performance-from-game-play/discussion/396270",
  "author_name": "Ignat",
  "post_date": "2023-03-21T01:18:49.618000",
  "votes": 2,
  "comment_count": 7,
  "views": 0,
  "content": "<p>Try to submit and got error <br>\n     28         mask = sample_submission.session_id.str.contains(f'q{t}')<br>\n---&gt; 29         sample_submission.loc[mask,'correct'] = int(p.item()&gt;best_threshold)<br>\n     30 <br>\n     31     env.predict(sample_submission)</p>\n<p>ValueError: can only convert an array of size 1 to a Python scalar</p>",
  "messages": [
    {
      "id": 2190074,
      "postDate": "2023-03-21T02:39:03.293Z",
      "content": "<p>I encountered the same issue. This has to do with the recent data reset, see <a href=\"https://www.kaggle.com/competitions/predict-student-performance-from-game-play/discussion/396202\" target=\"_blank\">this post</a>. In particular, the new <code>iter_test</code> now generates a batch of <code>session_id</code>s each of which contains all three <code>level_group</code>s. So if you are using one of the public notebooks, the submission part is likely to throw the exception you brought up. The solution is to modify the submission loop according to the new test set iterator <code>iter_test</code>.</p>",
      "rawMarkdown": "I encountered the same issue. This has to do with the recent data reset, see [this post](https://www.kaggle.com/competitions/predict-student-performance-from-game-play/discussion/396202). In particular, the new `iter_test` now generates a batch of `session_id`s each of which contains all three `level_group`s. So if you are using one of the public notebooks, the submission part is likely to throw the exception you brought up. The solution is to modify the submission loop according to the new test set iterator `iter_test`.",
      "votes": 2,
      "replies": [
        {
          "id": 2190217,
          "postDate": "2023-03-21T05:34:08.200Z",
          "content": "<p>Hi, l countered the same issue. l am so confused about new iter_test, can l ask how should we modify the submission loop in the public notebook?</p>",
          "rawMarkdown": "Hi, l countered the same issue. l am so confused about new iter_test, can l ask how should we modify the submission loop in the public notebook?",
          "replies": [
            {
              "id": 2190264,
              "postDate": "2023-03-21T06:29:52.790Z",
              "content": "<p><a href=\"https://www.kaggle.com/feiyidong\" target=\"_blank\">@feiyidong</a>  It looks like the new <code>iter_test</code> generator introduces once again the data leak problem reported at the beginning of the competition.  I suggest we wait until the kaggle team and the host fix the data leak issue. To follow up, please check <a href=\"https://www.kaggle.com/competitions/predict-student-performance-from-game-play/discussion/396202\" target=\"_blank\">this conversation</a>.</p>",
              "rawMarkdown": "@feiyidong  It looks like the new `iter_test` generator introduces once again the data leak problem reported at the beginning of the competition.  I suggest we wait until the kaggle team and the host fix the data leak issue. To follow up, please check [this conversation](https://www.kaggle.com/competitions/predict-student-performance-from-game-play/discussion/396202).",
              "votes": 1
            },
            {
              "id": 2190296,
              "postDate": "2023-03-21T07:01:52.207Z",
              "content": "<p>Thanks for the response! Very helpful!</p>",
              "rawMarkdown": "Thanks for the response! Very helpful!"
            }
          ]
        }
      ]
    },
    {
      "id": 2190031,
      "postDate": "2023-03-21T01:18:49.620Z",
      "content": "<p>Try to submit and got error <br>\n     28         mask = sample_submission.session_id.str.contains(f'q{t}')<br>\n---&gt; 29         sample_submission.loc[mask,'correct'] = int(p.item()&gt;best_threshold)<br>\n     30 <br>\n     31     env.predict(sample_submission)</p>\n<p>ValueError: can only convert an array of size 1 to a Python scalar</p>",
      "rawMarkdown": "Try to submit and got error \n     28         mask = sample_submission.session_id.str.contains(f'q{t}')\n---> 29         sample_submission.loc[mask,'correct'] = int(p.item()>best_threshold)\n     30 \n     31     env.predict(sample_submission)\n\nValueError: can only convert an array of size 1 to a Python scalar",
      "votes": 2
    },
    {
      "id": 2191372,
      "postDate": "2023-03-21T23:28:48.273Z",
      "content": "<p>A bit of update:<br>\nThe kaggle team just said that in the hidden test set each batch will have only one <code>session_id</code> and one <code>level_group.</code> And the team is also fixing the sample test dataset so that it's gonna have one <code>session_id</code> and one <code>level_group</code> per test. In other words, the previous submission loop should be working again after the fix.<br>\nCurrently, everyone is waiting on the kaggle team's next announcement.</p>",
      "rawMarkdown": "A bit of update:\nThe kaggle team just said that in the hidden test set each batch will have only one `session_id` and one `level_group.` And the team is also fixing the sample test dataset so that it's gonna have one `session_id` and one `level_group` per test. In other words, the previous submission loop should be working again after the fix.\nCurrently, everyone is waiting on the kaggle team's next announcement."
    },
    {
      "id": 2190347,
      "postDate": "2023-03-21T07:46:32.103Z",
      "content": "<p>Have you tried to submit the result again since you opened this discussion?</p>",
      "rawMarkdown": "Have you tried to submit the result again since you opened this discussion?\n"
    },
    {
      "id": 2190221,
      "postDate": "2023-03-21T05:39:15.657Z",
      "rawMarkdown": "",
      "isDeleted": true
    }
  ],
  "comments": [
    {
      "id": 2190074,
      "author_name": "fermion",
      "author_url": "",
      "post_date": "2023-03-21T02:39:03.293000",
      "content": "<p>I encountered the same issue. This has to do with the recent data reset, see <a href=\"https://www.kaggle.com/competitions/predict-student-performance-from-game-play/discussion/396202\" target=\"_blank\">this post</a>. In particular, the new <code>iter_test</code> now generates a batch of <code>session_id</code>s each of which contains all three <code>level_group</code>s. So if you are using one of the public notebooks, the submission part is likely to throw the exception you brought up. The solution is to modify the submission loop according to the new test set iterator <code>iter_test</code>.</p>",
      "votes": 2,
      "replies": [
        {
          "id": 2190217,
          "author_name": "Feiyi Dong",
          "author_url": "",
          "post_date": "2023-03-21T05:34:08.200000",
          "content": "<p>Hi, l countered the same issue. l am so confused about new iter_test, can l ask how should we modify the submission loop in the public notebook?</p>",
          "votes": 0,
          "replies": [
            {
              "id": 2190264,
              "author_name": "fermion",
              "author_url": "",
              "post_date": "2023-03-21T06:29:52.790000",
              "content": "<p><a href=\"https://www.kaggle.com/feiyidong\" target=\"_blank\">@feiyidong</a>  It looks like the new <code>iter_test</code> generator introduces once again the data leak problem reported at the beginning of the competition.  I suggest we wait until the kaggle team and the host fix the data leak issue. To follow up, please check <a href=\"https://www.kaggle.com/competitions/predict-student-performance-from-game-play/discussion/396202\" target=\"_blank\">this conversation</a>.</p>",
              "votes": 1,
              "replies": []
            },
            {
              "id": 2190296,
              "author_name": "Feiyi Dong",
              "author_url": "",
              "post_date": "2023-03-21T07:01:52.207000",
              "content": "<p>Thanks for the response! Very helpful!</p>",
              "votes": 0,
              "replies": []
            }
          ]
        }
      ]
    },
    {
      "id": 2191372,
      "author_name": "fermion",
      "author_url": "",
      "post_date": "2023-03-21T23:28:48.273000",
      "content": "<p>A bit of update:<br>\nThe kaggle team just said that in the hidden test set each batch will have only one <code>session_id</code> and one <code>level_group.</code> And the team is also fixing the sample test dataset so that it's gonna have one <code>session_id</code> and one <code>level_group</code> per test. In other words, the previous submission loop should be working again after the fix.<br>\nCurrently, everyone is waiting on the kaggle team's next announcement.</p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 2190347,
      "author_name": "ZinkerovO",
      "author_url": "",
      "post_date": "2023-03-21T07:46:32.103000",
      "content": "<p>Have you tried to submit the result again since you opened this discussion?</p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 2190221,
      "author_name": "",
      "author_url": "",
      "post_date": "2023-03-21T05:39:15.657000",
      "content": "",
      "votes": 0,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "2190074": "I encountered the same issue. This has to do with the recent data reset, see [this post](https://www.kaggle.com/competitions/predict-student-performance-from-game-play/discussion/396202). In particular, the new `iter_test` now generates a batch of `session_id`s each of which contains all three `level_group`s. So if you are using one of the public notebooks, the submission part is likely to throw the exception you brought up. The solution is to modify the submission loop according to the new test set iterator `iter_test`.",
    "2190031": "Try to submit and got error \n     28         mask = sample_submission.session_id.str.contains(f'q{t}')\n---> 29         sample_submission.loc[mask,'correct'] = int(p.item()>best_threshold)\n     30 \n     31     env.predict(sample_submission)\n\nValueError: can only convert an array of size 1 to a Python scalar",
    "2191372": "A bit of update:\nThe kaggle team just said that in the hidden test set each batch will have only one `session_id` and one `level_group.` And the team is also fixing the sample test dataset so that it's gonna have one `session_id` and one `level_group` per test. In other words, the previous submission loop should be working again after the fix.\nCurrently, everyone is waiting on the kaggle team's next announcement.",
    "2190347": "Have you tried to submit the result again since you opened this discussion?\n",
    "2190221": ""
  }
}