{
  "id": 493447,
  "title": "Column Transfromer OneHot Memory Issue",
  "url": "/competitions/home-credit-credit-risk-model-stability/discussion/493447",
  "author_name": "",
  "post_date": "2024-04-13T13:16:03.687160500Z",
  "votes": 3,
  "comment_count": 3,
  "views": 0,
  "content": "<p>Has anyone successfully implemented one hot encoding, because many popular notebooks don't use it and it takes more than 22 GB of data for an 8 GB dataset that I am fitting into it. <br>\nIt overflows on memory each time and remainder=passthrough is the main cause, it's fine if I do drop, but I need the other data. I don't understand why an 8GB dataset uses that much memory.</p>",
  "messages": [
    {
      "id": "2750124",
      "postDate": "04/13/2024 13:16:03",
      "content": "<p>Has anyone successfully implemented one hot encoding, because many popular notebooks don't use it and it takes more than 22 GB of data for an 8 GB dataset that I am fitting into it. <br>\nIt overflows on memory each time and remainder=passthrough is the main cause, it's fine if I do drop, but I need the other data. I don't understand why an 8GB dataset uses that much memory.</p>",
      "rawMarkdown": "Has anyone successfully implemented one hot encoding, because many popular notebooks don't use it and it takes more than 22 GB of data for an 8 GB dataset that I am fitting into it. \nIt overflows on memory each time and remainder=passthrough is the main cause, it's fine if I do drop, but I need the other data. I don't understand why an 8GB dataset uses that much memory.",
      "votes": null
    },
    {
      "id": "2750178",
      "postDate": "04/13/2024 13:51:40",
      "content": "<p>You should look at the number of categories first and then decide if one-hot is needed. If you have too many categories, then one-hot will do more harm than good <a href=\"https://www.kaggle.com/kawaiicoderuwu\" target=\"_blank\">@kawaiicoderuwu</a> </p>",
      "rawMarkdown": "You should look at the number of categories first and then decide if one-hot is needed. If you have too many categories, then one-hot will do more harm than good @kawaiicoderuwu",
      "votes": null
    },
    {
      "id": "2750374",
      "postDate": "04/13/2024 16:12:45",
      "content": "<p>I tried one-hot encoding, but without significant gain (about +0.001). Moreover, many popular packages support preprocessing of categorical data, e.g. \"LightGBM offers good accuracy with integer-coded categorical features\", AutoML libs also provide processing of categories using label encoding, one-hot encoding, etc. So I decided to reject the idea of preprocessing categorical data using one-hot encoding (at least for now).</p>",
      "rawMarkdown": "I tried one-hot encoding, but without significant gain (about +0.001). Moreover, many popular packages support preprocessing of categorical data, e.g. \"LightGBM offers good accuracy with integer-coded categorical features\", AutoML libs also provide processing of categories using label encoding, one-hot encoding, etc. So I decided to reject the idea of preprocessing categorical data using one-hot encoding (at least for now).",
      "votes": null
    },
    {
      "id": "2750991",
      "postDate": "04/14/2024 00:41:10",
      "content": "<p>Oh I thought onehot or label encoding was always needed with categorical data. I always learn something new in these competitions :)</p>",
      "rawMarkdown": "Oh I thought onehot or label encoding was always needed with categorical data. I always learn something new in these competitions :)",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 2750178,
      "author_name": "ravi20076",
      "author_url": "",
      "post_date": "04/13/2024 13:51:40",
      "content": "<p>You should look at the number of categories first and then decide if one-hot is needed. If you have too many categories, then one-hot will do more harm than good <a href=\"https://www.kaggle.com/kawaiicoderuwu\" target=\"_blank\">@kawaiicoderuwu</a> </p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 2750374,
      "author_name": "andreynesterov",
      "author_url": "",
      "post_date": "04/13/2024 16:12:45",
      "content": "<p>I tried one-hot encoding, but without significant gain (about +0.001). Moreover, many popular packages support preprocessing of categorical data, e.g. \"LightGBM offers good accuracy with integer-coded categorical features\", AutoML libs also provide processing of categories using label encoding, one-hot encoding, etc. So I decided to reject the idea of preprocessing categorical data using one-hot encoding (at least for now).</p>",
      "votes": null,
      "replies": [
        {
          "id": 2750991,
          "author_name": "kawaiicoderuwu",
          "author_url": "",
          "post_date": "04/14/2024 00:41:10",
          "content": "<p>Oh I thought onehot or label encoding was always needed with categorical data. I always learn something new in these competitions :)</p>",
          "votes": null,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "2750124": "Has anyone successfully implemented one hot encoding, because many popular notebooks don't use it and it takes more than 22 GB of data for an 8 GB dataset that I am fitting into it. \nIt overflows on memory each time and remainder=passthrough is the main cause, it's fine if I do drop, but I need the other data. I don't understand why an 8GB dataset uses that much memory.",
    "2750178": "You should look at the number of categories first and then decide if one-hot is needed. If you have too many categories, then one-hot will do more harm than good @kawaiicoderuwu",
    "2750374": "I tried one-hot encoding, but without significant gain (about +0.001). Moreover, many popular packages support preprocessing of categorical data, e.g. \"LightGBM offers good accuracy with integer-coded categorical features\", AutoML libs also provide processing of categories using label encoding, one-hot encoding, etc. So I decided to reject the idea of preprocessing categorical data using one-hot encoding (at least for now).",
    "2750991": "Oh I thought onehot or label encoding was always needed with categorical data. I always learn something new in these competitions :)"
  },
  "source": "meta"
}