Machine LearningLesson 81Free preview
Decision Tree
This lesson is part of Python · All levels
Summary
Decision tree builds a tree-shaped model that makes decisions through a series of conditional questions on features. At each node, the data is divided based on the best conditions to separate the class, for example whether the leaf length is less than 3 cm. scikit-learn provides a DecisionTreeClassifier for classification and a DecisionTreeRegressor for regression. Trees that are too deep risk overfitting because of memorizing training data.
Key points
- Decision tree divides data by a condition-level question
- DecisionTreeClassifier is used for classification problems
- The default criterion of separation is this:
- Excessive depth of the tree causes overfitting
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.