{
  "id": 114046,
  "title": "Why meter_reading is negative?",
  "url": "/competitions/ashrae-energy-prediction/discussion/114046",
  "author_name": "",
  "post_date": "2019-10-23T20:30:11.586941Z",
  "votes": null,
  "comment_count": 5,
  "views": 0,
  "content": "<p>I am a beginner in machine learning.\nMissing values were corrected with mode values, and categorical variables were encoded with LabelEncoding.\nMy predicted value is negative.\nIf you know some way, could you show some way?</p>\n\n<p>row_id  meter_reading\n0   0   -0.575748\n1   1   -1.402410\n2   2   -1.358878\n3   3   -0.689834\n4   4   1.316772</p>",
  "messages": [
    {
      "id": "656040",
      "postDate": "10/23/2019 20:30:11",
      "content": "<p>I am a beginner in machine learning.\nMissing values were corrected with mode values, and categorical variables were encoded with LabelEncoding.\nMy predicted value is negative.\nIf you know some way, could you show some way?</p>\n\n<p>row_id  meter_reading\n0   0   -0.575748\n1   1   -1.402410\n2   2   -1.358878\n3   3   -0.689834\n4   4   1.316772</p>",
      "rawMarkdown": "I am a beginner in machine learning.\nMissing values were corrected with mode values, and categorical variables were encoded with LabelEncoding.\nMy predicted value is negative.\nIf you know some way, could you show some way?\n\nrow_id\tmeter_reading\n0\t0\t-0.575748\n1\t1\t-1.402410\n2\t2\t-1.358878\n3\t3\t-0.689834\n4\t4\t1.316772",
      "votes": null
    },
    {
      "id": "656050",
      "postDate": "10/23/2019 20:54:19",
      "content": "<p>A model trained on only positive (negative) target values doesn't necessarily predict only positive (negative) values, that's not strange for a regression task. I'd just crop negative values to zero, but if your models predicts values too far from the expected range (y&gt;0), it probably means that the model is underfitting a bit too much.\nUse the competition's RMSLE metric to understand how far you are from a good model, maybe it's not that bad after all...</p>",
      "rawMarkdown": "A model trained on only positive (negative) target values doesn't necessarily predict only positive (negative) values, that's not strange for a regression task. I'd just crop negative values to zero, but if your models predicts values too far from the expected range (y&gt;0), it probably means that the model is underfitting a bit too much.\nUse the competition's RMSLE metric to understand how far you are from a good model, maybe it's not that bad after all...",
      "votes": null
    },
    {
      "id": "656091",
      "postDate": "10/23/2019 22:33:42",
      "content": "<h1>replace any negative value in prediction with 0</h1>\n\n<p>res[res &lt; 0] = 0</p>\n\n<p>This is what is use when preparing the submission - res is the predicted values for test</p>",
      "rawMarkdown": "# replace any negative value in prediction with 0\nres[res &lt; 0] = 0\n\nThis is what is use when preparing the submission - res is the predicted values for test",
      "votes": null
    },
    {
      "id": "656322",
      "postDate": "10/24/2019 06:38:27",
      "content": "<p>Check if negative values are less than 1% it's better to drop them.</p>",
      "rawMarkdown": "Check if negative values are less than 1% it's better to drop them.",
      "votes": null
    },
    {
      "id": "656416",
      "postDate": "10/24/2019 08:49:46",
      "content": "<p>You can probably just use, <strong>submisssion[ submission['meter_reading'] &lt; 0 ] = 0</strong>, energy consumption cannot be negative unless we talking of fraud (I work in that field) 😏 </p>",
      "rawMarkdown": "You can probably just use, **submisssion[ submission['meter_reading'] &lt; 0 ] = 0**, energy consumption cannot be negative unless we talking of fraud (I work in that field) 😏",
      "votes": null
    },
    {
      "id": "657659",
      "postDate": "10/25/2019 10:39:26",
      "content": "<p>Thank you! I reflect on the lack of understanding of the model.</p>",
      "rawMarkdown": "Thank you! I reflect on the lack of understanding of the model.",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 656050,
      "author_name": "d3muxx",
      "author_url": "",
      "post_date": "10/23/2019 20:54:19",
      "content": "<p>A model trained on only positive (negative) target values doesn't necessarily predict only positive (negative) values, that's not strange for a regression task. I'd just crop negative values to zero, but if your models predicts values too far from the expected range (y&gt;0), it probably means that the model is underfitting a bit too much.\nUse the competition's RMSLE metric to understand how far you are from a good model, maybe it's not that bad after all...</p>",
      "votes": null,
      "replies": [
        {
          "id": 657659,
          "author_name": "mrboupp",
          "author_url": "",
          "post_date": "10/25/2019 10:39:26",
          "content": "<p>Thank you! I reflect on the lack of understanding of the model.</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 656091,
      "author_name": "pcjimmmy",
      "author_url": "",
      "post_date": "10/23/2019 22:33:42",
      "content": "<h1>replace any negative value in prediction with 0</h1>\n\n<p>res[res &lt; 0] = 0</p>\n\n<p>This is what is use when preparing the submission - res is the predicted values for test</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 656322,
      "author_name": "shishu1421",
      "author_url": "",
      "post_date": "10/24/2019 06:38:27",
      "content": "<p>Check if negative values are less than 1% it's better to drop them.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 656416,
      "author_name": "drexpz",
      "author_url": "",
      "post_date": "10/24/2019 08:49:46",
      "content": "<p>You can probably just use, <strong>submisssion[ submission['meter_reading'] &lt; 0 ] = 0</strong>, energy consumption cannot be negative unless we talking of fraud (I work in that field) 😏 </p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "656040": "I am a beginner in machine learning.\nMissing values were corrected with mode values, and categorical variables were encoded with LabelEncoding.\nMy predicted value is negative.\nIf you know some way, could you show some way?\n\nrow_id\tmeter_reading\n0\t0\t-0.575748\n1\t1\t-1.402410\n2\t2\t-1.358878\n3\t3\t-0.689834\n4\t4\t1.316772",
    "656050": "A model trained on only positive (negative) target values doesn't necessarily predict only positive (negative) values, that's not strange for a regression task. I'd just crop negative values to zero, but if your models predicts values too far from the expected range (y&gt;0), it probably means that the model is underfitting a bit too much.\nUse the competition's RMSLE metric to understand how far you are from a good model, maybe it's not that bad after all...",
    "656091": "# replace any negative value in prediction with 0\nres[res &lt; 0] = 0\n\nThis is what is use when preparing the submission - res is the predicted values for test",
    "656322": "Check if negative values are less than 1% it's better to drop them.",
    "656416": "You can probably just use, **submisssion[ submission['meter_reading'] &lt; 0 ] = 0**, energy consumption cannot be negative unless we talking of fraud (I work in that field) 😏",
    "657659": "Thank you! I reflect on the lack of understanding of the model."
  },
  "source": "meta"
}