{
  "id": 406193,
  "title": "How to submit prediction?",
  "url": "/competitions/predict-student-performance-from-game-play/discussion/406193",
  "author_name": "",
  "post_date": "2023-05-01T10:35:17.315825300Z",
  "votes": 1,
  "comment_count": 2,
  "views": 0,
  "content": "<p>Am I the only one who's struggling to submit a prediction? Just trying the submit the simple mean prediction per question but I'm struggling to understand how to do it with this weird jo_wilder environment. Can anyone help me out?</p>\n<p>Even when I do some dummy predictions I still can't get it to work</p>\n<p>`for (test, sample_submission) in iter_test:</p>\n<h1>print(test.columns)</h1>\n<h1>print(test.shape)</h1>\n<pre><code>sample_submission['question'] = [int(label.split('_')[1][1:]) for label in sample_submission['session_id']]\ndf = sample_submission\ndf.loc[df.question == 1, 'correct'] = 1\ndf.loc[df.question == 2, 'correct'] = 1 \ndf.loc[df.question == 3, 'correct'] = 1 \ndf.loc[df.question == 4, 'correct'] = 1\ndf.loc[df.question == 5, 'correct'] = 0 \ndf.loc[df.question == 6, 'correct'] = 1 \ndf.loc[df.question == 7, 'correct'] = 1 \ndf.loc[df.question == 8, 'correct'] = 0 \ndf.loc[df.question == 9, 'correct'] = 1 \ndf.loc[df.question == 10, 'correct'] = 0\ndf.loc[df.question == 11, 'correct'] = 0\ndf.loc[df.question == 12, 'correct'] = 1 \ndf.loc[df.question == 13, 'correct'] = 0 \ndf.loc[df.question == 14, 'correct'] = 1 \ndf.loc[df.question == 15, 'correct'] = 0\ndf.loc[df.question == 16, 'correct'] = 1\ndf.loc[df.question == 17, 'correct'] = 0\ndf.loc[df.question == 18, 'correct'] = 1\nsample_submission = df[['session_id', 'correct']]\nprint(sample_submission.tail(10))\nprint('-'*20)\nenv.predict(sample_submission)\n</code></pre>\n<h1>print(sample_submission.tail(10))</h1>\n<h1>print('-'*20)</h1>\n<p>`</p>",
  "messages": [
    {
      "id": "2241251",
      "postDate": "05/01/2023 10:35:17",
      "content": "<p>Am I the only one who's struggling to submit a prediction? Just trying the submit the simple mean prediction per question but I'm struggling to understand how to do it with this weird jo_wilder environment. Can anyone help me out?</p>\n<p>Even when I do some dummy predictions I still can't get it to work</p>\n<p>`for (test, sample_submission) in iter_test:</p>\n<h1>print(test.columns)</h1>\n<h1>print(test.shape)</h1>\n<pre><code>sample_submission['question'] = [int(label.split('_')[1][1:]) for label in sample_submission['session_id']]\ndf = sample_submission\ndf.loc[df.question == 1, 'correct'] = 1\ndf.loc[df.question == 2, 'correct'] = 1 \ndf.loc[df.question == 3, 'correct'] = 1 \ndf.loc[df.question == 4, 'correct'] = 1\ndf.loc[df.question == 5, 'correct'] = 0 \ndf.loc[df.question == 6, 'correct'] = 1 \ndf.loc[df.question == 7, 'correct'] = 1 \ndf.loc[df.question == 8, 'correct'] = 0 \ndf.loc[df.question == 9, 'correct'] = 1 \ndf.loc[df.question == 10, 'correct'] = 0\ndf.loc[df.question == 11, 'correct'] = 0\ndf.loc[df.question == 12, 'correct'] = 1 \ndf.loc[df.question == 13, 'correct'] = 0 \ndf.loc[df.question == 14, 'correct'] = 1 \ndf.loc[df.question == 15, 'correct'] = 0\ndf.loc[df.question == 16, 'correct'] = 1\ndf.loc[df.question == 17, 'correct'] = 0\ndf.loc[df.question == 18, 'correct'] = 1\nsample_submission = df[['session_id', 'correct']]\nprint(sample_submission.tail(10))\nprint('-'*20)\nenv.predict(sample_submission)\n</code></pre>\n<h1>print(sample_submission.tail(10))</h1>\n<h1>print('-'*20)</h1>\n<p>`</p>",
      "rawMarkdown": "Am I the only one who's struggling to submit a prediction? Just trying the submit the simple mean prediction per question but I'm struggling to understand how to do it with this weird jo_wilder environment. Can anyone help me out?\n\nEven when I do some dummy predictions I still can't get it to work\n\n`for (test, sample_submission) in iter_test:\n#     print(test.columns)\n#     print(test.shape)\n    sample_submission['question'] = [int(label.split('_')[1][1:]) for label in sample_submission['session_id']]\n    df = sample_submission\n    df.loc[df.question == 1, 'correct'] = 1\n    df.loc[df.question == 2, 'correct'] = 1 \n    df.loc[df.question == 3, 'correct'] = 1 \n    df.loc[df.question == 4, 'correct'] = 1\n    df.loc[df.question == 5, 'correct'] = 0 \n    df.loc[df.question == 6, 'correct'] = 1 \n    df.loc[df.question == 7, 'correct'] = 1 \n    df.loc[df.question == 8, 'correct'] = 0 \n    df.loc[df.question == 9, 'correct'] = 1 \n    df.loc[df.question == 10, 'correct'] = 0\n    df.loc[df.question == 11, 'correct'] = 0\n    df.loc[df.question == 12, 'correct'] = 1 \n    df.loc[df.question == 13, 'correct'] = 0 \n    df.loc[df.question == 14, 'correct'] = 1 \n    df.loc[df.question == 15, 'correct'] = 0\n    df.loc[df.question == 16, 'correct'] = 1\n    df.loc[df.question == 17, 'correct'] = 0\n    df.loc[df.question == 18, 'correct'] = 1\n    sample_submission = df[['session_id', 'correct']]\n    print(sample_submission.tail(10))\n    print('-'*20)\n    env.predict(sample_submission)\n#     print(sample_submission.tail(10))\n#     print('-'*20)\n`",
      "votes": null
    },
    {
      "id": "2241268",
      "postDate": "05/01/2023 10:51:01",
      "content": "<p>import pandas as pd<br>\nimport jo_wilder<br>\nenv = jo_wilder.make_env()<br>\niter_test = env.iter_test()   <br>\nfor (test, sam_sub) in iter_test:     <br>\n        sam_sub['question'] = [int(label.split('_')[1][1:]) for label in sam_sub['session_id']]    <br>\n        grp = test.level_group.values[0]    <br>\n        sam_sub['correct'] = 1<br>\n        sam_sub.loc[sam_sub.question.isin([5, 8, 10, 13, 15]), 'correct'] = 0  <br>\n        sam_sub = sam_sub[['session_id', 'correct']]        <br>\n        env.predict(sam_sub)</p>",
      "rawMarkdown": "import pandas as pd\nimport jo_wilder\nenv = jo_wilder.make_env()\niter_test = env.iter_test()   \nfor (test, sam_sub) in iter_test:     \n        sam_sub['question'] = [int(label.split('_')[1][1:]) for label in sam_sub['session_id']]    \n        grp = test.level_group.values[0]    \n        sam_sub['correct'] = 1\n        sam_sub.loc[sam_sub.question.isin([5, 8, 10, 13, 15]), 'correct'] = 0  \n        sam_sub = sam_sub[['session_id', 'correct']]        \n        env.predict(sam_sub)",
      "votes": null
    },
    {
      "id": "2241542",
      "postDate": "05/01/2023 15:34:02",
      "content": "<p>You can make it like this:</p>\n<p>for (test_all, sample_submission) in iter_test:<br>\n    test_ = test_all.copy()<br>\n    cur_lv_gp = test_all[\"level_group\"].unique()[0]<br>\n    grp = test_all.level_group.values[0]<br>\n    session_id = test_all.session_id.values[0]</p>\n<p>It should be easy. </p>",
      "rawMarkdown": "You can make it like this:\n\nfor (test_all, sample_submission) in iter_test:\n    test_ = test_all.copy()\n    cur_lv_gp = test_all[\"level_group\"].unique()[0]\n    grp = test_all.level_group.values[0]\n    session_id = test_all.session_id.values[0]\n\nIt should be easy.",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 2241268,
      "author_name": "vadimkamaev",
      "author_url": "",
      "post_date": "05/01/2023 10:51:01",
      "content": "<p>import pandas as pd<br>\nimport jo_wilder<br>\nenv = jo_wilder.make_env()<br>\niter_test = env.iter_test()   <br>\nfor (test, sam_sub) in iter_test:     <br>\n        sam_sub['question'] = [int(label.split('_')[1][1:]) for label in sam_sub['session_id']]    <br>\n        grp = test.level_group.values[0]    <br>\n        sam_sub['correct'] = 1<br>\n        sam_sub.loc[sam_sub.question.isin([5, 8, 10, 13, 15]), 'correct'] = 0  <br>\n        sam_sub = sam_sub[['session_id', 'correct']]        <br>\n        env.predict(sam_sub)</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 2241542,
      "author_name": "littlstar123",
      "author_url": "",
      "post_date": "05/01/2023 15:34:02",
      "content": "<p>You can make it like this:</p>\n<p>for (test_all, sample_submission) in iter_test:<br>\n    test_ = test_all.copy()<br>\n    cur_lv_gp = test_all[\"level_group\"].unique()[0]<br>\n    grp = test_all.level_group.values[0]<br>\n    session_id = test_all.session_id.values[0]</p>\n<p>It should be easy. </p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "2241251": "Am I the only one who's struggling to submit a prediction? Just trying the submit the simple mean prediction per question but I'm struggling to understand how to do it with this weird jo_wilder environment. Can anyone help me out?\n\nEven when I do some dummy predictions I still can't get it to work\n\n`for (test, sample_submission) in iter_test:\n#     print(test.columns)\n#     print(test.shape)\n    sample_submission['question'] = [int(label.split('_')[1][1:]) for label in sample_submission['session_id']]\n    df = sample_submission\n    df.loc[df.question == 1, 'correct'] = 1\n    df.loc[df.question == 2, 'correct'] = 1 \n    df.loc[df.question == 3, 'correct'] = 1 \n    df.loc[df.question == 4, 'correct'] = 1\n    df.loc[df.question == 5, 'correct'] = 0 \n    df.loc[df.question == 6, 'correct'] = 1 \n    df.loc[df.question == 7, 'correct'] = 1 \n    df.loc[df.question == 8, 'correct'] = 0 \n    df.loc[df.question == 9, 'correct'] = 1 \n    df.loc[df.question == 10, 'correct'] = 0\n    df.loc[df.question == 11, 'correct'] = 0\n    df.loc[df.question == 12, 'correct'] = 1 \n    df.loc[df.question == 13, 'correct'] = 0 \n    df.loc[df.question == 14, 'correct'] = 1 \n    df.loc[df.question == 15, 'correct'] = 0\n    df.loc[df.question == 16, 'correct'] = 1\n    df.loc[df.question == 17, 'correct'] = 0\n    df.loc[df.question == 18, 'correct'] = 1\n    sample_submission = df[['session_id', 'correct']]\n    print(sample_submission.tail(10))\n    print('-'*20)\n    env.predict(sample_submission)\n#     print(sample_submission.tail(10))\n#     print('-'*20)\n`",
    "2241268": "import pandas as pd\nimport jo_wilder\nenv = jo_wilder.make_env()\niter_test = env.iter_test()   \nfor (test, sam_sub) in iter_test:     \n        sam_sub['question'] = [int(label.split('_')[1][1:]) for label in sam_sub['session_id']]    \n        grp = test.level_group.values[0]    \n        sam_sub['correct'] = 1\n        sam_sub.loc[sam_sub.question.isin([5, 8, 10, 13, 15]), 'correct'] = 0  \n        sam_sub = sam_sub[['session_id', 'correct']]        \n        env.predict(sam_sub)",
    "2241542": "You can make it like this:\n\nfor (test_all, sample_submission) in iter_test:\n    test_ = test_all.copy()\n    cur_lv_gp = test_all[\"level_group\"].unique()[0]\n    grp = test_all.level_group.values[0]\n    session_id = test_all.session_id.values[0]\n\nIt should be easy."
  },
  "source": "meta"
}