{
  "id": 409679,
  "title": "Submission Error - Notebook Threw Exception",
  "url": "/competitions/predict-student-performance-from-game-play/discussion/409679",
  "author_name": "Hayden LaBrie",
  "post_date": "2023-05-12T05:12:32.562000",
  "votes": 0,
  "comment_count": 0,
  "views": 0,
  "content": "<p>I am getting Notebook Threw Exception when submitting my notebook. I used the test submission and it seems to be working fine. I am not sure what the issue is with my submission.</p>\n<p>Here is my attempt to submit:</p>\n<pre><code> (test, sample_submission)  iter_test:\n    \n    df = feature_engineer(test)\n    \n    predict(df,sample_prediction_df)\n    \n    env.predict(sample_prediction_df)\n    \n    sample_prediction_df = pd.DataFrame(columns=[, ])\n</code></pre>\n<p>Also the predict function I used was written above as:</p>\n<pre><code> ():    \n    ids = df[].unique()\n    tmp = df.loc[df[] == ]\n      tmp.empty:\n        tmp.pop()\n         j  ():\n            new_row = {: (ids[]) + , : (models[j].predict(tmp)).strip()}\n            output.loc[(output)] = new_row\n    tmp = df.loc[df[] == ]\n      tmp.empty:\n        tmp.pop()\n         j   (,):\n            new_row = {: (ids[]) + , : (models[j].predict(tmp)).strip()}\n            output.loc[(output)] = new_row\n    tmp = df.loc[df[] == ]\n      tmp.empty:\n        tmp.pop()\n         j   (,):\n            new_row = {: (ids[]) + , : (models[j].predict(tmp)).strip()}\n            output.loc[(output)] = new_row\n</code></pre>",
  "messages": [
    {
      "id": 2255909,
      "postDate": "2023-05-12T05:12:32.563Z",
      "content": "<p>I am getting Notebook Threw Exception when submitting my notebook. I used the test submission and it seems to be working fine. I am not sure what the issue is with my submission.</p>\n<p>Here is my attempt to submit:</p>\n<pre><code> (test, sample_submission)  iter_test:\n    \n    df = feature_engineer(test)\n    \n    predict(df,sample_prediction_df)\n    \n    env.predict(sample_prediction_df)\n    \n    sample_prediction_df = pd.DataFrame(columns=[, ])\n</code></pre>\n<p>Also the predict function I used was written above as:</p>\n<pre><code> ():    \n    ids = df[].unique()\n    tmp = df.loc[df[] == ]\n      tmp.empty:\n        tmp.pop()\n         j  ():\n            new_row = {: (ids[]) + , : (models[j].predict(tmp)).strip()}\n            output.loc[(output)] = new_row\n    tmp = df.loc[df[] == ]\n      tmp.empty:\n        tmp.pop()\n         j   (,):\n            new_row = {: (ids[]) + , : (models[j].predict(tmp)).strip()}\n            output.loc[(output)] = new_row\n    tmp = df.loc[df[] == ]\n      tmp.empty:\n        tmp.pop()\n         j   (,):\n            new_row = {: (ids[]) + , : (models[j].predict(tmp)).strip()}\n            output.loc[(output)] = new_row\n</code></pre>",
      "rawMarkdown": "I am getting Notebook Threw Exception when submitting my notebook. I used the test submission and it seems to be working fine. I am not sure what the issue is with my submission.\n\nHere is my attempt to submit:\n\n```python\nfor (test, sample_submission) in iter_test:\n    #change the test dataframe into the feature engineering dataframe\n    df = feature_engineer(test)\n    #send through predict function which create a dataframe with the session_id attached with question number, and 0 or 1\n    predict(df,sample_prediction_df)\n    #use that dataframe to add to the prediction\n    env.predict(sample_prediction_df)\n    #reset dataframe for next prediction\n    sample_prediction_df = pd.DataFrame(columns=['session_id', 'correct'])\n```\n\nAlso the predict function I used was written above as:\n```python\n\ndef predict(df, output):    \n    ids = df['session_id'].unique()\n    tmp = df.loc[df['level_group'] == '0-4']\n    if not tmp.empty:\n        tmp.pop('level_group')\n        for j in range(3):\n            new_row = {'session_id': str(ids[0]) + f'_q{j + 1}', 'correct': str(models[j].predict(tmp)).strip('[]')}\n            output.loc[len(output)] = new_row\n    tmp = df.loc[df['level_group'] == '5-12']\n    if not tmp.empty:\n        tmp.pop('level_group')\n        for j in range (3,13):\n            new_row = {'session_id': str(ids[0]) + f'_q{j + 1}', 'correct': str(models[j].predict(tmp)).strip('[]')}\n            output.loc[len(output)] = new_row\n    tmp = df.loc[df['level_group'] == '13-22']\n    if not tmp.empty:\n        tmp.pop('level_group')\n        for j in range (13,18):\n            new_row = {'session_id': str(ids[0]) + f'_q{j + 1}', 'correct': str(models[j].predict(tmp)).strip('[]')}\n            output.loc[len(output)] = new_row\n```"
    }
  ],
  "comments": [],
  "raw_markdown_by_id": {
    "2255909": "I am getting Notebook Threw Exception when submitting my notebook. I used the test submission and it seems to be working fine. I am not sure what the issue is with my submission.\n\nHere is my attempt to submit:\n\n```python\nfor (test, sample_submission) in iter_test:\n    #change the test dataframe into the feature engineering dataframe\n    df = feature_engineer(test)\n    #send through predict function which create a dataframe with the session_id attached with question number, and 0 or 1\n    predict(df,sample_prediction_df)\n    #use that dataframe to add to the prediction\n    env.predict(sample_prediction_df)\n    #reset dataframe for next prediction\n    sample_prediction_df = pd.DataFrame(columns=['session_id', 'correct'])\n```\n\nAlso the predict function I used was written above as:\n```python\n\ndef predict(df, output):    \n    ids = df['session_id'].unique()\n    tmp = df.loc[df['level_group'] == '0-4']\n    if not tmp.empty:\n        tmp.pop('level_group')\n        for j in range(3):\n            new_row = {'session_id': str(ids[0]) + f'_q{j + 1}', 'correct': str(models[j].predict(tmp)).strip('[]')}\n            output.loc[len(output)] = new_row\n    tmp = df.loc[df['level_group'] == '5-12']\n    if not tmp.empty:\n        tmp.pop('level_group')\n        for j in range (3,13):\n            new_row = {'session_id': str(ids[0]) + f'_q{j + 1}', 'correct': str(models[j].predict(tmp)).strip('[]')}\n            output.loc[len(output)] = new_row\n    tmp = df.loc[df['level_group'] == '13-22']\n    if not tmp.empty:\n        tmp.pop('level_group')\n        for j in range (13,18):\n            new_row = {'session_id': str(ids[0]) + f'_q{j + 1}', 'correct': str(models[j].predict(tmp)).strip('[]')}\n            output.loc[len(output)] = new_row\n```"
  }
}