Aniket-hub21 / Decision-Tree

Code to create a Decision Tree Classifier

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Decision-Tree

I have created a decision tree classifier in which on any input this model will clssify accordingly. Dataset can be found at : "https://bit.ly/3kXTdox"

Steps to train a model:

Firstly, import the libraries which we will be needed in this task i.e pandas, numpy, matlplot and sklearn Import the dataset in the module. Separate the dataset into dependent variavle which is our target variable and independent variable. Using train_test_split to train and test the model. Importing Decision Tree Classifier and making an instance of it. Fit the train data into the classifier. We can have any number of depths in decision tree so we have to calculate accuracy for a range of depths so that we can find optimal value of depth. After finding the optimal value of depth, implement the data in the classifier with that depth For displaying a graph(image), we have to install some more packages and then use them accordingly.

About

Code to create a Decision Tree Classifier


Languages

Language:Jupyter Notebook 100.0%