{
  "id": 67015,
  "title": "Unable to submit the file : Please Help!",
  "url": "/competitions/ga-customer-revenue-prediction/discussion/67015",
  "author_name": "Jean",
  "post_date": "2018-09-27T17:19:02.890000",
  "votes": 2,
  "comment_count": 23,
  "views": 0,
  "content": "<p>Hello, This is my first time participating in a kaggle competition and I'm having trouble submitting my result. I made my model using gbm and made a prediction table like below.</p>\n\n<pre><code>pred_oob = predict(object = model_gbm, newdata = te_df, n.trees = opt_ntree_oob, type = 'response')\npred_oob = ifelse(pred_oob&amp;lt;0, 0, pred_oob)\n\ntest$Predicted = pred_oob    \nmysub = test %&gt;%\n  select(fullVisitorId, Predicted)\n\nmysub = mysub %&gt;%\n  group_by(fullVisitorId) %&gt;%\n  summarise(PredictedLogRevenue = round(sum(Predicted), 5)) \n\nwrite.csv(mysub, file = 'mysub_gbm.csv', row.names = F)\n</code></pre>\n\n<p>Whenever I tried to submit the file, I got the 'fail' message saying ...</p>\n\n<pre><code>ERROR: Unable to find 614143 required key values in the 'fullVisitorId' column\nERROR: Unable to find the required key value '0000000259678714014' in the 'fullVisitorId' column\nERROR: Unable to find the required key value '0000049363351866189' in the 'fullVisitorId' column\nERROR: Unable to find the required key value '0000053049821714864' in the 'fullVisitorId' column\n</code></pre>\n\n<p>So I inspected my submission data again with that values, but...</p>\n\n<pre><code>error = c(614143, 259678714014, 49363351866189, 53049821714864, 59488412965267,  8584037063378, 91131414287111, 117255350596610, 118334805178127, 130646294093000)\n mysub[mysub$fullVisitorId %in% error, ]\n</code></pre>\n\n<p>But there was no empty row...I have no clue from what point I made mistake....Please help!</p>",
  "messages": [
    {
      "id": 394967,
      "postDate": "2018-09-27T18:23:39.267Z",
      "content": "<p>Make sure when you initially read the CSV data to import it as character. I had this issue too, and if you import it without specifying the fullVisitorId field is character, R will assume numeric and remove the leading zeros from the ID. Something like this would work when you initially read the data:</p>\n\n<pre><code>train &lt;- read.csv('train.csv', colClasses=c(fullVisitorId = 'character'))\n</code></pre>",
      "rawMarkdown": "Make sure when you initially read the CSV data to import it as character. I had this issue too, and if you import it without specifying the fullVisitorId field is character, R will assume numeric and remove the leading zeros from the ID. Something like this would work when you initially read the data:\n\n    train &lt;- read.csv('train.csv', colClasses=c(fullVisitorId = 'character'))",
      "votes": 1,
      "replies": [
        {
          "id": 394987,
          "postDate": "2018-09-27T19:16:45.770Z",
          "content": "<p>Okay. Now I understood what was wrong...but when I save it as csv file using write.csv(), then the fullVisitorId column becomes numeric again. So the same problem happens. What should I do? </p>",
          "rawMarkdown": "Okay. Now I understood what was wrong...but when I save it as csv file using write.csv(), then the fullVisitorId column becomes numeric again. So the same problem happens. What should I do? "
        },
        {
          "id": 395005,
          "postDate": "2018-09-27T20:14:37.817Z",
          "content": "<p>How are you confirming it's numeric after you save it? If you're using software like Excel to view the file after you save it, Excel usually does some undesired auto-formatting. I recommend trying to submit after you <code>write.csv</code> and see if the error persists.</p>",
          "rawMarkdown": "How are you confirming it's numeric after you save it? If you're using software like Excel to view the file after you save it, Excel usually does some undesired auto-formatting. I recommend trying to submit after you `write.csv` and see if the error persists."
        },
        {
          "id": 395037,
          "postDate": "2018-09-27T21:05:06.390Z",
          "content": "<p>So you mean.. I have to run the code on kaggle and submit, not from my local Rstudio and just submit the file?   </p>",
          "rawMarkdown": "So you mean.. I have to run the code on kaggle and submit, not from my local Rstudio and just submit the file?   "
        },
        {
          "id": 395048,
          "postDate": "2018-09-27T21:40:30.093Z",
          "content": "<p>No, you can run local and submit the CSV. I'm just trying to understand why you think <code>write.csv</code> is causing <code>fullVisitorId</code> to become numeric.</p>",
          "rawMarkdown": "No, you can run local and submit the CSV. I'm just trying to understand why you think `write.csv` is causing `fullVisitorId` to become numeric."
        },
        {
          "id": 395101,
          "postDate": "2018-09-28T01:12:04.710Z",
          "content": "<p>It's because I got the same error message. I read the test set and then changed <code>fullVisitorId</code> into character.</p>",
          "rawMarkdown": "It's because I got the same error message. I read the test set and then changed `fullVisitorId` into character."
        },
        {
          "id": 395128,
          "postDate": "2018-09-28T02:31:04.707Z",
          "content": "<p>Have you instead tried <code>train &lt;- read.csv('train.csv', colClasses=list(character='fullVisitorId'))</code></p>",
          "rawMarkdown": "Have you instead tried `train &lt;- read.csv('train.csv', colClasses=list(character='fullVisitorId'))`",
          "votes": 1
        },
        {
          "id": 395129,
          "postDate": "2018-09-28T02:31:51.223Z",
          "content": "<p><code>test &lt;- read.csv('test.csv', colClasses=list(character='fullVisitorId'))</code></p>",
          "rawMarkdown": "`test &lt;- read.csv('test.csv', colClasses=list(character='fullVisitorId'))`"
        },
        {
          "id": 395130,
          "postDate": "2018-09-28T02:32:58.283Z",
          "content": "<p>Or, you can do it how I like to do it, which makes it so I never have to specify it because it automatically detects it as a string.</p>\n\n<pre><code>library(data.table)\ntrain &lt;- fread('train.csv')\ntest &lt;- fread('test.csv')\n</code></pre>",
          "rawMarkdown": "Or, you can do it how I like to do it, which makes it so I never have to specify it because it automatically detects it as a string.\n\n    library(data.table)\n    train &lt;- fread('train.csv')\n    test &lt;- fread('test.csv')\n\n"
        },
        {
          "id": 395173,
          "postDate": "2018-09-28T04:57:31.640Z",
          "content": "<p>Okay, now I got it!! The problem was that I was reading my preprocessed file whose <code>fullVisitorId</code> had already been numeric, so losing all leading zeros. <br>\nBoth fread() and read.csv('test.csv', colClasses = ) work well!  Thank you soooo much everyone :-)  </p>",
          "rawMarkdown": "Okay, now I got it!! The problem was that I was reading my preprocessed file whose `fullVisitorId` had already been numeric, so losing all leading zeros.  \nBoth fread() and read.csv('test.csv', colClasses = ) work well!  Thank you soooo much everyone :-)  "
        }
      ]
    },
    {
      "id": 394937,
      "postDate": "2018-09-27T17:19:02.890Z",
      "content": "<p>Hello, This is my first time participating in a kaggle competition and I'm having trouble submitting my result. I made my model using gbm and made a prediction table like below.</p>\n\n<pre><code>pred_oob = predict(object = model_gbm, newdata = te_df, n.trees = opt_ntree_oob, type = 'response')\npred_oob = ifelse(pred_oob&amp;lt;0, 0, pred_oob)\n\ntest$Predicted = pred_oob    \nmysub = test %&gt;%\n  select(fullVisitorId, Predicted)\n\nmysub = mysub %&gt;%\n  group_by(fullVisitorId) %&gt;%\n  summarise(PredictedLogRevenue = round(sum(Predicted), 5)) \n\nwrite.csv(mysub, file = 'mysub_gbm.csv', row.names = F)\n</code></pre>\n\n<p>Whenever I tried to submit the file, I got the 'fail' message saying ...</p>\n\n<pre><code>ERROR: Unable to find 614143 required key values in the 'fullVisitorId' column\nERROR: Unable to find the required key value '0000000259678714014' in the 'fullVisitorId' column\nERROR: Unable to find the required key value '0000049363351866189' in the 'fullVisitorId' column\nERROR: Unable to find the required key value '0000053049821714864' in the 'fullVisitorId' column\n</code></pre>\n\n<p>So I inspected my submission data again with that values, but...</p>\n\n<pre><code>error = c(614143, 259678714014, 49363351866189, 53049821714864, 59488412965267,  8584037063378, 91131414287111, 117255350596610, 118334805178127, 130646294093000)\n mysub[mysub$fullVisitorId %in% error, ]\n</code></pre>\n\n<p>But there was no empty row...I have no clue from what point I made mistake....Please help!</p>",
      "rawMarkdown": "Hello, This is my first time participating in a kaggle competition and I'm having trouble submitting my result. I made my model using gbm and made a prediction table like below.\n\n    pred_oob = predict(object = model_gbm, newdata = te_df, n.trees = opt_ntree_oob, type = 'response')\n    pred_oob = ifelse(pred_oob&lt;0, 0, pred_oob)\n    \n    test$Predicted = pred_oob    \n    mysub = test %&gt;%\n      select(fullVisitorId, Predicted)\n    \n    mysub = mysub %&gt;%\n      group_by(fullVisitorId) %&gt;%\n      summarise(PredictedLogRevenue = round(sum(Predicted), 5)) \n    \n    write.csv(mysub, file = 'mysub_gbm.csv', row.names = F)\n\nWhenever I tried to submit the file, I got the 'fail' message saying ...\n\n    ERROR: Unable to find 614143 required key values in the 'fullVisitorId' column\n    ERROR: Unable to find the required key value '0000000259678714014' in the 'fullVisitorId' column\n    ERROR: Unable to find the required key value '0000049363351866189' in the 'fullVisitorId' column\n    ERROR: Unable to find the required key value '0000053049821714864' in the 'fullVisitorId' column\n\nSo I inspected my submission data again with that values, but...\n\n    error = c(614143, 259678714014, 49363351866189, 53049821714864, 59488412965267,  8584037063378, 91131414287111, 117255350596610, 118334805178127, 130646294093000)\n     mysub[mysub$fullVisitorId %in% error, ]\n\nBut there was no empty row...I have no clue from what point I made mistake....Please help!\n",
      "votes": 2
    },
    {
      "id": 395132,
      "postDate": "2018-09-28T02:34:09.767Z",
      "content": "<p>I believe your fullVisitorId is numeric instead of character, which drops the leading zeros. Try the following:</p>\n\n<pre><code>submission_sample &lt;- read.csv('../input/sample_submission.csv',  stringsAsFactors=F, colClasses=\"character\")\n\nsubmission &lt;- data.frame(fullVisitorId=submission_sample$fullVisitorId, PredictedLogRevenue=mysub$PredictedLogRevenue)\n\nwrite.csv(submission, file = paste0('../output/your_submission.csv'), row.names=F, quote=F)\n</code></pre>",
      "rawMarkdown": "I believe your fullVisitorId is numeric instead of character, which drops the leading zeros. Try the following:\n\n    submission_sample &lt;- read.csv('../input/sample_submission.csv',  stringsAsFactors=F, colClasses=\"character\")\n    \n    submission &lt;- data.frame(fullVisitorId=submission_sample$fullVisitorId, PredictedLogRevenue=mysub$PredictedLogRevenue)\n        \n    write.csv(submission, file = paste0('../output/your_submission.csv'), row.names=F, quote=F)",
      "replies": [
        {
          "id": 395174,
          "postDate": "2018-09-28T04:59:52.030Z",
          "content": "<p>Thanks yilisg. You're right. It was because my <code>fullVistorId</code> was numeric. Now it perfectly works. </p>",
          "rawMarkdown": "Thanks yilisg. You're right. It was because my `fullVistorId` was numeric. Now it perfectly works. "
        },
        {
          "id": 409135,
          "postDate": "2018-10-23T20:38:04.253Z",
          "content": "<p>yes, but when predicting, doesn't the visitor id needs to be converted to float; the leading zeroes get deleted from some of the Id and i am unable to submit. Can someone help pls?</p>",
          "rawMarkdown": "yes, but when predicting, doesn't the visitor id needs to be converted to float; the leading zeroes get deleted from some of the Id and i am unable to submit. Can someone help pls?\n"
        },
        {
          "id": 409249,
          "postDate": "2018-10-24T02:04:24.820Z",
          "content": "<p>You don't need to input Id column when you predict. You just make predictions and bind the values to the test set. </p>",
          "rawMarkdown": "You don't need to input Id column when you predict. You just make predictions and bind the values to the test set. "
        }
      ]
    },
    {
      "id": 395125,
      "postDate": "2018-09-28T02:20:12.350Z",
      "content": "<p>I am actually also having the same issue submitting, the fullVisitorId is red as character using the method colClasses=c(fullVisitorId = 'character').  So getting 714167 rows instead of 614143 predictions.</p>",
      "rawMarkdown": "I am actually also having the same issue submitting, the fullVisitorId is red as character using the method colClasses=c(fullVisitorId = 'character').  So getting 714167 rows instead of 614143 predictions.",
      "replies": [
        {
          "id": 395137,
          "postDate": "2018-09-28T02:40:16.440Z",
          "content": "<p>Hi, submission_sample should be 617242 x 2 if you run my code above. Not sure how you got 714167, but if you are reading test csv it should contain 804684 rows (of transactions or visits), where a single fullVisitorId could have multiple visits so you'll need to aggregate the sum of the revenues before submitting. You can verify this easily that there are 617242 unique fullVisitorId in test as well.</p>",
          "rawMarkdown": "Hi, submission_sample should be 617242 x 2 if you run my code above. Not sure how you got 714167, but if you are reading test csv it should contain 804684 rows (of transactions or visits), where a single fullVisitorId could have multiple visits so you'll need to aggregate the sum of the revenues before submitting. You can verify this easily that there are 617242 unique fullVisitorId in test as well.\n\n"
        }
      ]
    },
    {
      "id": 395104,
      "postDate": "2018-09-28T01:21:43.560Z",
      "content": "<p>Jean, you might try using write_csv from the readr package, or fwrite from the data.table package. Their parsers might work better. Plus, both are faster than base R's write.csv (especially fwrite).</p>",
      "rawMarkdown": "Jean, you might try using write_csv from the readr package, or fwrite from the data.table package. Their parsers might work better. Plus, both are faster than base R's write.csv (especially fwrite).",
      "replies": [
        {
          "id": 395124,
          "postDate": "2018-09-28T02:17:50.607Z",
          "content": "<p>Thanks John. write_csv() works much faster like you said but sadly.. no difference. \nI think I'm missing something very basic.... have no idea.  </p>",
          "rawMarkdown": "Thanks John. write_csv() works much faster like you said but sadly.. no difference. \nI think I'm missing something very basic.... have no idea.  "
        }
      ]
    },
    {
      "id": 395090,
      "postDate": "2018-09-28T00:34:21.187Z",
      "content": "<p>have you tried check fullVisitorId <code>0000000259678714014</code> in your csv files??</p>",
      "rawMarkdown": "have you tried check fullVisitorId `0000000259678714014` in your csv files??",
      "replies": [
        {
          "id": 395103,
          "postDate": "2018-09-28T01:16:58.743Z",
          "content": "<p>Yes,  I checked every number that appears from the error message like below, and there were no empty values in <code>mysub</code>. </p>\n\n<p>mysub[mysub$fullVisitorId == 0000000259678714014, ]</p>",
          "rawMarkdown": "Yes,  I checked every number that appears from the error message like below, and there were no empty values in `mysub`. \n\nmysub[mysub$fullVisitorId == 0000000259678714014, ]"
        }
      ]
    },
    {
      "id": 394945,
      "postDate": "2018-09-27T17:33:25.940Z",
      "content": "<p>Leading zeros may be an issue.  Is the fullVisitorId field in your data a character column?</p>",
      "rawMarkdown": "Leading zeros may be an issue.  Is the fullVisitorId field in your data a character column?",
      "replies": [
        {
          "id": 394963,
          "postDate": "2018-09-27T18:20:06.567Z",
          "content": "<p>No, it's numeric. Do you mean the predicted values containing zeros are the problem?</p>",
          "rawMarkdown": "No, it's numeric. Do you mean the predicted values containing zeros are the problem?"
        }
      ]
    },
    {
      "id": 394962,
      "postDate": "2018-09-27T18:19:19.367Z",
      "rawMarkdown": "",
      "isDeleted": true
    }
  ],
  "comments": [
    {
      "id": 394967,
      "author_name": "Nick",
      "author_url": "",
      "post_date": "2018-09-27T18:23:39.267000",
      "content": "<p>Make sure when you initially read the CSV data to import it as character. I had this issue too, and if you import it without specifying the fullVisitorId field is character, R will assume numeric and remove the leading zeros from the ID. Something like this would work when you initially read the data:</p>\n\n<pre><code>train &lt;- read.csv('train.csv', colClasses=c(fullVisitorId = 'character'))\n</code></pre>",
      "votes": 1,
      "replies": [
        {
          "id": 394987,
          "author_name": "Jean",
          "author_url": "",
          "post_date": "2018-09-27T19:16:45.770000",
          "content": "<p>Okay. Now I understood what was wrong...but when I save it as csv file using write.csv(), then the fullVisitorId column becomes numeric again. So the same problem happens. What should I do? </p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 395005,
          "author_name": "Nick",
          "author_url": "",
          "post_date": "2018-09-27T20:14:37.817000",
          "content": "<p>How are you confirming it's numeric after you save it? If you're using software like Excel to view the file after you save it, Excel usually does some undesired auto-formatting. I recommend trying to submit after you <code>write.csv</code> and see if the error persists.</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 395037,
          "author_name": "Jean",
          "author_url": "",
          "post_date": "2018-09-27T21:05:06.390000",
          "content": "<p>So you mean.. I have to run the code on kaggle and submit, not from my local Rstudio and just submit the file?   </p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 395048,
          "author_name": "Nick",
          "author_url": "",
          "post_date": "2018-09-27T21:40:30.093000",
          "content": "<p>No, you can run local and submit the CSV. I'm just trying to understand why you think <code>write.csv</code> is causing <code>fullVisitorId</code> to become numeric.</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 395101,
          "author_name": "Jean",
          "author_url": "",
          "post_date": "2018-09-28T01:12:04.710000",
          "content": "<p>It's because I got the same error message. I read the test set and then changed <code>fullVisitorId</code> into character.</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 395128,
          "author_name": "CoreyJamesLevinson",
          "author_url": "",
          "post_date": "2018-09-28T02:31:04.707000",
          "content": "<p>Have you instead tried <code>train &lt;- read.csv('train.csv', colClasses=list(character='fullVisitorId'))</code></p>",
          "votes": 1,
          "replies": []
        },
        {
          "id": 395129,
          "author_name": "CoreyJamesLevinson",
          "author_url": "",
          "post_date": "2018-09-28T02:31:51.223000",
          "content": "<p><code>test &lt;- read.csv('test.csv', colClasses=list(character='fullVisitorId'))</code></p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 395130,
          "author_name": "CoreyJamesLevinson",
          "author_url": "",
          "post_date": "2018-09-28T02:32:58.283000",
          "content": "<p>Or, you can do it how I like to do it, which makes it so I never have to specify it because it automatically detects it as a string.</p>\n\n<pre><code>library(data.table)\ntrain &lt;- fread('train.csv')\ntest &lt;- fread('test.csv')\n</code></pre>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 395173,
          "author_name": "Jean",
          "author_url": "",
          "post_date": "2018-09-28T04:57:31.640000",
          "content": "<p>Okay, now I got it!! The problem was that I was reading my preprocessed file whose <code>fullVisitorId</code> had already been numeric, so losing all leading zeros. <br>\nBoth fread() and read.csv('test.csv', colClasses = ) work well!  Thank you soooo much everyone :-)  </p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 395132,
      "author_name": "yilisg",
      "author_url": "",
      "post_date": "2018-09-28T02:34:09.767000",
      "content": "<p>I believe your fullVisitorId is numeric instead of character, which drops the leading zeros. Try the following:</p>\n\n<pre><code>submission_sample &lt;- read.csv('../input/sample_submission.csv',  stringsAsFactors=F, colClasses=\"character\")\n\nsubmission &lt;- data.frame(fullVisitorId=submission_sample$fullVisitorId, PredictedLogRevenue=mysub$PredictedLogRevenue)\n\nwrite.csv(submission, file = paste0('../output/your_submission.csv'), row.names=F, quote=F)\n</code></pre>",
      "votes": 0,
      "replies": [
        {
          "id": 395174,
          "author_name": "Jean",
          "author_url": "",
          "post_date": "2018-09-28T04:59:52.030000",
          "content": "<p>Thanks yilisg. You're right. It was because my <code>fullVistorId</code> was numeric. Now it perfectly works. </p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 409135,
          "author_name": "Apratim Mishra",
          "author_url": "",
          "post_date": "2018-10-23T20:38:04.253000",
          "content": "<p>yes, but when predicting, doesn't the visitor id needs to be converted to float; the leading zeroes get deleted from some of the Id and i am unable to submit. Can someone help pls?</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 409249,
          "author_name": "Jean",
          "author_url": "",
          "post_date": "2018-10-24T02:04:24.820000",
          "content": "<p>You don't need to input Id column when you predict. You just make predictions and bind the values to the test set. </p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 395125,
      "author_name": "Alphonse Okossi",
      "author_url": "",
      "post_date": "2018-09-28T02:20:12.350000",
      "content": "<p>I am actually also having the same issue submitting, the fullVisitorId is red as character using the method colClasses=c(fullVisitorId = 'character').  So getting 714167 rows instead of 614143 predictions.</p>",
      "votes": 0,
      "replies": [
        {
          "id": 395137,
          "author_name": "yilisg",
          "author_url": "",
          "post_date": "2018-09-28T02:40:16.440000",
          "content": "<p>Hi, submission_sample should be 617242 x 2 if you run my code above. Not sure how you got 714167, but if you are reading test csv it should contain 804684 rows (of transactions or visits), where a single fullVisitorId could have multiple visits so you'll need to aggregate the sum of the revenues before submitting. You can verify this easily that there are 617242 unique fullVisitorId in test as well.</p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 395104,
      "author_name": "JohnM",
      "author_url": "",
      "post_date": "2018-09-28T01:21:43.560000",
      "content": "<p>Jean, you might try using write_csv from the readr package, or fwrite from the data.table package. Their parsers might work better. Plus, both are faster than base R's write.csv (especially fwrite).</p>",
      "votes": 0,
      "replies": [
        {
          "id": 395124,
          "author_name": "Jean",
          "author_url": "",
          "post_date": "2018-09-28T02:17:50.607000",
          "content": "<p>Thanks John. write_csv() works much faster like you said but sadly.. no difference. \nI think I'm missing something very basic.... have no idea.  </p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 395090,
      "author_name": "choco",
      "author_url": "",
      "post_date": "2018-09-28T00:34:21.187000",
      "content": "<p>have you tried check fullVisitorId <code>0000000259678714014</code> in your csv files??</p>",
      "votes": 0,
      "replies": [
        {
          "id": 395103,
          "author_name": "Jean",
          "author_url": "",
          "post_date": "2018-09-28T01:16:58.743000",
          "content": "<p>Yes,  I checked every number that appears from the error message like below, and there were no empty values in <code>mysub</code>. </p>\n\n<p>mysub[mysub$fullVisitorId == 0000000259678714014, ]</p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 394945,
      "author_name": "Dmitriy Guller",
      "author_url": "",
      "post_date": "2018-09-27T17:33:25.940000",
      "content": "<p>Leading zeros may be an issue.  Is the fullVisitorId field in your data a character column?</p>",
      "votes": 0,
      "replies": [
        {
          "id": 394963,
          "author_name": "Jean",
          "author_url": "",
          "post_date": "2018-09-27T18:20:06.567000",
          "content": "<p>No, it's numeric. Do you mean the predicted values containing zeros are the problem?</p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 394962,
      "author_name": "",
      "author_url": "",
      "post_date": "2018-09-27T18:19:19.367000",
      "content": "",
      "votes": 0,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "394967": "Make sure when you initially read the CSV data to import it as character. I had this issue too, and if you import it without specifying the fullVisitorId field is character, R will assume numeric and remove the leading zeros from the ID. Something like this would work when you initially read the data:\n\n    train &lt;- read.csv('train.csv', colClasses=c(fullVisitorId = 'character'))",
    "394937": "Hello, This is my first time participating in a kaggle competition and I'm having trouble submitting my result. I made my model using gbm and made a prediction table like below.\n\n    pred_oob = predict(object = model_gbm, newdata = te_df, n.trees = opt_ntree_oob, type = 'response')\n    pred_oob = ifelse(pred_oob&lt;0, 0, pred_oob)\n    \n    test$Predicted = pred_oob    \n    mysub = test %&gt;%\n      select(fullVisitorId, Predicted)\n    \n    mysub = mysub %&gt;%\n      group_by(fullVisitorId) %&gt;%\n      summarise(PredictedLogRevenue = round(sum(Predicted), 5)) \n    \n    write.csv(mysub, file = 'mysub_gbm.csv', row.names = F)\n\nWhenever I tried to submit the file, I got the 'fail' message saying ...\n\n    ERROR: Unable to find 614143 required key values in the 'fullVisitorId' column\n    ERROR: Unable to find the required key value '0000000259678714014' in the 'fullVisitorId' column\n    ERROR: Unable to find the required key value '0000049363351866189' in the 'fullVisitorId' column\n    ERROR: Unable to find the required key value '0000053049821714864' in the 'fullVisitorId' column\n\nSo I inspected my submission data again with that values, but...\n\n    error = c(614143, 259678714014, 49363351866189, 53049821714864, 59488412965267,  8584037063378, 91131414287111, 117255350596610, 118334805178127, 130646294093000)\n     mysub[mysub$fullVisitorId %in% error, ]\n\nBut there was no empty row...I have no clue from what point I made mistake....Please help!\n",
    "395132": "I believe your fullVisitorId is numeric instead of character, which drops the leading zeros. Try the following:\n\n    submission_sample &lt;- read.csv('../input/sample_submission.csv',  stringsAsFactors=F, colClasses=\"character\")\n    \n    submission &lt;- data.frame(fullVisitorId=submission_sample$fullVisitorId, PredictedLogRevenue=mysub$PredictedLogRevenue)\n        \n    write.csv(submission, file = paste0('../output/your_submission.csv'), row.names=F, quote=F)",
    "395125": "I am actually also having the same issue submitting, the fullVisitorId is red as character using the method colClasses=c(fullVisitorId = 'character').  So getting 714167 rows instead of 614143 predictions.",
    "395104": "Jean, you might try using write_csv from the readr package, or fwrite from the data.table package. Their parsers might work better. Plus, both are faster than base R's write.csv (especially fwrite).",
    "395090": "have you tried check fullVisitorId `0000000259678714014` in your csv files??",
    "394945": "Leading zeros may be an issue.  Is the fullVisitorId field in your data a character column?",
    "394962": ""
  }
}