{
  "id": 23249,
  "title": "Dealing with NA",
  "url": "/competitions/bosch-production-line-performance/discussion/23249",
  "author_name": "",
  "post_date": "2016-09-01T11:45:29.067Z",
  "votes": null,
  "comment_count": 2,
  "views": 487,
  "content": "<p>Hi,\nI am training vw with train_numeric, but I am thinking what to do with NA values.  I am setting them to 0, but it gives rather poor effects on such sparse dataset.(0.18704)\nWhat is best way of filing missing fields for vw?</p>",
  "messages": [
    {
      "id": "133298",
      "postDate": "09/01/2016 11:45:29",
      "content": "<p>Hi,\nI am training vw with train_numeric, but I am thinking what to do with NA values.  I am setting them to 0, but it gives rather poor effects on such sparse dataset.(0.18704)\nWhat is best way of filing missing fields for vw?</p>",
      "rawMarkdown": "Hi,\r\nI am training vw with train_numeric, but I am thinking what to do with NA values.  I am setting them to 0, but it gives rather poor effects on such sparse dataset.(0.18704)\r\nWhat is best way of filing missing fields for vw?",
      "votes": null
    },
    {
      "id": "133311",
      "postDate": "09/01/2016 13:15:51",
      "content": "<p>Hi Tomek,</p>\n\n<p>I am filling them with the column mean:</p>\n\n<pre><code>for (i in 1:ncol(train_numeric)){\n  train_numeric[is.na(train_numeric[,i]), i] &lt;- mean(train_numeric[,i], na.rm = TRUE)\n}\n</code></pre>\n\n<p>I think that is pretty standart. You could also set up a model for predicting the NAs based on the values in the other columns.</p>\n\n<p>Best,\nFelix</p>",
      "rawMarkdown": "Hi Tomek,\r\n\r\nI am filling them with the column mean:\r\n\r\n\r\n    for (i in 1:ncol(train_numeric)){\r\n      train_numeric[is.na(train_numeric[,i]), i] <- mean(train_numeric[,i], na.rm = TRUE)\r\n    }\r\n\r\nI think that is pretty standart. You could also set up a model for predicting the NAs based on the values in the other columns.\r\n\r\nBest,\r\nFelix",
      "votes": null
    },
    {
      "id": "133313",
      "postDate": "09/01/2016 13:26:42",
      "content": "<p>hi tomek,</p>\n\n<p>glrm from H2o seems to be a good approach for filling missing values</p>\n\n<p>take care</p>\n\n<p>uwe</p>",
      "rawMarkdown": "hi tomek,\r\n\r\nglrm from H2o seems to be a good approach for filling missing values\r\n\r\ntake care\r\n\r\nuwe",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 133311,
      "author_name": "felixxxxxx",
      "author_url": "",
      "post_date": "09/01/2016 13:15:51",
      "content": "<p>Hi Tomek,</p>\n\n<p>I am filling them with the column mean:</p>\n\n<pre><code>for (i in 1:ncol(train_numeric)){\n  train_numeric[is.na(train_numeric[,i]), i] &lt;- mean(train_numeric[,i], na.rm = TRUE)\n}\n</code></pre>\n\n<p>I think that is pretty standart. You could also set up a model for predicting the NAs based on the values in the other columns.</p>\n\n<p>Best,\nFelix</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 133313,
      "author_name": "nappon",
      "author_url": "",
      "post_date": "09/01/2016 13:26:42",
      "content": "<p>hi tomek,</p>\n\n<p>glrm from H2o seems to be a good approach for filling missing values</p>\n\n<p>take care</p>\n\n<p>uwe</p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "133298": "Hi,\r\nI am training vw with train_numeric, but I am thinking what to do with NA values.  I am setting them to 0, but it gives rather poor effects on such sparse dataset.(0.18704)\r\nWhat is best way of filing missing fields for vw?",
    "133311": "Hi Tomek,\r\n\r\nI am filling them with the column mean:\r\n\r\n\r\n    for (i in 1:ncol(train_numeric)){\r\n      train_numeric[is.na(train_numeric[,i]), i] <- mean(train_numeric[,i], na.rm = TRUE)\r\n    }\r\n\r\nI think that is pretty standart. You could also set up a model for predicting the NAs based on the values in the other columns.\r\n\r\nBest,\r\nFelix",
    "133313": "hi tomek,\r\n\r\nglrm from H2o seems to be a good approach for filling missing values\r\n\r\ntake care\r\n\r\nuwe"
  },
  "source": "meta"
}