Is there any threshold value that can be set for results for Random Forest Classifier in sklearn package in order yo prevent any misclassification for incoming test data.

  • 1
    $\begingroup$ Your question is too broad. In any case, I recommend you to check this link $\endgroup$ – Ripstein Apr 9 '18 at 14:20

Yes and the most important parameter is the tree depth. It's a pre-pruning technique that allows to prevent overfitting. Specifically for sklearn is:


I suggest you to perform GridSearch on max_depth:

params = {'max_depth':[1,50]}
gs = GridSearchCV(DecisionTreeClassifier(), params)

where X is you training set containing instances and y are the labels.

There are packages that also support post-pruning like this one https://svaante.github.io/decision-tree-id3/


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.