Decision Tree is a non-parametric supervised learning(this means that decision trees have no assumptions about the space distribution and the classifier structure) mainly used for classification problem. It works for both categorical and continuous input and output variables. A decision tree is a flowchart-like tree structure where an internal node represents feature(or attribute), the branch represents a decision rule, and each leaf node represents the outcome.
Classification of iris dataset using Decision tree
1)We loaded the iris dataset from sklearn data.
2)Divide it into train and test data set.
3)We have used a Decision tree classifier.
4)We use fit to train the model
5)Finally, we predict the data and test the accuracy of the model.