{
  "id": 253406,
  "title": "Notebook Threw Exception after submission!",
  "url": "/competitions/mlb-player-digital-engagement-forecasting/discussion/253406",
  "author_name": "",
  "post_date": "2021-07-16T11:31:55.304701900Z",
  "votes": null,
  "comment_count": 6,
  "views": 0,
  "content": "<p>I'm getting Notebook Threw Exception status in the submission process. <br>\nIt drops the error only after 60 seconds!!!!! and I've tried to submit the public test file it drops the same error at the same time!!!!!<br>\nHow can I solve this problem ?</p>\n<p>here is my notebook :<br>\n<a href=\"https://www.kaggle.com/omarmohamedhamed/eda-and-some-important-relationships\" target=\"_blank\">https://www.kaggle.com/omarmohamedhamed/eda-and-some-important-relationships</a></p>",
  "messages": [
    {
      "id": "1390132",
      "postDate": "07/16/2021 11:31:55",
      "content": "<p>I'm getting Notebook Threw Exception status in the submission process. <br>\nIt drops the error only after 60 seconds!!!!! and I've tried to submit the public test file it drops the same error at the same time!!!!!<br>\nHow can I solve this problem ?</p>\n<p>here is my notebook :<br>\n<a href=\"https://www.kaggle.com/omarmohamedhamed/eda-and-some-important-relationships\" target=\"_blank\">https://www.kaggle.com/omarmohamedhamed/eda-and-some-important-relationships</a></p>",
      "rawMarkdown": "I'm getting Notebook Threw Exception status in the submission process. \nIt drops the error only after 60 seconds!!!!! and I've tried to submit the public test file it drops the same error at the same time!!!!!\nHow can I solve this problem ?\n\nhere is my notebook :\nhttps://www.kaggle.com/omarmohamedhamed/eda-and-some-important-relationships",
      "votes": null
    },
    {
      "id": "1390692",
      "postDate": "07/17/2021 01:51:14",
      "content": "<ol>\n<li>Have you tried observing where the error occurs?</li>\n<li>What assumptions did you make about the input?</li>\n<li>What behavior do you intend on each line or block level?</li>\n<li>Can you compose code that you are sure will work, and share it with unnecessary visualization code removed?</li>\n</ol>\n<p>We and I don't want to waste a \"valuable\" submission opportunity by submitting unknown code while we have a certificated data flow, so without providing these information we don't have motivation to debug.</p>",
      "rawMarkdown": "1. Have you tried observing where the error occurs?\n2. What assumptions did you make about the input?\n3. What behavior do you intend on each line or block level?\n4. Can you compose code that you are sure will work, and share it with unnecessary visualization code removed?\n\nWe and I don't want to waste a \"valuable\" submission opportunity by submitting unknown code while we have a certificated data flow, so without providing these information we don't have motivation to debug.",
      "votes": null
    },
    {
      "id": "1391090",
      "postDate": "07/17/2021 09:30:43",
      "content": "<p>After confirming using the training data,<br>\nAn error occurred on a line where some JSON tags were missing.</p>\n<p>I recommend that you use the training data to confirm.</p>\n<p>The following is a sample.</p>\n<hr>\n<pre><code>targets = ['target1','target2','target3','target4']\nBASE_PATH = Path(\"../input/mlb-player-digital-engagement-forecasting\")\n\nclass VirtualMLBEnvironment:\n    def __init__(self, example=True):\n        self.example = example\n\n    def iter_test(self):\n        '''\n        test_df:\n                    &lt;json tag features&gt;\n        date\n        20210426\n\n        pred_df:\n                    date_playerId　&lt;target features&gt;\n        date                                                         \n        20210426  20210427_656669        0        0        0        0\n        20210426  20210427_543475        0        0        0        0\n        '''\n        if self.example:\n            df = pd.read_csv(BASE_PATH / \"example_test.csv\")\n            pred_df = pd.read_csv(BASE_PATH / \"example_sample_submission.csv\")\n        else:\n            OTHER_FILE_PATH2 = Path(\"../input/mlbplayerdigitalengagement-convert-file\")\n            df = pd.read_feather(OTHER_FILE_PATH2 / \"train.feather\", \n                                 columns=['date', \n                                          'games', \n                                          'rosters', \n                                          'playerBoxScores',\n                                          'teamBoxScores', \n                                          'transactions', \n                                          'standings', \n                                          'awards', \n                                          'events', \n                                          'playerTwitterFollowers', \n                                          'teamTwitterFollowers'])\n\n            pred_df = pd.read_csv(OTHER_FILE_PATH2 / \"engagements.csv\", \n                                  usecols=['date', \n                                           'engagementMetricsDate',\n                                           'date_playerId',\n                                           'playerId'])\n            pred_df[targets] = 0\n            pred_df['date'] = (pd.to_datetime(pred_df['engagementMetricsDate']) - pd.to_timedelta('1 days')).astype(str).str.replace('-','').astype(int)\n            pred_df = pred_df[['date','date_playerId']+targets]\n\n        dates = df['date'].tolist()\n        df = df.set_index('date')\n        pred_df = pred_df.set_index('date')\n        for i, d in enumerate(dates):\n            yield df.iloc[[i]], pred_df.loc[pred_df.index==d, :]\n\n    def predict(self, predicted):\n        if self.example:\n            display(predicted.sort_values('date_playerId'))\n\nisdebug = True# &lt;- Please set to False when submitting \nisexample = False#True\n\nif isdebug:\n    env = VirtualMLBEnvironment(example=isexample)\n    iter_test = env.iter_test()\nelse:\n    if 'kaggle_secrets' in sys.modules:  # only run while on Kaggle\n        import mlb\n\nfor (test_df, sample_prediction_df) in iter_test:\n</code></pre>",
      "rawMarkdown": "After confirming using the training data,\nAn error occurred on a line where some JSON tags were missing.\n\nI recommend that you use the training data to confirm.\n\nThe following is a sample.\n\n-----------------------------------\n```\ntargets = ['target1','target2','target3','target4']\nBASE_PATH = Path(\"../input/mlb-player-digital-engagement-forecasting\")\n\nclass VirtualMLBEnvironment:\n    def __init__(self, example=True):\n        self.example = example\n\n    def iter_test(self):\n        '''\n        test_df:\n                    <json tag features>\n        date\n        20210426\n\n        pred_df:\n                    date_playerId　<target features>\n        date                                                         \n        20210426  20210427_656669        0        0        0        0\n        20210426  20210427_543475        0        0        0        0\n        '''\n        if self.example:\n            df = pd.read_csv(BASE_PATH / \"example_test.csv\")\n            pred_df = pd.read_csv(BASE_PATH / \"example_sample_submission.csv\")\n        else:\n            OTHER_FILE_PATH2 = Path(\"../input/mlbplayerdigitalengagement-convert-file\")\n            df = pd.read_feather(OTHER_FILE_PATH2 / \"train.feather\", \n                                 columns=['date', \n                                          'games', \n                                          'rosters', \n                                          'playerBoxScores',\n                                          'teamBoxScores', \n                                          'transactions', \n                                          'standings', \n                                          'awards', \n                                          'events', \n                                          'playerTwitterFollowers', \n                                          'teamTwitterFollowers'])\n\n            pred_df = pd.read_csv(OTHER_FILE_PATH2 / \"engagements.csv\", \n                                  usecols=['date', \n                                           'engagementMetricsDate',\n                                           'date_playerId',\n                                           'playerId'])\n            pred_df[targets] = 0\n            pred_df['date'] = (pd.to_datetime(pred_df['engagementMetricsDate']) - pd.to_timedelta('1 days')).astype(str).str.replace('-','').astype(int)\n            pred_df = pred_df[['date','date_playerId']+targets]\n\n        dates = df['date'].tolist()\n        df = df.set_index('date')\n        pred_df = pred_df.set_index('date')\n        for i, d in enumerate(dates):\n            yield df.iloc[[i]], pred_df.loc[pred_df.index==d, :]\n\n    def predict(self, predicted):\n        if self.example:\n            display(predicted.sort_values('date_playerId'))\n            \nisdebug = True# <- Please set to False when submitting \nisexample = False#True\n\nif isdebug:\n    env = VirtualMLBEnvironment(example=isexample)\n    iter_test = env.iter_test()\nelse:\n    if 'kaggle_secrets' in sys.modules:  # only run while on Kaggle\n        import mlb\n\nfor (test_df, sample_prediction_df) in iter_test:\n\n```",
      "votes": null
    },
    {
      "id": "1391237",
      "postDate": "07/17/2021 12:15:40",
      "content": "<p>Try to not load example_test.csv and example_sample_submission.csv</p>",
      "rawMarkdown": "Try to not load example_test.csv and example_sample_submission.csv",
      "votes": null
    },
    {
      "id": "1391318",
      "postDate": "07/17/2021 13:43:31",
      "content": "<p>Thanks very much<br>\nThis solved the problem</p>",
      "rawMarkdown": "Thanks very much\nThis solved the problem",
      "votes": null
    },
    {
      "id": "1391322",
      "postDate": "07/17/2021 13:45:13",
      "content": "<p>Thanks very much<br>\nI solved it by not loading example_test.csv and example_sample_submission.csv files.</p>",
      "rawMarkdown": "Thanks very much\nI solved it by not loading example_test.csv and example_sample_submission.csv files.",
      "votes": null
    },
    {
      "id": "1391325",
      "postDate": "07/17/2021 13:46:24",
      "content": "<p>Thanks very much you are right but I solved it by not loading example_test.csv and example_sample_submission.csv files and I don't know how </p>",
      "rawMarkdown": "Thanks very much you are right but I solved it by not loading example_test.csv and example_sample_submission.csv files and I don't know how",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 1390692,
      "author_name": "assign",
      "author_url": "",
      "post_date": "07/17/2021 01:51:14",
      "content": "<ol>\n<li>Have you tried observing where the error occurs?</li>\n<li>What assumptions did you make about the input?</li>\n<li>What behavior do you intend on each line or block level?</li>\n<li>Can you compose code that you are sure will work, and share it with unnecessary visualization code removed?</li>\n</ol>\n<p>We and I don't want to waste a \"valuable\" submission opportunity by submitting unknown code while we have a certificated data flow, so without providing these information we don't have motivation to debug.</p>",
      "votes": null,
      "replies": [
        {
          "id": 1391325,
          "author_name": "omarmohamedhamed",
          "author_url": "",
          "post_date": "07/17/2021 13:46:24",
          "content": "<p>Thanks very much you are right but I solved it by not loading example_test.csv and example_sample_submission.csv files and I don't know how </p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 1391090,
      "author_name": "horohoro",
      "author_url": "",
      "post_date": "07/17/2021 09:30:43",
      "content": "<p>After confirming using the training data,<br>\nAn error occurred on a line where some JSON tags were missing.</p>\n<p>I recommend that you use the training data to confirm.</p>\n<p>The following is a sample.</p>\n<hr>\n<pre><code>targets = ['target1','target2','target3','target4']\nBASE_PATH = Path(\"../input/mlb-player-digital-engagement-forecasting\")\n\nclass VirtualMLBEnvironment:\n    def __init__(self, example=True):\n        self.example = example\n\n    def iter_test(self):\n        '''\n        test_df:\n                    &lt;json tag features&gt;\n        date\n        20210426\n\n        pred_df:\n                    date_playerId　&lt;target features&gt;\n        date                                                         \n        20210426  20210427_656669        0        0        0        0\n        20210426  20210427_543475        0        0        0        0\n        '''\n        if self.example:\n            df = pd.read_csv(BASE_PATH / \"example_test.csv\")\n            pred_df = pd.read_csv(BASE_PATH / \"example_sample_submission.csv\")\n        else:\n            OTHER_FILE_PATH2 = Path(\"../input/mlbplayerdigitalengagement-convert-file\")\n            df = pd.read_feather(OTHER_FILE_PATH2 / \"train.feather\", \n                                 columns=['date', \n                                          'games', \n                                          'rosters', \n                                          'playerBoxScores',\n                                          'teamBoxScores', \n                                          'transactions', \n                                          'standings', \n                                          'awards', \n                                          'events', \n                                          'playerTwitterFollowers', \n                                          'teamTwitterFollowers'])\n\n            pred_df = pd.read_csv(OTHER_FILE_PATH2 / \"engagements.csv\", \n                                  usecols=['date', \n                                           'engagementMetricsDate',\n                                           'date_playerId',\n                                           'playerId'])\n            pred_df[targets] = 0\n            pred_df['date'] = (pd.to_datetime(pred_df['engagementMetricsDate']) - pd.to_timedelta('1 days')).astype(str).str.replace('-','').astype(int)\n            pred_df = pred_df[['date','date_playerId']+targets]\n\n        dates = df['date'].tolist()\n        df = df.set_index('date')\n        pred_df = pred_df.set_index('date')\n        for i, d in enumerate(dates):\n            yield df.iloc[[i]], pred_df.loc[pred_df.index==d, :]\n\n    def predict(self, predicted):\n        if self.example:\n            display(predicted.sort_values('date_playerId'))\n\nisdebug = True# &lt;- Please set to False when submitting \nisexample = False#True\n\nif isdebug:\n    env = VirtualMLBEnvironment(example=isexample)\n    iter_test = env.iter_test()\nelse:\n    if 'kaggle_secrets' in sys.modules:  # only run while on Kaggle\n        import mlb\n\nfor (test_df, sample_prediction_df) in iter_test:\n</code></pre>",
      "votes": null,
      "replies": [
        {
          "id": 1391322,
          "author_name": "omarmohamedhamed",
          "author_url": "",
          "post_date": "07/17/2021 13:45:13",
          "content": "<p>Thanks very much<br>\nI solved it by not loading example_test.csv and example_sample_submission.csv files.</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 1391237,
      "author_name": "philiplam",
      "author_url": "",
      "post_date": "07/17/2021 12:15:40",
      "content": "<p>Try to not load example_test.csv and example_sample_submission.csv</p>",
      "votes": null,
      "replies": [
        {
          "id": 1391318,
          "author_name": "omarmohamedhamed",
          "author_url": "",
          "post_date": "07/17/2021 13:43:31",
          "content": "<p>Thanks very much<br>\nThis solved the problem</p>",
          "votes": null,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "1390132": "I'm getting Notebook Threw Exception status in the submission process. \nIt drops the error only after 60 seconds!!!!! and I've tried to submit the public test file it drops the same error at the same time!!!!!\nHow can I solve this problem ?\n\nhere is my notebook :\nhttps://www.kaggle.com/omarmohamedhamed/eda-and-some-important-relationships",
    "1390692": "1. Have you tried observing where the error occurs?\n2. What assumptions did you make about the input?\n3. What behavior do you intend on each line or block level?\n4. Can you compose code that you are sure will work, and share it with unnecessary visualization code removed?\n\nWe and I don't want to waste a \"valuable\" submission opportunity by submitting unknown code while we have a certificated data flow, so without providing these information we don't have motivation to debug.",
    "1391090": "After confirming using the training data,\nAn error occurred on a line where some JSON tags were missing.\n\nI recommend that you use the training data to confirm.\n\nThe following is a sample.\n\n-----------------------------------\n```\ntargets = ['target1','target2','target3','target4']\nBASE_PATH = Path(\"../input/mlb-player-digital-engagement-forecasting\")\n\nclass VirtualMLBEnvironment:\n    def __init__(self, example=True):\n        self.example = example\n\n    def iter_test(self):\n        '''\n        test_df:\n                    <json tag features>\n        date\n        20210426\n\n        pred_df:\n                    date_playerId　<target features>\n        date                                                         \n        20210426  20210427_656669        0        0        0        0\n        20210426  20210427_543475        0        0        0        0\n        '''\n        if self.example:\n            df = pd.read_csv(BASE_PATH / \"example_test.csv\")\n            pred_df = pd.read_csv(BASE_PATH / \"example_sample_submission.csv\")\n        else:\n            OTHER_FILE_PATH2 = Path(\"../input/mlbplayerdigitalengagement-convert-file\")\n            df = pd.read_feather(OTHER_FILE_PATH2 / \"train.feather\", \n                                 columns=['date', \n                                          'games', \n                                          'rosters', \n                                          'playerBoxScores',\n                                          'teamBoxScores', \n                                          'transactions', \n                                          'standings', \n                                          'awards', \n                                          'events', \n                                          'playerTwitterFollowers', \n                                          'teamTwitterFollowers'])\n\n            pred_df = pd.read_csv(OTHER_FILE_PATH2 / \"engagements.csv\", \n                                  usecols=['date', \n                                           'engagementMetricsDate',\n                                           'date_playerId',\n                                           'playerId'])\n            pred_df[targets] = 0\n            pred_df['date'] = (pd.to_datetime(pred_df['engagementMetricsDate']) - pd.to_timedelta('1 days')).astype(str).str.replace('-','').astype(int)\n            pred_df = pred_df[['date','date_playerId']+targets]\n\n        dates = df['date'].tolist()\n        df = df.set_index('date')\n        pred_df = pred_df.set_index('date')\n        for i, d in enumerate(dates):\n            yield df.iloc[[i]], pred_df.loc[pred_df.index==d, :]\n\n    def predict(self, predicted):\n        if self.example:\n            display(predicted.sort_values('date_playerId'))\n            \nisdebug = True# <- Please set to False when submitting \nisexample = False#True\n\nif isdebug:\n    env = VirtualMLBEnvironment(example=isexample)\n    iter_test = env.iter_test()\nelse:\n    if 'kaggle_secrets' in sys.modules:  # only run while on Kaggle\n        import mlb\n\nfor (test_df, sample_prediction_df) in iter_test:\n\n```",
    "1391237": "Try to not load example_test.csv and example_sample_submission.csv",
    "1391318": "Thanks very much\nThis solved the problem",
    "1391322": "Thanks very much\nI solved it by not loading example_test.csv and example_sample_submission.csv files.",
    "1391325": "Thanks very much you are right but I solved it by not loading example_test.csv and example_sample_submission.csv files and I don't know how"
  },
  "source": "meta"
}