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=Nonemin_samples_split=2min_samples_leaf=1min_weight_fraction_leaf=0.0max_features=Nonerandom_state=Nonemax_leaf_nodes=Nonemin_impurity_decrease=0.0class_weight=Noneccp_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

Popular Posts