# Random forest hyperparameter to control misclassification

May I know what hyperparameter to tune for random forest classifier to control misclassification? I'm doing a 5-class classification problem and it turns out that most classes are been misclassified for the major class.

Currently, I set the following hyperparameters

model = RandomForestClassifier(n_estimators=200,max_depth=7,
max_features=.4, min_samples_leaf=2)


In total, I have 40 features, so 40% of the features (16-features ) are used to build the trees.

2. Artificially balance (or improve the balance of) your dataset. This can be done in (at least) two ways: under-sampling or over-sampling. To undersample, randomly down select from your larger classes (e.g. since foot and car are a lot larger than the rest, maybe you only train using half the data from each of those classes--chosen at random). You could take this the extreme and say if your smallest class has $$N$$ elements, then randomly select $$N$$ elements from each class for training. To oversample, you could duplicate your smaller classes some number of times. If there's a meaningful way to add noise to this oversampling that will probably help (so you don't simply have exact duplicates).