Data Science (Python) :: Decision Tree Classification & Random Forest Classification
Intention of this post is to give a quick refresher (thus, it’s assumed that you are already familiar with the stuff) of concept of “Decision Tree Classification & Random Forest Classification” (using Python). You can treat this as FAQ’s as well.
Sample code for implementing Decision Tree Classification?
from sklearn.tree import DecisionTreeClassifier
classifier = DecisionTreeClassifier(criterion = ‘entropy’, random_state = 0)
classifier.fit(X_train, y_train)
***************************************
Sample code for implementing Random Forest Classification?
from sklearn.ensemble import RandomForestClassifier
classifier = RandomForestClassifier(n_estimators = 10, criterion = ‘entropy’, random_state = 0)
classifier.fit(X_train, y_train)
***************************************
How is decision tree & random forest classification implementation for classification problems differ to the implementation for regression problems?
Pragmatically, no much difference actual. Both ways of applying the algorithm is almost same!
**************************************
Next :- Data Science :: Performance of Each Classification Model
Prev :: Data Science (Python) :: Naive Bayes