SKLearner Home | About | Contact | Examples

Decision Tree

Helpful examples of using Decision Tree machine learning algorithms in scikit-learn.

The Decision Tree algorithm is a supervised learning technique used for both classification and regression tasks.

It constructs a model in the form of a tree structure, where each internal node represents a feature or attribute, each branch represents a decision rule, and each leaf node represents an outcome or class label.

The algorithm recursively splits the dataset based on feature values, choosing splits that maximize the separation between classes (in classification) or reduce variance (in regression).

The splitting criteria are typically based on measures like Gini impurity, entropy (information gain), or mean squared error.

Decision trees are intuitive, easy to interpret, and handle both numerical and categorical data well. However, they can be prone to overfitting, especially with complex datasets, which can be mitigated through techniques like pruning or by using ensemble methods such as Random Forests.

ExamplesTags
Configure DecisionTreeClassifier "ccp_alpha" Parameter
Configure DecisionTreeClassifier "class_weight" Parameter
Configure DecisionTreeClassifier "criterion" Parameter
Configure DecisionTreeClassifier "max_depth" Parameter
Configure DecisionTreeClassifier "max_leaf_nodes" Parameter
Configure DecisionTreeClassifier "min_impurity_decrease" Parameter
Configure DecisionTreeClassifier "min_samples_leaf" Parameter
Configure DecisionTreeClassifier "min_samples_split" Parameter
Configure DecisionTreeClassifier "min_weight_fraction_leaf" Parameter
Configure DecisionTreeClassifier "monotonic_cst" Parameter
Configure DecisionTreeClassifier "random_state" Parameter
Configure DecisionTreeClassifier "splitter" Parameter
Configure DecisionTreeRegressor "ccp_alpha" Parameter
Configure DecisionTreeRegressor "criterion" Parameter
Configure DecisionTreeRegressor "max_depth" Parameter
Configure DecisionTreeRegressor "max_features" Parameter
Configure DecisionTreeRegressor "max_leaf_nodes" Parameter
Configure DecisionTreeRegressor "min_impurity_decrease" Parameter
Configure DecisionTreeRegressor "min_samples_leaf" Parameter
Configure DecisionTreeRegressor "min_samples_split" Parameter
Configure DecisionTreeRegressor "min_weight_fraction_leaf" Parameter
Configure DecisionTreeRegressor "monotonic_cst" Parameter
Configure DecisionTreeRegressor "random_state" Parameter
Configure DecisionTreeRegressor "splitter" Parameter
Scikit-Learn DecisionTreeClassifier Model
Scikit-Learn DecisionTreeRegressor Model
Scikit-Learn ExtraTreeClassifier Model
Scikit-Learn ExtraTreeRegressor Model
Scikit-Learn GridSearchCV DecisionTreeClassifier
Scikit-Learn GridSearchCV DecisionTreeRegressor
Scikit-Learn GridSearchCV ExtraTreeClassifier
Scikit-Learn GridSearchCV ExtraTreeRegressor
Scikit-Learn RandomizedSearchCV DecisionTreeClassifier
Scikit-Learn RandomizedSearchCV DecisionTreeRegressor
Scikit-Learn RandomizedSearchCV ExtraTreeClassifier
Scikit-Learn RandomizedSearchCV ExtraTreeRegressor