{
  "id": 203139,
  "title": "No More Submission Scoring Error",
  "url": "/competitions/riiid-test-answer-prediction/discussion/203139",
  "author_name": "James Thompson",
  "post_date": "2020-12-13T22:01:40.745000",
  "votes": 2,
  "comment_count": 0,
  "views": 0,
  "content": "<p>I hope you'll forgive another thread on this topic, but I want/need to celebrate getting past 'Submission Scoring Error'.</p>\n<p>For me, there were two problems. </p>\n<ol>\n<li><p>I create an array to hold my features. The first dimension of that array was set to the number of rows in the 'test' dataframe. Then, of course, I removed the lecture rows, leaving the array too big. There are no lecture rows in the example test data given, so it worked fine until I submitted.</p></li>\n<li><p>The results from the prior batch of test data are saved as a list in the first line of the next batch of test data. The line of code you need to add these results, as a column, in the prior dataframe looks like:</p></li>\n</ol>\n<p>this_test['correct'] = [int(a) for a in next_test.iloc[0].p_correct.strip('][').split(', ') if int(a) &gt;= 0]</p>\n<p>Where 'this_test' and 'next_test' are the dataframes from two successive calls to itertest:</p>\n<p>next_test, submit = next(iter_test, (None, None))</p>\n<p>If you are still looking for bugs in a couple hundred lines of code, with an error message that amounts to, \"it failed\", I know your pain. Good luck.</p>",
  "messages": [
    {
      "id": 1111649,
      "postDate": "2020-12-13T22:01:40.747Z",
      "content": "<p>I hope you'll forgive another thread on this topic, but I want/need to celebrate getting past 'Submission Scoring Error'.</p>\n<p>For me, there were two problems. </p>\n<ol>\n<li><p>I create an array to hold my features. The first dimension of that array was set to the number of rows in the 'test' dataframe. Then, of course, I removed the lecture rows, leaving the array too big. There are no lecture rows in the example test data given, so it worked fine until I submitted.</p></li>\n<li><p>The results from the prior batch of test data are saved as a list in the first line of the next batch of test data. The line of code you need to add these results, as a column, in the prior dataframe looks like:</p></li>\n</ol>\n<p>this_test['correct'] = [int(a) for a in next_test.iloc[0].p_correct.strip('][').split(', ') if int(a) &gt;= 0]</p>\n<p>Where 'this_test' and 'next_test' are the dataframes from two successive calls to itertest:</p>\n<p>next_test, submit = next(iter_test, (None, None))</p>\n<p>If you are still looking for bugs in a couple hundred lines of code, with an error message that amounts to, \"it failed\", I know your pain. Good luck.</p>",
      "rawMarkdown": "I hope you'll forgive another thread on this topic, but I want/need to celebrate getting past 'Submission Scoring Error'.\n\nFor me, there were two problems. \n\n1. I create an array to hold my features. The first dimension of that array was set to the number of rows in the 'test' dataframe. Then, of course, I removed the lecture rows, leaving the array too big. There are no lecture rows in the example test data given, so it worked fine until I submitted.\n\n2. The results from the prior batch of test data are saved as a list in the first line of the next batch of test data. The line of code you need to add these results, as a column, in the prior dataframe looks like:\n\nthis_test['correct'] = [int(a) for a in next_test.iloc[0].p_correct.strip('][').split(', ') if int(a) >= 0]\n\nWhere 'this_test' and 'next_test' are the dataframes from two successive calls to itertest:\n\nnext_test, submit = next(iter_test, (None, None))\n\nIf you are still looking for bugs in a couple hundred lines of code, with an error message that amounts to, \"it failed\", I know your pain. Good luck.",
      "votes": 2
    }
  ],
  "comments": [],
  "raw_markdown_by_id": {
    "1111649": "I hope you'll forgive another thread on this topic, but I want/need to celebrate getting past 'Submission Scoring Error'.\n\nFor me, there were two problems. \n\n1. I create an array to hold my features. The first dimension of that array was set to the number of rows in the 'test' dataframe. Then, of course, I removed the lecture rows, leaving the array too big. There are no lecture rows in the example test data given, so it worked fine until I submitted.\n\n2. The results from the prior batch of test data are saved as a list in the first line of the next batch of test data. The line of code you need to add these results, as a column, in the prior dataframe looks like:\n\nthis_test['correct'] = [int(a) for a in next_test.iloc[0].p_correct.strip('][').split(', ') if int(a) >= 0]\n\nWhere 'this_test' and 'next_test' are the dataframes from two successive calls to itertest:\n\nnext_test, submit = next(iter_test, (None, None))\n\nIf you are still looking for bugs in a couple hundred lines of code, with an error message that amounts to, \"it failed\", I know your pain. Good luck."
  }
}