# How to increase the performance of random forest classifier?

I have a text classification task. These are the metrics for different languages at present:

class1: 0.6823
class2: 0.7450
class3: 0.66
class4: 0.6719


How can I increase the performance of my random forest classifier in order to reach 90% accuracy? I already tried increasing the number of estimators and playing with the hyper-parameters that scikit provides, but I cannot significantly increase its performance. What hyper-parameter do I configure in order to increase its performance?

This is my current setup:

# For tfidf:
tfidf_vect = TfidfVectorizer(norm=u'l1', use_idf=True, smooth_idf=True,
sublinear_tf=False, min_df=2, stop_words=set(my_stop_words))

# For RF:
rbf = RandomForestClassifier(n_estimators=10000, criterion='entropy', max_depth=10000,
max_leaf_nodes=None, bootstrap=True, oob_score=False,
n_jobs=1, random_state=None, verbose=0, min_density=None,
compute_importances=None)


What about using adaboost + random forest classifier in order to increase the performance? Is that possible?

• A max depth of 10000 seems very large – Aaron Apr 21 '15 at 17:25
• What makes 90% accuracy a magic number? That level of accuracy is likely seriously over-fit to the training data. – Matthew Drury Aug 19 '15 at 15:02
• How did you settle on RF as your model of choice? Another algorithm likely wouldn't improve your results up to 90%, but you could see a few percentage points improvement. – Tchotchke Aug 19 '15 at 17:09

Since you're using scikit-learn, and you're trying to tweak the parameters of your classifier, you should consider using GridSearchCV. GridSearchCV allows to try out various parameter setups and pick the best one.