Issue
There are a couple of algorithms to build decision trees such as CART (Classification and Regression Trees), ID3 (Iterative Dichotomiser 3) etc
Which decision tree algorithm does scikit-learn use by default?
When I look at some decision-tree python scripts, it magically produces the results with fit
and predict
functions.
Does scikit-learn cleverly choose the best decision-tree algo based on the data?
Solution
It doesn't automatically do so.
If we look at the sklearn.tree.DecisionTreeClassifier page, we can see that the default criteria is gini impurity.
There is also an option to use entropy instead for the criterion.
Note that CART uses gini impurity and ID3 uses entropy as splitting criteria.
Answered By - Siong Thye Goh
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.