Understanding the Decision Tree [ Day 1]
Hello Folks,
Today we will explore the Decision Tree in Machine Learning. The decision tree is usually called CART (Classification and Regression Trees).
1.DecisionTreeClassifier:
class sklearn.tree.DecisionTreeClassifier(*, criterion='gini', splitter='best', max_depth=None, min_samples_split=2, min_samples_leaf=1, min_weight_fraction_leaf=0.0, max_features=None, random_state=None, max_leaf_nodes=None, min_impurity_decrease=0.0, class_weight=None, ccp_alpha=0.0)
Advantages :
1.Easy to Understand
Disadvantages:
Decision trees tend to overfit data with a large number of features. Getting the right ratio of samples to a number of features is important since a tree with few samples in high dimensional space is very likely to overfit.
Purning: (limit the height of tree)
Pruning is a data compression technique in machine learning and search algorithms that reduces the size of decision trees by removing sections of the tree that are non-critical and redundant to classify instances.
we have one attritubes in decison tree model:
path = clf.cost_complexing_pruning_path(X_train,y_train)
1.Pre Purning
2.Post Purning
Comments
Post a Comment