How to use random forest with large number of categorical features and categories?
You have a few options on your hand:
Option 1 - Augment you dataset with additional Supplier-related features
Do you have additional features about the supplier that makes sense to augment into your dataset ? For e.g. you might be able to replace the Supplier field with something like &quot;Years in Business&quot; , &quot;Primary Industry&quot;, &quot;Reputation Score&quot; etc.
That way you convert the categorical variable into something more meaningful that can be compared across the universe of Suppliers.
Go this route if and only if you have meaningful and easily accessible features for your problem domain.
Option 2 - Encode each Supplier with a unique integer
I know this sounds stupid - but it really works for Random Forest models (wouldn't work on simple Linear Regression for sure).
Random Forest models are scale invariant. They won't get biased towards suppliers with a larger numeric Supplier Id. They'll figure out the best way to split your Supplier Ids to meet your objective function.
I would recommend Option 2 to start with since that is the simplest.