250 Categorical values

I have a dataset which has only categorical values. As I came across a few articles people suggested that KNN / Random forest would work for dataset like this. Though in R it couldn't handle as if contains more than 53 categories.

Whereas in Sklearn, I used linear regression against each column to the column which I was predicting. After which I created a weighted average of all the outputs. But I'm pretty sure it's not the right way.

Can anyone suggest a better way?
PS : The dataset contains 4 columns with only categorical values. With 200 - 250 different categories in each column.

• – Bruno Lubascher Jul 22 '18 at 17:05
• you can have a look at datascience.stackexchange.com/a/35646/54395 for some categorical data usage with SKlearn – Bruno Lubascher Jul 22 '18 at 17:07
• I saw the post. Will it be any good for a dataset with 4 columns with categorical values. Where each one has 200 - 250 range of categorical data – Kabeer Khan Jul 23 '18 at 3:40
• it will work (i.e. run). If it will be any good is up to you. That is the beauty of Data Science: you get to experiment to find out. – Bruno Lubascher Jul 23 '18 at 6:52
• What are you trying to achieve with such data? – mapto Jul 23 '18 at 14:22

I think the 53 category issue is specific to R's randomForest package. If you're set on using a random forest, try other packages like ranger and Rborist.