{
  "id": 251735,
  "title": "Notebook Threw Exception",
  "url": "/competitions/mlb-player-digital-engagement-forecasting/discussion/251735",
  "author_name": "",
  "post_date": "2021-07-08T14:48:05.952180300Z",
  "votes": null,
  "comment_count": 5,
  "views": 0,
  "content": "<p>I am receiving the error Notebook Threw Exception. .The whole pipeline works fine and I can do prediction in public test set.When, I am submitting for hidden test set and within 60 seconds I get the error. .It only takes a minute to read all the csv files. Any suggestions will help.!! All external dataset used are public.</p>\n<h1>submission code : -</h1>\n<p>import mlb</p>\n<p>env = mlb.make_env() # initialize the environment<br>\niter_test = env.iter_test() # iterator which loops over each date in test set</p>\n<p>testt=[];subb=[];box=[]<br>\nfor (test_df, sample_prediction_df) in (iter_test): </p>\n<pre><code>    sample_prediction_df = sample_prediction_df.reset_index(drop=True)\n     sample_prediction_df['playerId'] = sample_prediction_df['date_playerId'].map(lambda x: nt(x.split('_')[1]))  \n     merger=sample_prediction_df['date_playerId'].values\n     yr=str(merger[0]).split('_')[0][:4]\n\n\ntest_data = sample_prediction_df[['playerId']].copy()\ntest_data['date_playerId']=sample_prediction_df['date_playerId'].values\ntest_data['merger']=[str(val)+'_'+str(yr) for val in test_data['playerId'].values]\nsample_prediction_df.drop(columns=target_cols,inplace=True)\ntest_data=test_data.merge(player_target_stats,on='playerId',how='left')\ntest_data=test_data.merge(stats_data,on='merger',how='left')\n\ncols2_drop=[ 'merger','playerId','date_playerId']\ntest_data = test_data.fillna(0.) \n\npred=model.predict(test_data.drop(columns=cols2_drop))\n\nsample_prediction_df['target1'] = np.clip(pred[:,0], 0, 100)\nsample_prediction_df['target2'] = np.clip(pred[:,1], 0, 100)\nsample_prediction_df['target3'] = np.clip(pred[:,2], 0, 100)\nsample_prediction_df['target4'] = np.clip(pred[:,3], 0, 100)\n\n   del sample_prediction_df['playerId']\nsample_prediction_df = sample_prediction_df.fillna(0.)\nenv.predict(sample_prediction_df)\n</code></pre>",
  "messages": [
    {
      "id": "1381032",
      "postDate": "07/08/2021 14:48:05",
      "content": "<p>I am receiving the error Notebook Threw Exception. .The whole pipeline works fine and I can do prediction in public test set.When, I am submitting for hidden test set and within 60 seconds I get the error. .It only takes a minute to read all the csv files. Any suggestions will help.!! All external dataset used are public.</p>\n<h1>submission code : -</h1>\n<p>import mlb</p>\n<p>env = mlb.make_env() # initialize the environment<br>\niter_test = env.iter_test() # iterator which loops over each date in test set</p>\n<p>testt=[];subb=[];box=[]<br>\nfor (test_df, sample_prediction_df) in (iter_test): </p>\n<pre><code>    sample_prediction_df = sample_prediction_df.reset_index(drop=True)\n     sample_prediction_df['playerId'] = sample_prediction_df['date_playerId'].map(lambda x: nt(x.split('_')[1]))  \n     merger=sample_prediction_df['date_playerId'].values\n     yr=str(merger[0]).split('_')[0][:4]\n\n\ntest_data = sample_prediction_df[['playerId']].copy()\ntest_data['date_playerId']=sample_prediction_df['date_playerId'].values\ntest_data['merger']=[str(val)+'_'+str(yr) for val in test_data['playerId'].values]\nsample_prediction_df.drop(columns=target_cols,inplace=True)\ntest_data=test_data.merge(player_target_stats,on='playerId',how='left')\ntest_data=test_data.merge(stats_data,on='merger',how='left')\n\ncols2_drop=[ 'merger','playerId','date_playerId']\ntest_data = test_data.fillna(0.) \n\npred=model.predict(test_data.drop(columns=cols2_drop))\n\nsample_prediction_df['target1'] = np.clip(pred[:,0], 0, 100)\nsample_prediction_df['target2'] = np.clip(pred[:,1], 0, 100)\nsample_prediction_df['target3'] = np.clip(pred[:,2], 0, 100)\nsample_prediction_df['target4'] = np.clip(pred[:,3], 0, 100)\n\n   del sample_prediction_df['playerId']\nsample_prediction_df = sample_prediction_df.fillna(0.)\nenv.predict(sample_prediction_df)\n</code></pre>",
      "rawMarkdown": "I am receiving the error Notebook Threw Exception. .The whole pipeline works fine and I can do prediction in public test set.When, I am submitting for hidden test set and within 60 seconds I get the error. .It only takes a minute to read all the csv files. Any suggestions will help.!! All external dataset used are public.\n\n#submission code : -\n\nimport mlb\n\nenv = mlb.make_env() # initialize the environment\niter_test = env.iter_test() # iterator which loops over each date in test set\n\ntestt=[];subb=[];box=[]\nfor (test_df, sample_prediction_df) in (iter_test): \n\n        sample_prediction_df = sample_prediction_df.reset_index(drop=True)\n         sample_prediction_df['playerId'] = sample_prediction_df['date_playerId'].map(lambda x: nt(x.split('_')[1]))  \n         merger=sample_prediction_df['date_playerId'].values\n         yr=str(merger[0]).split('_')[0][:4]\n    \n   \n    test_data = sample_prediction_df[['playerId']].copy()\n    test_data['date_playerId']=sample_prediction_df['date_playerId'].values\n    test_data['merger']=[str(val)+'_'+str(yr) for val in test_data['playerId'].values]\n    sample_prediction_df.drop(columns=target_cols,inplace=True)\n    test_data=test_data.merge(player_target_stats,on='playerId',how='left')\n    test_data=test_data.merge(stats_data,on='merger',how='left')\n\n    cols2_drop=[ 'merger','playerId','date_playerId']\n    test_data = test_data.fillna(0.) \n    \n    pred=model.predict(test_data.drop(columns=cols2_drop))\n\n    sample_prediction_df['target1'] = np.clip(pred[:,0], 0, 100)\n    sample_prediction_df['target2'] = np.clip(pred[:,1], 0, 100)\n    sample_prediction_df['target3'] = np.clip(pred[:,2], 0, 100)\n    sample_prediction_df['target4'] = np.clip(pred[:,3], 0, 100)\n   \n       del sample_prediction_df['playerId']\n    sample_prediction_df = sample_prediction_df.fillna(0.)\n    env.predict(sample_prediction_df)",
      "votes": null
    },
    {
      "id": "1381306",
      "postDate": "07/08/2021 20:51:56",
      "content": "<p>If 60 seconds - are you reaching the predict cell that fast - put a couple of timer prints in your script.  Run the script in the kernel.  Note the the time marks - than save/submit - again note the time marks.</p>\n<p>Now when you make the submission - use stop watch so your sure that the crash timing.  </p>\n<p>If truly a minute I wonder if the crash is earlier than the submit section?</p>",
      "rawMarkdown": "If 60 seconds - are you reaching the predict cell that fast - put a couple of timer prints in your script.  Run the script in the kernel.  Note the the time marks - than save/submit - again note the time marks.\n\nNow when you make the submission - use stop watch so your sure that the crash timing.  \n\nIf truly a minute I wonder if the crash is earlier than the submit section?",
      "votes": null
    },
    {
      "id": "1382518",
      "postDate": "07/10/2021 01:05:11",
      "content": "<p>PS  my crashes 1224 seconds in -  ahhhhhhhhhhhhhhhhhh</p>",
      "rawMarkdown": "PS  my crashes 1224 seconds in -  ahhhhhhhhhhhhhhhhhh",
      "votes": null
    },
    {
      "id": "1385373",
      "postDate": "07/12/2021 16:35:29",
      "content": "<p>No I wasnt reaching my predict cell that fast. Thats what got me worried. I never figured out the problem. Then I forked a successful submission</p>",
      "rawMarkdown": "No I wasnt reaching my predict cell that fast. Thats what got me worried. I never figured out the problem. Then I forked a successful submission",
      "votes": null
    },
    {
      "id": "1390089",
      "postDate": "07/16/2021 10:49:48",
      "content": "<p>I have the same problem, Have you solved it ? and how ?</p>",
      "rawMarkdown": "I have the same problem, Have you solved it ? and how ?",
      "votes": null
    },
    {
      "id": "1390868",
      "postDate": "07/17/2021 06:17:14",
      "content": "<p>I edited a running public kernel.</p>",
      "rawMarkdown": "I edited a running public kernel.",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 1381306,
      "author_name": "pcjimmmy",
      "author_url": "",
      "post_date": "07/08/2021 20:51:56",
      "content": "<p>If 60 seconds - are you reaching the predict cell that fast - put a couple of timer prints in your script.  Run the script in the kernel.  Note the the time marks - than save/submit - again note the time marks.</p>\n<p>Now when you make the submission - use stop watch so your sure that the crash timing.  </p>\n<p>If truly a minute I wonder if the crash is earlier than the submit section?</p>",
      "votes": null,
      "replies": [
        {
          "id": 1382518,
          "author_name": "pcjimmmy",
          "author_url": "",
          "post_date": "07/10/2021 01:05:11",
          "content": "<p>PS  my crashes 1224 seconds in -  ahhhhhhhhhhhhhhhhhh</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 1385373,
          "author_name": "debojit23",
          "author_url": "",
          "post_date": "07/12/2021 16:35:29",
          "content": "<p>No I wasnt reaching my predict cell that fast. Thats what got me worried. I never figured out the problem. Then I forked a successful submission</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 1390089,
      "author_name": "omarmohamedhamed",
      "author_url": "",
      "post_date": "07/16/2021 10:49:48",
      "content": "<p>I have the same problem, Have you solved it ? and how ?</p>",
      "votes": null,
      "replies": [
        {
          "id": 1390868,
          "author_name": "debojit23",
          "author_url": "",
          "post_date": "07/17/2021 06:17:14",
          "content": "<p>I edited a running public kernel.</p>",
          "votes": null,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "1381032": "I am receiving the error Notebook Threw Exception. .The whole pipeline works fine and I can do prediction in public test set.When, I am submitting for hidden test set and within 60 seconds I get the error. .It only takes a minute to read all the csv files. Any suggestions will help.!! All external dataset used are public.\n\n#submission code : -\n\nimport mlb\n\nenv = mlb.make_env() # initialize the environment\niter_test = env.iter_test() # iterator which loops over each date in test set\n\ntestt=[];subb=[];box=[]\nfor (test_df, sample_prediction_df) in (iter_test): \n\n        sample_prediction_df = sample_prediction_df.reset_index(drop=True)\n         sample_prediction_df['playerId'] = sample_prediction_df['date_playerId'].map(lambda x: nt(x.split('_')[1]))  \n         merger=sample_prediction_df['date_playerId'].values\n         yr=str(merger[0]).split('_')[0][:4]\n    \n   \n    test_data = sample_prediction_df[['playerId']].copy()\n    test_data['date_playerId']=sample_prediction_df['date_playerId'].values\n    test_data['merger']=[str(val)+'_'+str(yr) for val in test_data['playerId'].values]\n    sample_prediction_df.drop(columns=target_cols,inplace=True)\n    test_data=test_data.merge(player_target_stats,on='playerId',how='left')\n    test_data=test_data.merge(stats_data,on='merger',how='left')\n\n    cols2_drop=[ 'merger','playerId','date_playerId']\n    test_data = test_data.fillna(0.) \n    \n    pred=model.predict(test_data.drop(columns=cols2_drop))\n\n    sample_prediction_df['target1'] = np.clip(pred[:,0], 0, 100)\n    sample_prediction_df['target2'] = np.clip(pred[:,1], 0, 100)\n    sample_prediction_df['target3'] = np.clip(pred[:,2], 0, 100)\n    sample_prediction_df['target4'] = np.clip(pred[:,3], 0, 100)\n   \n       del sample_prediction_df['playerId']\n    sample_prediction_df = sample_prediction_df.fillna(0.)\n    env.predict(sample_prediction_df)",
    "1381306": "If 60 seconds - are you reaching the predict cell that fast - put a couple of timer prints in your script.  Run the script in the kernel.  Note the the time marks - than save/submit - again note the time marks.\n\nNow when you make the submission - use stop watch so your sure that the crash timing.  \n\nIf truly a minute I wonder if the crash is earlier than the submit section?",
    "1382518": "PS  my crashes 1224 seconds in -  ahhhhhhhhhhhhhhhhhh",
    "1385373": "No I wasnt reaching my predict cell that fast. Thats what got me worried. I never figured out the problem. Then I forked a successful submission",
    "1390089": "I have the same problem, Have you solved it ? and how ?",
    "1390868": "I edited a running public kernel."
  },
  "source": "meta"
}