{
  "id": 41680,
  "title": "Is it a bad idea to implement it in a neural network?",
  "url": "/competitions/favorita-grocery-sales-forecasting/discussion/41680",
  "author_name": "Ben Fung",
  "post_date": "2017-10-22T16:01:29.325000",
  "votes": 0,
  "comment_count": 6,
  "views": 0,
  "content": "<p>Since there are store and item number are categorical and very important to this dataset, I am wondering if using a neural network for the dataset is impossible. Is there anyway you can transform the data so that it can be fit into a neural network? I have tried scikit learn label encoder and the result is pretty frustrating.</p>",
  "messages": [
    {
      "id": 234237,
      "postDate": "2017-10-22T18:16:37.860Z",
      "content": "<p>There is something like Embedding Layer in Keras, which deals very well with categorical features. You just have to encode them as numbers. It basically does one hot encoding without having to do any transformations. Here you have a nice example, how to use it:\n<a href=\"https://www.kaggle.com/lystdo/beat-kkbox-benchmark-without-using-metadata-0-62\">https://www.kaggle.com/lystdo/beat-kkbox-benchmark-without-using-metadata-0-62</a></p>",
      "rawMarkdown": "There is something like Embedding Layer in Keras, which deals very well with categorical features. You just have to encode them as numbers. It basically does one hot encoding without having to do any transformations. Here you have a nice example, how to use it:\nhttps://www.kaggle.com/lystdo/beat-kkbox-benchmark-without-using-metadata-0-62",
      "votes": 4
    },
    {
      "id": 241935,
      "postDate": "2017-11-10T06:55:10.040Z",
      "content": "<p>You can use LabelBinarizer from sklearn.preprocessing</p>",
      "rawMarkdown": "You can use LabelBinarizer from sklearn.preprocessing",
      "votes": 1
    },
    {
      "id": 259612,
      "postDate": "2017-12-18T17:58:48.547Z",
      "content": "<p>I had the same problem. What I did was read the data in chunks storing the unique levels of all the categorical variables. Then using an encoder like the sklearn.preprocessing.CategoricalEncoder or sklearn.preprocessing.LabelBinarizer.</p>\n\n<p>I found this entire process tedious hence decided to do something. I have created a module that automates all this - <a href=\"https://github.com/yashu-seth/dummyPy\">dummyPy</a>.</p>\n\n<p>Here is a small tutorial on this - <a href=\"https://yashuseth.wordpress.com/2017/12/14/how-to-one-hot-encode-categorical-variables-of-a-large-dataset-in-python/\">How to One Hot Encode Categorical Variables of a Large Dataset in Python?</a></p>",
      "rawMarkdown": "I had the same problem. What I did was read the data in chunks storing the unique levels of all the categorical variables. Then using an encoder like the sklearn.preprocessing.CategoricalEncoder or sklearn.preprocessing.LabelBinarizer.\n\nI found this entire process tedious hence decided to do something. I have created a module that automates all this - [dummyPy](https://github.com/yashu-seth/dummyPy).\n\nHere is a small tutorial on this - [How to One Hot Encode Categorical Variables of a Large Dataset in Python?](https://yashuseth.wordpress.com/2017/12/14/how-to-one-hot-encode-categorical-variables-of-a-large-dataset-in-python/)"
    },
    {
      "id": 236082,
      "postDate": "2017-10-26T16:51:28.040Z",
      "content": "<p>thanks kamill!\nseems like Keras is always the easiest way to deal with neural network!</p>",
      "rawMarkdown": "thanks kamill!\nseems like Keras is always the easiest way to deal with neural network!"
    },
    {
      "id": 234214,
      "postDate": "2017-10-22T17:19:30.187Z",
      "content": "<p>Well, one hot encoding should come in handy...</p>",
      "rawMarkdown": "Well, one hot encoding should come in handy..."
    },
    {
      "id": 234197,
      "postDate": "2017-10-22T16:01:29.327Z",
      "content": "<p>Since there are store and item number are categorical and very important to this dataset, I am wondering if using a neural network for the dataset is impossible. Is there anyway you can transform the data so that it can be fit into a neural network? I have tried scikit learn label encoder and the result is pretty frustrating.</p>",
      "rawMarkdown": "Since there are store and item number are categorical and very important to this dataset, I am wondering if using a neural network for the dataset is impossible. Is there anyway you can transform the data so that it can be fit into a neural network? I have tried scikit learn label encoder and the result is pretty frustrating."
    },
    {
      "id": 259622,
      "postDate": "2017-12-18T18:27:31.543Z",
      "rawMarkdown": "",
      "isDeleted": true
    }
  ],
  "comments": [
    {
      "id": 234237,
      "author_name": "Kamil Zieliński",
      "author_url": "",
      "post_date": "2017-10-22T18:16:37.860000",
      "content": "<p>There is something like Embedding Layer in Keras, which deals very well with categorical features. You just have to encode them as numbers. It basically does one hot encoding without having to do any transformations. Here you have a nice example, how to use it:\n<a href=\"https://www.kaggle.com/lystdo/beat-kkbox-benchmark-without-using-metadata-0-62\">https://www.kaggle.com/lystdo/beat-kkbox-benchmark-without-using-metadata-0-62</a></p>",
      "votes": 4,
      "replies": []
    },
    {
      "id": 241935,
      "author_name": "Yashu Seth",
      "author_url": "",
      "post_date": "2017-11-10T06:55:10.040000",
      "content": "<p>You can use LabelBinarizer from sklearn.preprocessing</p>",
      "votes": 1,
      "replies": []
    },
    {
      "id": 259612,
      "author_name": "Yashu Seth",
      "author_url": "",
      "post_date": "2017-12-18T17:58:48.547000",
      "content": "<p>I had the same problem. What I did was read the data in chunks storing the unique levels of all the categorical variables. Then using an encoder like the sklearn.preprocessing.CategoricalEncoder or sklearn.preprocessing.LabelBinarizer.</p>\n\n<p>I found this entire process tedious hence decided to do something. I have created a module that automates all this - <a href=\"https://github.com/yashu-seth/dummyPy\">dummyPy</a>.</p>\n\n<p>Here is a small tutorial on this - <a href=\"https://yashuseth.wordpress.com/2017/12/14/how-to-one-hot-encode-categorical-variables-of-a-large-dataset-in-python/\">How to One Hot Encode Categorical Variables of a Large Dataset in Python?</a></p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 236082,
      "author_name": "Ben Fung",
      "author_url": "",
      "post_date": "2017-10-26T16:51:28.040000",
      "content": "<p>thanks kamill!\nseems like Keras is always the easiest way to deal with neural network!</p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 234214,
      "author_name": "Konrad Banachewicz",
      "author_url": "",
      "post_date": "2017-10-22T17:19:30.187000",
      "content": "<p>Well, one hot encoding should come in handy...</p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 259622,
      "author_name": "",
      "author_url": "",
      "post_date": "2017-12-18T18:27:31.543000",
      "content": "",
      "votes": 0,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "234237": "There is something like Embedding Layer in Keras, which deals very well with categorical features. You just have to encode them as numbers. It basically does one hot encoding without having to do any transformations. Here you have a nice example, how to use it:\nhttps://www.kaggle.com/lystdo/beat-kkbox-benchmark-without-using-metadata-0-62",
    "241935": "You can use LabelBinarizer from sklearn.preprocessing",
    "259612": "I had the same problem. What I did was read the data in chunks storing the unique levels of all the categorical variables. Then using an encoder like the sklearn.preprocessing.CategoricalEncoder or sklearn.preprocessing.LabelBinarizer.\n\nI found this entire process tedious hence decided to do something. I have created a module that automates all this - [dummyPy](https://github.com/yashu-seth/dummyPy).\n\nHere is a small tutorial on this - [How to One Hot Encode Categorical Variables of a Large Dataset in Python?](https://yashuseth.wordpress.com/2017/12/14/how-to-one-hot-encode-categorical-variables-of-a-large-dataset-in-python/)",
    "236082": "thanks kamill!\nseems like Keras is always the easiest way to deal with neural network!",
    "234214": "Well, one hot encoding should come in handy...",
    "234197": "Since there are store and item number are categorical and very important to this dataset, I am wondering if using a neural network for the dataset is impossible. Is there anyway you can transform the data so that it can be fit into a neural network? I have tried scikit learn label encoder and the result is pretty frustrating.",
    "259622": ""
  }
}