# DecisionTreeClassifier performing better than RandomForestClassifier

I am currently working on a supervised learning project with sklearn. According to my experiments I observe DecisionTreeClassifier(DTC) performs better than RandomForestClassifier(RFC), both in term of training and testing error (for several test sets actually). Given the fact that RFC is an ensemble of DTCs, would it be acceptable to report that DTC is a better method for a given dataset over RFC? Or is it always that case that you can get a better RFC, but I have not tuned it enough to outperform DTC?

Example of tunegrids I 've tried with grid search cv, where DTC outperforms RFC when the best found specifications are tested on independent test sets:

DTC: [{'criterion':["gini","entropy"],"max_depth":[1,2,3,4,5,10,20,30,50],"class_weight":["balanced"]}]

RFC: [{"criterion":["gini", "entropy"],"n_estimators":[5,10,20,30,40,50],"max_depth":[1,2,3,4,5,10,20,30,50],"class_weight":["balanced"]}]

In short, is RFC always a better choice (or at least as good as) the DTC?

• According to the no free lunch theorem, no. Feb 24 at 17:47
• Don't cross validate over n_estimators: The more the better. I usually just set this to 1000. As Arya mentions, the No Free Lunch Theorem says that no algorithm uniformly dominates another. I also am dubious that a decision tree would do better, as they are high variance estimators and should thus have larger error. Can you post the method in which you validate these models? Because you are doing grid search, I think the best method of validation would be nested cross validation. Feb 24 at 17:55
• Well, the method used for validation is scikit-learn's GridSearchCV with scoring="f1_micro" Feb 24 at 18:15