{
  "id": 68391,
  "title": "ValueError: Input contains NaN, infinity or a value too large for dtype('float32')",
  "url": "/competitions/ga-customer-revenue-prediction/discussion/68391",
  "author_name": "",
  "post_date": "2018-10-12T08:31:40.631629100Z",
  "votes": 1,
  "comment_count": 3,
  "views": 0,
  "content": "<pre><code>gb_est = GradientBoostingRegressor(**gb_params)\ngb_est.fit(x_dev,y_dev)\n</code></pre>\n\n<p>ouput:</p>\n\n<pre><code>           raise ValueError(\"Input contains NaN, infinity\"\n---&gt;                           \" or a value too large for %r.\" % X.dtype)\nValueError: Input contains NaN, infinity or a value too large for dtype('float32').\n</code></pre>\n\n<p>Anyone use GDBT or RF meet this problem?\ni use the .fillna ,but it didn't work and checked the infinity also no problem!\ni have no idea how to deal with it! :(</p>",
  "messages": [
    {
      "id": "402746",
      "postDate": "10/12/2018 08:31:40",
      "content": "<pre><code>gb_est = GradientBoostingRegressor(**gb_params)\ngb_est.fit(x_dev,y_dev)\n</code></pre>\n\n<p>ouput:</p>\n\n<pre><code>           raise ValueError(\"Input contains NaN, infinity\"\n---&gt;                           \" or a value too large for %r.\" % X.dtype)\nValueError: Input contains NaN, infinity or a value too large for dtype('float32').\n</code></pre>\n\n<p>Anyone use GDBT or RF meet this problem?\ni use the .fillna ,but it didn't work and checked the infinity also no problem!\ni have no idea how to deal with it! :(</p>",
      "rawMarkdown": "gb_est = GradientBoostingRegressor(**gb_params)\n    gb_est.fit(x_dev,y_dev)\nouput:\n  \n\n               raise ValueError(\"Input contains NaN, infinity\"\n    ---&gt;                           \" or a value too large for %r.\" % X.dtype)\n    ValueError: Input contains NaN, infinity or a value too large for dtype('float32').\n\nAnyone use GDBT or RF meet this problem?\ni use the .fillna ,but it didn't work and checked the infinity also no problem!\ni have no idea how to deal with it! :(",
      "votes": null
    },
    {
      "id": "402750",
      "postDate": "10/12/2018 08:42:12",
      "content": "<p>don't divide by zero. maybe it's in your feature engineering/derived features. </p>",
      "rawMarkdown": "don't divide by zero. maybe it's in your feature engineering/derived features.",
      "votes": null
    },
    {
      "id": "402838",
      "postDate": "10/12/2018 12:36:44",
      "content": "<p>Inspect your feature matrix - you might have some weird data types there (e.g. you didn't convert a string to int or somesuch). It's a weird message to get in such situation, but I do recall running into the problem myself a few times.</p>",
      "rawMarkdown": "Inspect your feature matrix - you might have some weird data types there (e.g. you didn't convert a string to int or somesuch). It's a weird message to get in such situation, but I do recall running into the problem myself a few times.",
      "votes": null
    },
    {
      "id": "403253",
      "postDate": "10/13/2018 07:23:16",
      "content": "<p>thanks for your advices ! </p>",
      "rawMarkdown": "thanks for your advices !",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 402750,
      "author_name": "leafar",
      "author_url": "",
      "post_date": "10/12/2018 08:42:12",
      "content": "<p>don't divide by zero. maybe it's in your feature engineering/derived features. </p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 402838,
      "author_name": "konradb",
      "author_url": "",
      "post_date": "10/12/2018 12:36:44",
      "content": "<p>Inspect your feature matrix - you might have some weird data types there (e.g. you didn't convert a string to int or somesuch). It's a weird message to get in such situation, but I do recall running into the problem myself a few times.</p>",
      "votes": null,
      "replies": [
        {
          "id": 403253,
          "author_name": "kangzhang",
          "author_url": "",
          "post_date": "10/13/2018 07:23:16",
          "content": "<p>thanks for your advices ! </p>",
          "votes": null,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "402746": "gb_est = GradientBoostingRegressor(**gb_params)\n    gb_est.fit(x_dev,y_dev)\nouput:\n  \n\n               raise ValueError(\"Input contains NaN, infinity\"\n    ---&gt;                           \" or a value too large for %r.\" % X.dtype)\n    ValueError: Input contains NaN, infinity or a value too large for dtype('float32').\n\nAnyone use GDBT or RF meet this problem?\ni use the .fillna ,but it didn't work and checked the infinity also no problem!\ni have no idea how to deal with it! :(",
    "402750": "don't divide by zero. maybe it's in your feature engineering/derived features.",
    "402838": "Inspect your feature matrix - you might have some weird data types there (e.g. you didn't convert a string to int or somesuch). It's a weird message to get in such situation, but I do recall running into the problem myself a few times.",
    "403253": "thanks for your advices !"
  },
  "source": "meta"
}