Talk country Python, we need to import a decision tree here. So we import from SK learn dot tree decision tree classifier. Okay, so for these our decision tree classifier, I'm going to change the sny. The decision tree classifier is our classification. So, classification is to predict all those variables that have all those across all categories. So classification is to predict categorical variables.
So to do that, I change this one to minus one, and then these two four, so x minus one in my data set so I have our 12345 elbows So minus one. So, I was left wrong first year, second year over here and four here over here. So minus one I I will take from this first year to the proper tempo why I will put four. So 01234 so far is the paper over here. So, I can create a decision tree using something like this okay Mada equal decision tree classifier, model dot v, x train, y train and prediction equals model dot predict x test okay so I can run this code and I will get my prediction okay green the key print the so maybe I need to pray my prediction also pray prediction so I run my code okay so here are all my predictions for all the testing data.
So he let's say we are going to do some regression you can pull out regressors here and everything will be around see just a decision tree regressor is for doing regression. So it will be more or less on the predicting or those are numeric variables. So, for this decision tree I will say the algorithm is actually a CRT or CRT algorithm or the ID tree algorithm, Id three algorithm will use all those information gain to actually select a variable for CRT they will use some of those entropy and Gini index to select a variable instead. So, for this one we are using the CRT algorithm