{
  "id": 412428,
  "title": "Question on Submission Scoring Error",
  "url": "/competitions/benetech-making-graphs-accessible/discussion/412428",
  "author_name": "moth",
  "post_date": "2023-05-23T17:24:44.538000",
  "votes": 4,
  "comment_count": 25,
  "views": 0,
  "content": "<p>When making a submission does the scoring function split the dataseries by <code>;</code> and then tries to convert the tokens to floats? I have been getting scoring errors and cant quite figure out the reason. I have some data series which have commas inside as well as <code>nan</code> characters. </p>\n<ul>\n<li><code>19;12;12;2;3;5;0;2;0;0;0;1;0;nan</code></li>\n<li><code>\" April 1, 2012;Aug. 14, 2013;Dec. 27, 2014;May 10, 2016\"</code></li>\n<li><code>04.05.2015;04.06.2015;04.07.2015;04.08.2015;04.09.2016;04.10.2015;04.11.2015;04.12.2015</code> dates separated by point</li>\n</ul>\n<p><a href=\"https://www.kaggle.com/ryanholbrook\" target=\"_blank\">@ryanholbrook</a> </p>",
  "messages": [
    {
      "id": 2271201,
      "postDate": "2023-05-23T17:24:44.540Z",
      "content": "<p>When making a submission does the scoring function split the dataseries by <code>;</code> and then tries to convert the tokens to floats? I have been getting scoring errors and cant quite figure out the reason. I have some data series which have commas inside as well as <code>nan</code> characters. </p>\n<ul>\n<li><code>19;12;12;2;3;5;0;2;0;0;0;1;0;nan</code></li>\n<li><code>\" April 1, 2012;Aug. 14, 2013;Dec. 27, 2014;May 10, 2016\"</code></li>\n<li><code>04.05.2015;04.06.2015;04.07.2015;04.08.2015;04.09.2016;04.10.2015;04.11.2015;04.12.2015</code> dates separated by point</li>\n</ul>\n<p><a href=\"https://www.kaggle.com/ryanholbrook\" target=\"_blank\">@ryanholbrook</a> </p>",
      "rawMarkdown": "When making a submission does the scoring function split the dataseries by `;` and then tries to convert the tokens to floats? I have been getting scoring errors and cant quite figure out the reason. I have some data series which have commas inside as well as `nan` characters. \n- `19;12;12;2;3;5;0;2;0;0;0;1;0;nan`\n- `\" April 1, 2012;Aug. 14, 2013;Dec. 27, 2014;May 10, 2016\"`\n- `04.05.2015;04.06.2015;04.07.2015;04.08.2015;04.09.2016;04.10.2015;04.11.2015;04.12.2015` dates separated by point\n\n@ryanholbrook ",
      "votes": 4
    },
    {
      "id": 2290534,
      "postDate": "2023-06-06T23:14:02.943Z",
      "content": "<p>Another error I have seen is <code>\\r\\n</code> in string predictions. You can clean those predictions with something like this.</p>\n<pre><code>def remove_newlines(val):\n    val  val.replace(, ).replace(, ).replace(, ).replace(, )\n     val\n</code></pre>",
      "rawMarkdown": "Another error I have seen is `\\r\\n` in string predictions. You can clean those predictions with something like this.\n\n```\ndef remove_newlines(val):\n    val = val.replace(\"\\r\\n\\r\\n\", \" \").replace(\"\\r\\n\", \" \").replace(\"\\r\", \"\").replace(\"\\n\", \"\")\n    return val\n```",
      "votes": 1
    },
    {
      "id": 2272987,
      "postDate": "2023-05-24T23:34:26.360Z",
      "content": "<p><a href=\"https://www.kaggle.com/ryanholbrook\" target=\"_blank\">@ryanholbrook</a> it seems it isn’t due to nans or inf values? Are you able to help?</p>",
      "rawMarkdown": "@ryanholbrook it seems it isn’t due to nans or inf values? Are you able to help?",
      "votes": 1
    },
    {
      "id": 2275028,
      "postDate": "2023-05-26T12:48:45.347Z",
      "content": "<p>Hi <a href=\"https://www.kaggle.com/alejopaullier\" target=\"_blank\">@alejopaullier</a>, The error I'm seeing is that your submission has an incorrect number of rows. You might try building off the sample submission in the hidden test set to make sure you're getting a complete set of ids and not dropping anything due to missing values.</p>",
      "rawMarkdown": "Hi @alejopaullier, The error I'm seeing is that your submission has an incorrect number of rows. You might try building off the sample submission in the hidden test set to make sure you're getting a complete set of ids and not dropping anything due to missing values.",
      "votes": 2,
      "replies": [
        {
          "id": 2275080,
          "postDate": "2023-05-26T13:25:22.540Z",
          "content": "<p>Thanks Ryan!</p>",
          "rawMarkdown": "Thanks Ryan!",
          "votes": 1
        },
        {
          "id": 2275151,
          "postDate": "2023-05-26T14:41:12.100Z",
          "rawMarkdown": "",
          "isDeleted": true
        },
        {
          "id": 2280298,
          "postDate": "2023-05-30T03:22:50.820Z",
          "rawMarkdown": "",
          "isDeleted": true
        }
      ]
    },
    {
      "id": 2274649,
      "postDate": "2023-05-26T07:01:26.527Z",
      "content": "<p>I have done some experimentation and I really don't know why the Scoring Error is occurring.<br>\nConsidering the possibility that there are values mixed in with the data_series that cause the error, I called the following function at the end of the submit note,<br>\nI converted all values that can be converted to numbers to 0 and all values that cannot be converted to numbers to 'a'.</p>\n<pre><code>def is_inf_or_nan(s):\n    try:\n        n = float(s)\n        return True\n    except:\n        return False\n\ndef replace_nan_inf(df, replace_str=\"0\"):\n    data_series_list = df[\"data_series\"].values\n    replaced_data_series_list = []\n    for data_series in data_series_list:\n        splited_data_series = data_series.split(\";\")\n        replaced_data_series = \";\".join([replace_str if is_inf_or_nan(s) else \"a\" for s in splited_data_series])\n        replaced_data_series_list.append(replaced_data_series)\n    _df = df.copy()\n    _df[\"data_series\"] = replaced_data_series_list\n    return _df\n\ndf = pd.read_csv(\"/kaggle/working/submission.csv\")\ndf = replace_nan_inf(df)\ndf.to_csv(\"/kaggle/working/submission.csv\", index=False)\n</code></pre>\n<p>The results are converted as expected as shown below.</p>\n<pre><code>id     data_series     chart_type\n0     000b92c3b098_x  0;0;0;0;0   line\n1     01b45b831589_x  a;a;a;a;a;a;a;a;a;a;a;a;a;a;a;a;a;a;a   vertical_bar\n2     00f5404753cf_x  0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0     scatter\n3     00dcf883a459_x  a;a     vertical_bar\n4     007a18eb4e09_x  0;0;0;0;0;0;0   line\n5     000b92c3b098_y  0;0;0;0;0   line\n6     01b45b831589_y  0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0   vertical_bar\n7     00f5404753cf_y  0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0     scatter\n8     00dcf883a459_y  0;0     vertical_bar\n9     007a18eb4e09_y  0;0;0;0;0;0;0   line\n</code></pre>\n<p>However, even in this state, I get a Scoring Error.<br>\nSince any value should always be 0 or 'a', we cannot assume that inf or nan is the cause.</p>\n<p>Also, considering the possibility that something other than data_series is causing the problem,<br>\nI also included the following error checks, but the notebook itself does not throw any errors, so I think it is probably not the problem.</p>\n<pre><code>df = pd.read_csv(\"/kaggle/working/submission.csv\")\nsample_df = pd.read_csv(\"/kaggle/input/benetech-making-graphs-accessible/sample_submission.csv\")\n\nassert(len(df) == len(sample_df))      # The number of series in the data is correct.\nassert not df.isna().any().any()          # NaN not included in csv\nfor i, row in df.iterrows():                    # All data is of type str\n    assert(type(row[\"id\"])==str)\n    assert(type(row[\"data_series\"])==str)\n    assert(type(row[\"chart_type\"])==str)\n\nid1 = df[\"id\"].values.tolist().copy()\nid2 = sample_df[\"id\"].values.tolist().copy()\nid1.sort()\nid2.sort()\nassert id1==id2                                  # Data IDs are not excessive or insufficient.\n</code></pre>\n<p>Are there any other items that should be checked?</p>\n<p><a href=\"https://www.kaggle.com/ryanholbrook\" target=\"_blank\">@ryanholbrook</a><br>\nAs a participant, I am unable to see the actual score calculation process, and this error message alone limits my ability to debug with a limited number of submissions.<br>\nI am really struggling with this problem, so please can you help me?</p>",
      "rawMarkdown": "I have done some experimentation and I really don't know why the Scoring Error is occurring.\nConsidering the possibility that there are values mixed in with the data_series that cause the error, I called the following function at the end of the submit note,\nI converted all values that can be converted to numbers to 0 and all values that cannot be converted to numbers to 'a'.\n```\ndef is_inf_or_nan(s):\n    try:\n        n = float(s)\n        return True\n    except:\n        return False\n\ndef replace_nan_inf(df, replace_str=\"0\"):\n    data_series_list = df[\"data_series\"].values\n    replaced_data_series_list = []\n    for data_series in data_series_list:\n        splited_data_series = data_series.split(\";\")\n        replaced_data_series = \";\".join([replace_str if is_inf_or_nan(s) else \"a\" for s in splited_data_series])\n        replaced_data_series_list.append(replaced_data_series)\n    _df = df.copy()\n    _df[\"data_series\"] = replaced_data_series_list\n    return _df\n\ndf = pd.read_csv(\"/kaggle/working/submission.csv\")\ndf = replace_nan_inf(df)\ndf.to_csv(\"/kaggle/working/submission.csv\", index=False)\n```\nThe results are converted as expected as shown below.\n```\nid \tdata_series \tchart_type\n0 \t000b92c3b098_x \t0;0;0;0;0 \tline\n1 \t01b45b831589_x \ta;a;a;a;a;a;a;a;a;a;a;a;a;a;a;a;a;a;a \tvertical_bar\n2 \t00f5404753cf_x \t0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0 \tscatter\n3 \t00dcf883a459_x \ta;a \tvertical_bar\n4 \t007a18eb4e09_x \t0;0;0;0;0;0;0 \tline\n5 \t000b92c3b098_y \t0;0;0;0;0 \tline\n6 \t01b45b831589_y \t0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0 \tvertical_bar\n7 \t00f5404753cf_y \t0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0 \tscatter\n8 \t00dcf883a459_y \t0;0 \tvertical_bar\n9 \t007a18eb4e09_y \t0;0;0;0;0;0;0 \tline\n```\n\nHowever, even in this state, I get a Scoring Error.\nSince any value should always be 0 or 'a', we cannot assume that inf or nan is the cause.\n\nAlso, considering the possibility that something other than data_series is causing the problem,\nI also included the following error checks, but the notebook itself does not throw any errors, so I think it is probably not the problem.\n```\ndf = pd.read_csv(\"/kaggle/working/submission.csv\")\nsample_df = pd.read_csv(\"/kaggle/input/benetech-making-graphs-accessible/sample_submission.csv\")\n\nassert(len(df) == len(sample_df))      # The number of series in the data is correct.\nassert not df.isna().any().any()          # NaN not included in csv\nfor i, row in df.iterrows():                    # All data is of type str\n    assert(type(row[\"id\"])==str)\n    assert(type(row[\"data_series\"])==str)\n    assert(type(row[\"chart_type\"])==str)\n\nid1 = df[\"id\"].values.tolist().copy()\nid2 = sample_df[\"id\"].values.tolist().copy()\nid1.sort()\nid2.sort()\nassert id1==id2                                  # Data IDs are not excessive or insufficient.\n```\nAre there any other items that should be checked?\n\n@ryanholbrook\nAs a participant, I am unable to see the actual score calculation process, and this error message alone limits my ability to debug with a limited number of submissions.\nI am really struggling with this problem, so please can you help me?",
      "votes": 2,
      "replies": [
        {
          "id": 2274881,
          "postDate": "2023-05-26T10:28:13.250Z",
          "content": "<p>I don't know if this is the cause of the scoring error, but have you checked to see if the predictions are completely empty?<br>\n(i.e., data_series==\"\")</p>",
          "rawMarkdown": "I don't know if this is the cause of the scoring error, but have you checked to see if the predictions are completely empty?\n(i.e., data_series==\"\")",
          "votes": 1,
          "replies": [
            {
              "id": 2274885,
              "postDate": "2023-05-26T10:44:25.993Z",
              "content": "<p>Thanks for the advice.</p>\n<p>Although I did not explicitly confirm that, I actually tried a pattern where I always add \"0;0\" at the end of data_series to guarantee that the number of elements is greater than or equal to 2. (I considered the possibility that there is an anomalous case of length=1 in Ground Truth for numeric data.)<br>\nThe source code is as follows.</p>\n<pre><code>replaced_data_series = \";\".join([replace_str if is_inf_or_nan(s) else \"a\" for s in splited_data_series]+ [\"0;0\"])\n</code></pre>\n<p>However, this pattern also returns a Scoring Error…</p>",
              "rawMarkdown": "Thanks for the advice.\n\nAlthough I did not explicitly confirm that, I actually tried a pattern where I always add \"0;0\" at the end of data_series to guarantee that the number of elements is greater than or equal to 2. (I considered the possibility that there is an anomalous case of length=1 in Ground Truth for numeric data.)\nThe source code is as follows.\n```\nreplaced_data_series = \";\".join([replace_str if is_inf_or_nan(s) else \"a\" for s in splited_data_series]+ [\"0;0\"])\n```\nHowever, this pattern also returns a Scoring Error..."
            },
            {
              "id": 2274904,
              "postDate": "2023-05-26T11:05:33.340Z",
              "content": "<p>Then it seems that the sky prediction is not the cause. <br>\nSorry, I can't think of any other cause…</p>",
              "rawMarkdown": "Then it seems that the sky prediction is not the cause. \nSorry, I can't think of any other cause..."
            },
            {
              "id": 2274924,
              "postDate": "2023-05-26T11:37:00.343Z",
              "content": "<p>Thank you for your comments.<br>\nI just made another post on this thread, but honestly I am out of my depth.<br>\nHopefully the kaggle staff will investigate.</p>",
              "rawMarkdown": "Thank you for your comments.\nI just made another post on this thread, but honestly I am out of my depth.\nHopefully the kaggle staff will investigate.",
              "votes": 1
            }
          ]
        },
        {
          "id": 2274919,
          "postDate": "2023-05-26T11:28:49.693Z",
          "content": "<p>I did some additional experimentation with the last submit today and am confused by the results, which I really don't understand.<br>\nI changed only the model used in the notebook where the Scoring Error occurred earlier (with the process of replacing all data_series to 0 or a) to a proven model (LB=0.58) that has passed submission.<br>\nThen the submit was successful and very curiously resulted in LB=0.58  (even though I overwrote all the data_series!).</p>\n<p>I will not disclose the notebook name or description, but Ver12 is a submit (Scoring Error) that uses the latest model and overwrites data_series with 0 or \"a\". Ver13 is a completely identical submit except that the model used is replaced with a model that has been successfully submitted in the past.</p>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F3823496%2F43ce554b444297d6b1115a72876e0c23%2F2023-05-26%20195915.jpg?generation=1685100336738970&amp;alt=media\" alt=\"screenshot1\"></p>\n<p>I thought it might be a human error on my part, so I checked the contents of the notebook from the Ver13 link on the Submit page, and it is true that the submission.csv displayed at the end of the notebook is only 0 and a.<br>\nI also checked the contents of submission.csv in the Output tab, and sure enough, there are only 0s and a's.<br>\nSince there is no conditional branch in the replacement process, it is unlikely that this process was not executed only for the hidden test data.<br>\n（Attached is a screenshot.）</p>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F3823496%2F0c2044fe111bb33af4ed8e6d8048d792%2F2023-05-26%20200052.jpg?generation=1685100400405694&amp;alt=media\" alt=\"screenshot2\"></p>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F3823496%2F412105d3ce6c423dc4efb224703dbd2e%2F2023-05-26%20200845.jpg?generation=1685100459150866&amp;alt=media\" alt=\"screenshot3\"></p>\n<p>I honestly have no idea what happened.<br>\nIs the kaggle scoring system working properly?<br>\n<a href=\"https://www.kaggle.com/ryanholbrook\" target=\"_blank\">@ryanholbrook</a><br>\nI am afraid I am repeating myself, but could you please investigate?</p>",
          "rawMarkdown": "I did some additional experimentation with the last submit today and am confused by the results, which I really don't understand.\nI changed only the model used in the notebook where the Scoring Error occurred earlier (with the process of replacing all data_series to 0 or a) to a proven model (LB=0.58) that has passed submission.\nThen the submit was successful and very curiously resulted in LB=0.58  (even though I overwrote all the data_series!).\n\nI will not disclose the notebook name or description, but Ver12 is a submit (Scoring Error) that uses the latest model and overwrites data_series with 0 or \"a\". Ver13 is a completely identical submit except that the model used is replaced with a model that has been successfully submitted in the past.\n\n![screenshot1](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F3823496%2F43ce554b444297d6b1115a72876e0c23%2F2023-05-26%20195915.jpg?generation=1685100336738970&alt=media)\n\nI thought it might be a human error on my part, so I checked the contents of the notebook from the Ver13 link on the Submit page, and it is true that the submission.csv displayed at the end of the notebook is only 0 and a.\nI also checked the contents of submission.csv in the Output tab, and sure enough, there are only 0s and a's.\nSince there is no conditional branch in the replacement process, it is unlikely that this process was not executed only for the hidden test data.\n（Attached is a screenshot.）\n\n![screenshot2](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F3823496%2F0c2044fe111bb33af4ed8e6d8048d792%2F2023-05-26%20200052.jpg?generation=1685100400405694&alt=media)\n\n![screenshot3](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F3823496%2F412105d3ce6c423dc4efb224703dbd2e%2F2023-05-26%20200845.jpg?generation=1685100459150866&alt=media)\n\n\nI honestly have no idea what happened.\nIs the kaggle scoring system working properly?\n@ryanholbrook\nI am afraid I am repeating myself, but could you please investigate?",
          "votes": 1,
          "replies": [
            {
              "id": 2275016,
              "postDate": "2023-05-26T12:45:23.377Z",
              "content": "<p>Hi <a href=\"https://www.kaggle.com/kashiwaba\" target=\"_blank\">@kashiwaba</a>, The error I'm seeing is \"Unknown chart type.\" You might check that all of the <code>chart_type</code> values are valid, non-missing, etc.</p>",
              "rawMarkdown": "Hi @kashiwaba, The error I'm seeing is \"Unknown chart type.\" You might check that all of the `chart_type` values are valid, non-missing, etc.",
              "votes": 2
            },
            {
              "id": 2275035,
              "postDate": "2023-05-26T12:54:48.617Z",
              "content": "<p>Thank you for your prompt reply.<br>\nI was wondering if, by any chance, once a submission.csv file is generated in the middle of the process, the csv at that point is the one that will be scored?</p>\n<p>The inference script for the new model generates a submission.csv file with incomplete data in the middle of the process. (It will be rewritten to have the correct data at the end of the submission.)<br>\nIf that is the behavior, it would explain this phenomenon.<br>\n(The difference is that the previous model does not generate an extra log called submission.csv in the process of inference.)</p>",
              "rawMarkdown": "Thank you for your prompt reply.\nI was wondering if, by any chance, once a submission.csv file is generated in the middle of the process, the csv at that point is the one that will be scored?\n\nThe inference script for the new model generates a submission.csv file with incomplete data in the middle of the process. (It will be rewritten to have the correct data at the end of the submission.)\nIf that is the behavior, it would explain this phenomenon.\n(The difference is that the previous model does not generate an extra log called submission.csv in the process of inference.)"
            },
            {
              "id": 2275038,
              "postDate": "2023-05-26T12:56:06.057Z",
              "content": "<p>If not, at least the above phenomenon cannot be explained. (Why would a notebook with overwritten data_series return the same score as before?)</p>",
              "rawMarkdown": "If not, at least the above phenomenon cannot be explained. (Why would a notebook with overwritten data_series return the same score as before?)"
            },
            {
              "id": 2275052,
              "postDate": "2023-05-26T13:04:56.123Z",
              "content": "<p>The scoring takes place after the notebook has finished executing. So the metric will only read the final <code>submission.csv</code> file.</p>",
              "rawMarkdown": "The scoring takes place after the notebook has finished executing. So the metric will only read the final `submission.csv` file."
            },
            {
              "id": 2275059,
              "postDate": "2023-05-26T13:08:54.853Z",
              "content": "<p>I see.<br>\nHmmm, then why did the above phenomenon occur?<br>\nEven if the Scoring Error was due to an incomplete data type, the above phenomenon seems to be inexplicable.</p>",
              "rawMarkdown": "I see.\nHmmm, then why did the above phenomenon occur?\nEven if the Scoring Error was due to an incomplete data type, the above phenomenon seems to be inexplicable."
            },
            {
              "id": 2275068,
              "postDate": "2023-05-26T13:19:12.587Z",
              "content": "<p>Also, some of the submittals that caused Scoring Error were actually also checked for correct chart_type.<br>\nThe following process is performed at the end of each submission.</p>\n<pre><code>for chart_type in df[\"chart_type\"].values:\n    if chart_type not in [\"dot\", \"horizontal_bar\", \"vertical_bar\", \"line\", \"scatter\"]:\n        raise Exception\n</code></pre>\n<p>This notebook did not throw any errors, so I assume that this check passed successfully. However, a Scoring Error is returned.<br>\nTherefore, it is unlikely that chart_type is the cause of the error.</p>",
              "rawMarkdown": "Also, some of the submittals that caused Scoring Error were actually also checked for correct chart_type.\nThe following process is performed at the end of each submission.\n```\nfor chart_type in df[\"chart_type\"].values:\n    if chart_type not in [\"dot\", \"horizontal_bar\", \"vertical_bar\", \"line\", \"scatter\"]:\n        raise Exception\n```\n\nThis notebook did not throw any errors, so I assume that this check passed successfully. However, a Scoring Error is returned.\nTherefore, it is unlikely that chart_type is the cause of the error."
            },
            {
              "id": 2276612,
              "postDate": "2023-05-27T04:12:22.643Z",
              "content": "<p>Finally, the submission went through normally.<br>\nThe LBs are also close to the values I was expecting so I think they are being handled correctly.<br>\nThank you very much for your help.</p>\n<p>However, I was not sure why the Scoring Error was occurring until now.<br>\nIn my case, I made sure not to put any files in the ’/kaggle/working’ directory during the process (i.e., only output submission.csv at the end of the notebook), and it now passes.</p>\n<p>I did a lot of fiddling with the notebooks in the process of fixing that, so it is possible that some bugs I am not aware of have been worked out together, but it still seems to me that the system is doing something unexpected, as you can see from the results of my submission yesterday.</p>\n<p>In any case, if any participants are having trouble with the Scoring Error, it might be a good idea to check to see if any extra files are being output during the process.</p>",
              "rawMarkdown": "Finally, the submission went through normally.\nThe LBs are also close to the values I was expecting so I think they are being handled correctly.\nThank you very much for your help.\n\nHowever, I was not sure why the Scoring Error was occurring until now.\nIn my case, I made sure not to put any files in the ’/kaggle/working’ directory during the process (i.e., only output submission.csv at the end of the notebook), and it now passes.\n\nI did a lot of fiddling with the notebooks in the process of fixing that, so it is possible that some bugs I am not aware of have been worked out together, but it still seems to me that the system is doing something unexpected, as you can see from the results of my submission yesterday.\n\nIn any case, if any participants are having trouble with the Scoring Error, it might be a good idea to check to see if any extra files are being output during the process.",
              "votes": 2
            }
          ]
        }
      ]
    },
    {
      "id": 2271207,
      "postDate": "2023-05-23T17:31:49.773Z",
      "content": "<p>You have to replace the nan, otherwise it will throw an error.</p>",
      "rawMarkdown": "You have to replace the nan, otherwise it will throw an error.",
      "votes": 2,
      "replies": [
        {
          "id": 2271209,
          "postDate": "2023-05-23T17:33:06.450Z",
          "content": "<p>Thank you Benedikt</p>",
          "rawMarkdown": "Thank you Benedikt",
          "replies": [
            {
              "id": 2274347,
              "postDate": "2023-05-25T21:34:19.690Z",
              "content": "<p>Hi, did you solve the problem?<br>\nI am encountering the same phenomenon and am having a very difficult time.</p>\n<p>I also thought it might be caused by nan or inf, so I added the following process at the end of the submission, but I still get a Submission Scoring Error.</p>\n<pre><code>def is_inf_or_nan(s):\n    try:\n        n = float(s)\n    except:\n        return False\n\n    if np.isnan(n) or np.isinf(n):\n        return True\n    return False\n\ndef replace_nan_inf(df, replace_str=\"0\"):\n    data_series_list = df[\"data_series\"].values\n    replaced_data_series_list = []\n    for data_series in data_series_list:\n        splited_data_series = data_series.split(\";\")\n        replaced_data_series = \";\".join([replace_str if is_inf_or_nan(s) else s for s in splited_data_series])\n        replaced_data_series_list.append(replaced_data_series)\n    _df = df.copy()\n    _df[\"data_series\"] = replaced_data_series_list\n    return _df\n\ndf = pd.read_csv(\"/kaggle/working/submission.csv\")\ndf = replace_nan_inf(df)\ndf.to_csv(\"/kaggle/working/submission.csv\", index=False)\n</code></pre>\n<p>(A simple test confirms that the above process replaces possible nan and inf values with \"0\".)</p>\n<pre><code>(input) 1;2;3;nan;inf;-inf; nan;3e999;-3e999;inf ;Nan;naN\n(output) 1;2;3;0;0;0;0;0;0;0;0;0    \n</code></pre>\n<p>I would appreciate it if someone could advise me if there is something wrong with this process or if there are other factors that could cause a Submission Scoring Error.</p>",
              "rawMarkdown": "Hi, did you solve the problem?\nI am encountering the same phenomenon and am having a very difficult time.\n\nI also thought it might be caused by nan or inf, so I added the following process at the end of the submission, but I still get a Submission Scoring Error.\n```\ndef is_inf_or_nan(s):\n    try:\n        n = float(s)\n    except:\n        return False\n    \n    if np.isnan(n) or np.isinf(n):\n        return True\n    return False\n\ndef replace_nan_inf(df, replace_str=\"0\"):\n    data_series_list = df[\"data_series\"].values\n    replaced_data_series_list = []\n    for data_series in data_series_list:\n        splited_data_series = data_series.split(\";\")\n        replaced_data_series = \";\".join([replace_str if is_inf_or_nan(s) else s for s in splited_data_series])\n        replaced_data_series_list.append(replaced_data_series)\n    _df = df.copy()\n    _df[\"data_series\"] = replaced_data_series_list\n    return _df\n\ndf = pd.read_csv(\"/kaggle/working/submission.csv\")\ndf = replace_nan_inf(df)\ndf.to_csv(\"/kaggle/working/submission.csv\", index=False)\n```\n(A simple test confirms that the above process replaces possible nan and inf values with \"0\".)\n```\n(input) 1;2;3;nan;inf;-inf; nan;3e999;-3e999;inf ;Nan;naN\n(output) 1;2;3;0;0;0;0;0;0;0;0;0\t\n```\n\nI would appreciate it if someone could advise me if there is something wrong with this process or if there are other factors that could cause a Submission Scoring Error.",
              "votes": 4
            },
            {
              "id": 2274348,
              "postDate": "2023-05-25T21:39:04.450Z",
              "content": "<p>Yeah we have not figured it out yet either. In the event we figure it out I will be sure to let you know here!</p>",
              "rawMarkdown": "Yeah we have not figured it out yet either. In the event we figure it out I will be sure to let you know here!",
              "votes": 2
            },
            {
              "id": 2275088,
              "postDate": "2023-05-26T13:36:28.940Z",
              "content": "<p><a href=\"https://www.kaggle.com/kashiwaba\" target=\"_blank\">@kashiwaba</a> this is my replace nan function, its a bit simple (something better would be to replace with mean of the remaining values):</p>\n<pre><code> ():\n    strings = input_string.split()\n    all_floats = \n    \n     string  strings:\n        :\n            (string)\n         ValueError:\n            all_floats = \n             \n     all_floats:\n         string  strings:\n            num = (string)\n             math.isnan(num)  math.isinf(num):\n                input_string = input_string.replace(string, )\n            :\n                \n         input_string\n    :\n         input_string\n</code></pre>",
              "rawMarkdown": "@kashiwaba this is my replace nan function, its a bit simple (something better would be to replace with mean of the remaining values):\n```python\ndef replace_nan(input_string):\n    strings = input_string.split(\";\")\n    all_floats = True\n    # First lets check all elements are floats\n    for string in strings:\n        try:\n            float(string)\n        except ValueError:\n            all_floats = False\n            break \n    if all_floats:\n        for string in strings:\n            num = float(string)\n            if math.isnan(num) or math.isinf(num):\n                input_string = input_string.replace(string, \"0\")\n            else:\n                pass\n        return input_string\n    else:\n        return input_string\n```",
              "votes": 2
            },
            {
              "id": 2275094,
              "postDate": "2023-05-26T13:49:28.453Z",
              "content": "<p>Thank you very much.<br>\nIt may indeed be a good way to replace the data_series with the average of the data_series. <br>\nI will refer to it.</p>",
              "rawMarkdown": "Thank you very much.\nIt may indeed be a good way to replace the data_series with the average of the data_series. \nI will refer to it."
            }
          ]
        }
      ]
    }
  ],
  "comments": [
    {
      "id": 2290534,
      "author_name": "Bartley",
      "author_url": "",
      "post_date": "2023-06-06T23:14:02.943000",
      "content": "<p>Another error I have seen is <code>\\r\\n</code> in string predictions. You can clean those predictions with something like this.</p>\n<pre><code>def remove_newlines(val):\n    val  val.replace(, ).replace(, ).replace(, ).replace(, )\n     val\n</code></pre>",
      "votes": 1,
      "replies": []
    },
    {
      "id": 2272987,
      "author_name": "Cody_Null",
      "author_url": "",
      "post_date": "2023-05-24T23:34:26.360000",
      "content": "<p><a href=\"https://www.kaggle.com/ryanholbrook\" target=\"_blank\">@ryanholbrook</a> it seems it isn’t due to nans or inf values? Are you able to help?</p>",
      "votes": 1,
      "replies": []
    },
    {
      "id": 2275028,
      "author_name": "Ryan Holbrook",
      "author_url": "",
      "post_date": "2023-05-26T12:48:45.347000",
      "content": "<p>Hi <a href=\"https://www.kaggle.com/alejopaullier\" target=\"_blank\">@alejopaullier</a>, The error I'm seeing is that your submission has an incorrect number of rows. You might try building off the sample submission in the hidden test set to make sure you're getting a complete set of ids and not dropping anything due to missing values.</p>",
      "votes": 2,
      "replies": [
        {
          "id": 2275080,
          "author_name": "moth",
          "author_url": "",
          "post_date": "2023-05-26T13:25:22.540000",
          "content": "<p>Thanks Ryan!</p>",
          "votes": 1,
          "replies": []
        },
        {
          "id": 2275151,
          "author_name": "",
          "author_url": "",
          "post_date": "2023-05-26T14:41:12.100000",
          "content": "",
          "votes": 0,
          "replies": []
        },
        {
          "id": 2280298,
          "author_name": "",
          "author_url": "",
          "post_date": "2023-05-30T03:22:50.820000",
          "content": "",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 2274649,
      "author_name": "YumeNeko",
      "author_url": "",
      "post_date": "2023-05-26T07:01:26.527000",
      "content": "<p>I have done some experimentation and I really don't know why the Scoring Error is occurring.<br>\nConsidering the possibility that there are values mixed in with the data_series that cause the error, I called the following function at the end of the submit note,<br>\nI converted all values that can be converted to numbers to 0 and all values that cannot be converted to numbers to 'a'.</p>\n<pre><code>def is_inf_or_nan(s):\n    try:\n        n = float(s)\n        return True\n    except:\n        return False\n\ndef replace_nan_inf(df, replace_str=\"0\"):\n    data_series_list = df[\"data_series\"].values\n    replaced_data_series_list = []\n    for data_series in data_series_list:\n        splited_data_series = data_series.split(\";\")\n        replaced_data_series = \";\".join([replace_str if is_inf_or_nan(s) else \"a\" for s in splited_data_series])\n        replaced_data_series_list.append(replaced_data_series)\n    _df = df.copy()\n    _df[\"data_series\"] = replaced_data_series_list\n    return _df\n\ndf = pd.read_csv(\"/kaggle/working/submission.csv\")\ndf = replace_nan_inf(df)\ndf.to_csv(\"/kaggle/working/submission.csv\", index=False)\n</code></pre>\n<p>The results are converted as expected as shown below.</p>\n<pre><code>id     data_series     chart_type\n0     000b92c3b098_x  0;0;0;0;0   line\n1     01b45b831589_x  a;a;a;a;a;a;a;a;a;a;a;a;a;a;a;a;a;a;a   vertical_bar\n2     00f5404753cf_x  0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0     scatter\n3     00dcf883a459_x  a;a     vertical_bar\n4     007a18eb4e09_x  0;0;0;0;0;0;0   line\n5     000b92c3b098_y  0;0;0;0;0   line\n6     01b45b831589_y  0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0   vertical_bar\n7     00f5404753cf_y  0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0     scatter\n8     00dcf883a459_y  0;0     vertical_bar\n9     007a18eb4e09_y  0;0;0;0;0;0;0   line\n</code></pre>\n<p>However, even in this state, I get a Scoring Error.<br>\nSince any value should always be 0 or 'a', we cannot assume that inf or nan is the cause.</p>\n<p>Also, considering the possibility that something other than data_series is causing the problem,<br>\nI also included the following error checks, but the notebook itself does not throw any errors, so I think it is probably not the problem.</p>\n<pre><code>df = pd.read_csv(\"/kaggle/working/submission.csv\")\nsample_df = pd.read_csv(\"/kaggle/input/benetech-making-graphs-accessible/sample_submission.csv\")\n\nassert(len(df) == len(sample_df))      # The number of series in the data is correct.\nassert not df.isna().any().any()          # NaN not included in csv\nfor i, row in df.iterrows():                    # All data is of type str\n    assert(type(row[\"id\"])==str)\n    assert(type(row[\"data_series\"])==str)\n    assert(type(row[\"chart_type\"])==str)\n\nid1 = df[\"id\"].values.tolist().copy()\nid2 = sample_df[\"id\"].values.tolist().copy()\nid1.sort()\nid2.sort()\nassert id1==id2                                  # Data IDs are not excessive or insufficient.\n</code></pre>\n<p>Are there any other items that should be checked?</p>\n<p><a href=\"https://www.kaggle.com/ryanholbrook\" target=\"_blank\">@ryanholbrook</a><br>\nAs a participant, I am unable to see the actual score calculation process, and this error message alone limits my ability to debug with a limited number of submissions.<br>\nI am really struggling with this problem, so please can you help me?</p>",
      "votes": 2,
      "replies": [
        {
          "id": 2274881,
          "author_name": "penguin46",
          "author_url": "",
          "post_date": "2023-05-26T10:28:13.250000",
          "content": "<p>I don't know if this is the cause of the scoring error, but have you checked to see if the predictions are completely empty?<br>\n(i.e., data_series==\"\")</p>",
          "votes": 1,
          "replies": [
            {
              "id": 2274885,
              "author_name": "YumeNeko",
              "author_url": "",
              "post_date": "2023-05-26T10:44:25.993000",
              "content": "<p>Thanks for the advice.</p>\n<p>Although I did not explicitly confirm that, I actually tried a pattern where I always add \"0;0\" at the end of data_series to guarantee that the number of elements is greater than or equal to 2. (I considered the possibility that there is an anomalous case of length=1 in Ground Truth for numeric data.)<br>\nThe source code is as follows.</p>\n<pre><code>replaced_data_series = \";\".join([replace_str if is_inf_or_nan(s) else \"a\" for s in splited_data_series]+ [\"0;0\"])\n</code></pre>\n<p>However, this pattern also returns a Scoring Error…</p>",
              "votes": 0,
              "replies": []
            },
            {
              "id": 2274904,
              "author_name": "penguin46",
              "author_url": "",
              "post_date": "2023-05-26T11:05:33.340000",
              "content": "<p>Then it seems that the sky prediction is not the cause. <br>\nSorry, I can't think of any other cause…</p>",
              "votes": 0,
              "replies": []
            },
            {
              "id": 2274924,
              "author_name": "YumeNeko",
              "author_url": "",
              "post_date": "2023-05-26T11:37:00.343000",
              "content": "<p>Thank you for your comments.<br>\nI just made another post on this thread, but honestly I am out of my depth.<br>\nHopefully the kaggle staff will investigate.</p>",
              "votes": 1,
              "replies": []
            }
          ]
        },
        {
          "id": 2274919,
          "author_name": "YumeNeko",
          "author_url": "",
          "post_date": "2023-05-26T11:28:49.693000",
          "content": "<p>I did some additional experimentation with the last submit today and am confused by the results, which I really don't understand.<br>\nI changed only the model used in the notebook where the Scoring Error occurred earlier (with the process of replacing all data_series to 0 or a) to a proven model (LB=0.58) that has passed submission.<br>\nThen the submit was successful and very curiously resulted in LB=0.58  (even though I overwrote all the data_series!).</p>\n<p>I will not disclose the notebook name or description, but Ver12 is a submit (Scoring Error) that uses the latest model and overwrites data_series with 0 or \"a\". Ver13 is a completely identical submit except that the model used is replaced with a model that has been successfully submitted in the past.</p>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F3823496%2F43ce554b444297d6b1115a72876e0c23%2F2023-05-26%20195915.jpg?generation=1685100336738970&amp;alt=media\" alt=\"screenshot1\"></p>\n<p>I thought it might be a human error on my part, so I checked the contents of the notebook from the Ver13 link on the Submit page, and it is true that the submission.csv displayed at the end of the notebook is only 0 and a.<br>\nI also checked the contents of submission.csv in the Output tab, and sure enough, there are only 0s and a's.<br>\nSince there is no conditional branch in the replacement process, it is unlikely that this process was not executed only for the hidden test data.<br>\n（Attached is a screenshot.）</p>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F3823496%2F0c2044fe111bb33af4ed8e6d8048d792%2F2023-05-26%20200052.jpg?generation=1685100400405694&amp;alt=media\" alt=\"screenshot2\"></p>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F3823496%2F412105d3ce6c423dc4efb224703dbd2e%2F2023-05-26%20200845.jpg?generation=1685100459150866&amp;alt=media\" alt=\"screenshot3\"></p>\n<p>I honestly have no idea what happened.<br>\nIs the kaggle scoring system working properly?<br>\n<a href=\"https://www.kaggle.com/ryanholbrook\" target=\"_blank\">@ryanholbrook</a><br>\nI am afraid I am repeating myself, but could you please investigate?</p>",
          "votes": 1,
          "replies": [
            {
              "id": 2275016,
              "author_name": "Ryan Holbrook",
              "author_url": "",
              "post_date": "2023-05-26T12:45:23.377000",
              "content": "<p>Hi <a href=\"https://www.kaggle.com/kashiwaba\" target=\"_blank\">@kashiwaba</a>, The error I'm seeing is \"Unknown chart type.\" You might check that all of the <code>chart_type</code> values are valid, non-missing, etc.</p>",
              "votes": 2,
              "replies": []
            },
            {
              "id": 2275035,
              "author_name": "YumeNeko",
              "author_url": "",
              "post_date": "2023-05-26T12:54:48.617000",
              "content": "<p>Thank you for your prompt reply.<br>\nI was wondering if, by any chance, once a submission.csv file is generated in the middle of the process, the csv at that point is the one that will be scored?</p>\n<p>The inference script for the new model generates a submission.csv file with incomplete data in the middle of the process. (It will be rewritten to have the correct data at the end of the submission.)<br>\nIf that is the behavior, it would explain this phenomenon.<br>\n(The difference is that the previous model does not generate an extra log called submission.csv in the process of inference.)</p>",
              "votes": 0,
              "replies": []
            },
            {
              "id": 2275038,
              "author_name": "YumeNeko",
              "author_url": "",
              "post_date": "2023-05-26T12:56:06.057000",
              "content": "<p>If not, at least the above phenomenon cannot be explained. (Why would a notebook with overwritten data_series return the same score as before?)</p>",
              "votes": 0,
              "replies": []
            },
            {
              "id": 2275052,
              "author_name": "Ryan Holbrook",
              "author_url": "",
              "post_date": "2023-05-26T13:04:56.123000",
              "content": "<p>The scoring takes place after the notebook has finished executing. So the metric will only read the final <code>submission.csv</code> file.</p>",
              "votes": 0,
              "replies": []
            },
            {
              "id": 2275059,
              "author_name": "YumeNeko",
              "author_url": "",
              "post_date": "2023-05-26T13:08:54.853000",
              "content": "<p>I see.<br>\nHmmm, then why did the above phenomenon occur?<br>\nEven if the Scoring Error was due to an incomplete data type, the above phenomenon seems to be inexplicable.</p>",
              "votes": 0,
              "replies": []
            },
            {
              "id": 2275068,
              "author_name": "YumeNeko",
              "author_url": "",
              "post_date": "2023-05-26T13:19:12.587000",
              "content": "<p>Also, some of the submittals that caused Scoring Error were actually also checked for correct chart_type.<br>\nThe following process is performed at the end of each submission.</p>\n<pre><code>for chart_type in df[\"chart_type\"].values:\n    if chart_type not in [\"dot\", \"horizontal_bar\", \"vertical_bar\", \"line\", \"scatter\"]:\n        raise Exception\n</code></pre>\n<p>This notebook did not throw any errors, so I assume that this check passed successfully. However, a Scoring Error is returned.<br>\nTherefore, it is unlikely that chart_type is the cause of the error.</p>",
              "votes": 0,
              "replies": []
            },
            {
              "id": 2276612,
              "author_name": "YumeNeko",
              "author_url": "",
              "post_date": "2023-05-27T04:12:22.643000",
              "content": "<p>Finally, the submission went through normally.<br>\nThe LBs are also close to the values I was expecting so I think they are being handled correctly.<br>\nThank you very much for your help.</p>\n<p>However, I was not sure why the Scoring Error was occurring until now.<br>\nIn my case, I made sure not to put any files in the ’/kaggle/working’ directory during the process (i.e., only output submission.csv at the end of the notebook), and it now passes.</p>\n<p>I did a lot of fiddling with the notebooks in the process of fixing that, so it is possible that some bugs I am not aware of have been worked out together, but it still seems to me that the system is doing something unexpected, as you can see from the results of my submission yesterday.</p>\n<p>In any case, if any participants are having trouble with the Scoring Error, it might be a good idea to check to see if any extra files are being output during the process.</p>",
              "votes": 2,
              "replies": []
            }
          ]
        }
      ]
    },
    {
      "id": 2271207,
      "author_name": "Benedikt Droste",
      "author_url": "",
      "post_date": "2023-05-23T17:31:49.773000",
      "content": "<p>You have to replace the nan, otherwise it will throw an error.</p>",
      "votes": 2,
      "replies": [
        {
          "id": 2271209,
          "author_name": "moth",
          "author_url": "",
          "post_date": "2023-05-23T17:33:06.450000",
          "content": "<p>Thank you Benedikt</p>",
          "votes": 0,
          "replies": [
            {
              "id": 2274347,
              "author_name": "YumeNeko",
              "author_url": "",
              "post_date": "2023-05-25T21:34:19.690000",
              "content": "<p>Hi, did you solve the problem?<br>\nI am encountering the same phenomenon and am having a very difficult time.</p>\n<p>I also thought it might be caused by nan or inf, so I added the following process at the end of the submission, but I still get a Submission Scoring Error.</p>\n<pre><code>def is_inf_or_nan(s):\n    try:\n        n = float(s)\n    except:\n        return False\n\n    if np.isnan(n) or np.isinf(n):\n        return True\n    return False\n\ndef replace_nan_inf(df, replace_str=\"0\"):\n    data_series_list = df[\"data_series\"].values\n    replaced_data_series_list = []\n    for data_series in data_series_list:\n        splited_data_series = data_series.split(\";\")\n        replaced_data_series = \";\".join([replace_str if is_inf_or_nan(s) else s for s in splited_data_series])\n        replaced_data_series_list.append(replaced_data_series)\n    _df = df.copy()\n    _df[\"data_series\"] = replaced_data_series_list\n    return _df\n\ndf = pd.read_csv(\"/kaggle/working/submission.csv\")\ndf = replace_nan_inf(df)\ndf.to_csv(\"/kaggle/working/submission.csv\", index=False)\n</code></pre>\n<p>(A simple test confirms that the above process replaces possible nan and inf values with \"0\".)</p>\n<pre><code>(input) 1;2;3;nan;inf;-inf; nan;3e999;-3e999;inf ;Nan;naN\n(output) 1;2;3;0;0;0;0;0;0;0;0;0    \n</code></pre>\n<p>I would appreciate it if someone could advise me if there is something wrong with this process or if there are other factors that could cause a Submission Scoring Error.</p>",
              "votes": 4,
              "replies": []
            },
            {
              "id": 2274348,
              "author_name": "Cody_Null",
              "author_url": "",
              "post_date": "2023-05-25T21:39:04.450000",
              "content": "<p>Yeah we have not figured it out yet either. In the event we figure it out I will be sure to let you know here!</p>",
              "votes": 2,
              "replies": []
            },
            {
              "id": 2275088,
              "author_name": "moth",
              "author_url": "",
              "post_date": "2023-05-26T13:36:28.940000",
              "content": "<p><a href=\"https://www.kaggle.com/kashiwaba\" target=\"_blank\">@kashiwaba</a> this is my replace nan function, its a bit simple (something better would be to replace with mean of the remaining values):</p>\n<pre><code> ():\n    strings = input_string.split()\n    all_floats = \n    \n     string  strings:\n        :\n            (string)\n         ValueError:\n            all_floats = \n             \n     all_floats:\n         string  strings:\n            num = (string)\n             math.isnan(num)  math.isinf(num):\n                input_string = input_string.replace(string, )\n            :\n                \n         input_string\n    :\n         input_string\n</code></pre>",
              "votes": 2,
              "replies": []
            },
            {
              "id": 2275094,
              "author_name": "YumeNeko",
              "author_url": "",
              "post_date": "2023-05-26T13:49:28.453000",
              "content": "<p>Thank you very much.<br>\nIt may indeed be a good way to replace the data_series with the average of the data_series. <br>\nI will refer to it.</p>",
              "votes": 0,
              "replies": []
            }
          ]
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "2271201": "When making a submission does the scoring function split the dataseries by `;` and then tries to convert the tokens to floats? I have been getting scoring errors and cant quite figure out the reason. I have some data series which have commas inside as well as `nan` characters. \n- `19;12;12;2;3;5;0;2;0;0;0;1;0;nan`\n- `\" April 1, 2012;Aug. 14, 2013;Dec. 27, 2014;May 10, 2016\"`\n- `04.05.2015;04.06.2015;04.07.2015;04.08.2015;04.09.2016;04.10.2015;04.11.2015;04.12.2015` dates separated by point\n\n@ryanholbrook ",
    "2290534": "Another error I have seen is `\\r\\n` in string predictions. You can clean those predictions with something like this.\n\n```\ndef remove_newlines(val):\n    val = val.replace(\"\\r\\n\\r\\n\", \" \").replace(\"\\r\\n\", \" \").replace(\"\\r\", \"\").replace(\"\\n\", \"\")\n    return val\n```",
    "2272987": "@ryanholbrook it seems it isn’t due to nans or inf values? Are you able to help?",
    "2275028": "Hi @alejopaullier, The error I'm seeing is that your submission has an incorrect number of rows. You might try building off the sample submission in the hidden test set to make sure you're getting a complete set of ids and not dropping anything due to missing values.",
    "2274649": "I have done some experimentation and I really don't know why the Scoring Error is occurring.\nConsidering the possibility that there are values mixed in with the data_series that cause the error, I called the following function at the end of the submit note,\nI converted all values that can be converted to numbers to 0 and all values that cannot be converted to numbers to 'a'.\n```\ndef is_inf_or_nan(s):\n    try:\n        n = float(s)\n        return True\n    except:\n        return False\n\ndef replace_nan_inf(df, replace_str=\"0\"):\n    data_series_list = df[\"data_series\"].values\n    replaced_data_series_list = []\n    for data_series in data_series_list:\n        splited_data_series = data_series.split(\";\")\n        replaced_data_series = \";\".join([replace_str if is_inf_or_nan(s) else \"a\" for s in splited_data_series])\n        replaced_data_series_list.append(replaced_data_series)\n    _df = df.copy()\n    _df[\"data_series\"] = replaced_data_series_list\n    return _df\n\ndf = pd.read_csv(\"/kaggle/working/submission.csv\")\ndf = replace_nan_inf(df)\ndf.to_csv(\"/kaggle/working/submission.csv\", index=False)\n```\nThe results are converted as expected as shown below.\n```\nid \tdata_series \tchart_type\n0 \t000b92c3b098_x \t0;0;0;0;0 \tline\n1 \t01b45b831589_x \ta;a;a;a;a;a;a;a;a;a;a;a;a;a;a;a;a;a;a \tvertical_bar\n2 \t00f5404753cf_x \t0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0 \tscatter\n3 \t00dcf883a459_x \ta;a \tvertical_bar\n4 \t007a18eb4e09_x \t0;0;0;0;0;0;0 \tline\n5 \t000b92c3b098_y \t0;0;0;0;0 \tline\n6 \t01b45b831589_y \t0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0 \tvertical_bar\n7 \t00f5404753cf_y \t0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0 \tscatter\n8 \t00dcf883a459_y \t0;0 \tvertical_bar\n9 \t007a18eb4e09_y \t0;0;0;0;0;0;0 \tline\n```\n\nHowever, even in this state, I get a Scoring Error.\nSince any value should always be 0 or 'a', we cannot assume that inf or nan is the cause.\n\nAlso, considering the possibility that something other than data_series is causing the problem,\nI also included the following error checks, but the notebook itself does not throw any errors, so I think it is probably not the problem.\n```\ndf = pd.read_csv(\"/kaggle/working/submission.csv\")\nsample_df = pd.read_csv(\"/kaggle/input/benetech-making-graphs-accessible/sample_submission.csv\")\n\nassert(len(df) == len(sample_df))      # The number of series in the data is correct.\nassert not df.isna().any().any()          # NaN not included in csv\nfor i, row in df.iterrows():                    # All data is of type str\n    assert(type(row[\"id\"])==str)\n    assert(type(row[\"data_series\"])==str)\n    assert(type(row[\"chart_type\"])==str)\n\nid1 = df[\"id\"].values.tolist().copy()\nid2 = sample_df[\"id\"].values.tolist().copy()\nid1.sort()\nid2.sort()\nassert id1==id2                                  # Data IDs are not excessive or insufficient.\n```\nAre there any other items that should be checked?\n\n@ryanholbrook\nAs a participant, I am unable to see the actual score calculation process, and this error message alone limits my ability to debug with a limited number of submissions.\nI am really struggling with this problem, so please can you help me?",
    "2271207": "You have to replace the nan, otherwise it will throw an error."
  }
}