1
$\begingroup$

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

$\endgroup$
  • 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
1
$\begingroup$

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:

estimator.tree_.max_depth

I suggest you to perform GridSearch on max_depth:

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

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/

| improve this answer | |
$\endgroup$

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.