In this video, we will see how to create decision tree that we have trained on our data.
Now, plotting a busy uncreate is not an easy task in Python.
It requires a lot of effort.
We are not going into detail on how to grow it.
We are just providing you code and we are just providing you the instructions on how to run it.
So the first step is to create a dot file.
Then we need to convert this dot file into an image.
Then we will use this inmate.
To create a graph.
Now, this is the code.
Remember this code?
This is our variable.
We need to use export, underscore Graff method.
And here we have to provide over that aggressor KRI onto aggressor object.
Since our object is rectory, we provided this as an argument.
Now, in the next step, we have to import inmates from eye by standard display.
We will use this image to display graph in our Biton notebook.
The next step is to import by door, plus normally by default, this library is not installed in your
anakonda packet.
So first you have to install it to install this.
You need to go to your and command prompt.
And there you need to write KONDA Space install is space Bidart.
Plus, if you are not using Anakonda, you have to go to your common ground and write up the space,
install space by door.
Plus, we have provided instructions on how to install Biodome plus in the description of this video.
So check out if you want to plot your regression tree into Biton.
Next, if you have in sorry pilot plus you can import Bidart plus and then use this Dort data that we
have created earlier to create the regression tree.
So we will run all this for commands.
You can see.
This is a word, this young tree here on the top.
You can get the variable name.
Year X squared, record.
Three.
This is our fourth variable.
All four X data frame, which is budget.
And here we have the condition.
If the budget is less than thirty seven thousand, then it will follow this branch.
And if the budget is greater than thirty seven thousand nine hundred eighty two, it will follow this
branch.
You can also see the average value of this symbol.
So this is over Naude, the total number of observations is 404.
And the average value of collection here is forty five thousand after the first split.
So if your budget is more than this value, the average value for this symbol is seventy one thousand.
So the average really of collection for this bucket is seventy one thousand.
And the total number of samples in this book is 75.
Whereas if you're budget value is less than thirty seven thousand nine hundred eighty two, the average
value of your collection is thirty nine thousand.
And the number of observations in this bucket is 392.
And on the bottom, you can see we have eight leaf notes.
And these are the average value of each leaf node.
You can also get to the number of observation following and two, these leave notes.
So for this leaf, our extra variable is less than thirty seven thousand nine hundred eighty two.
Our X10 variable is less than 40000.
Our first variable, that is Exito very well, is less than 135 and so on.
So you can assign conditions to all this bucket.
And these are the average values of collection in this bucket.
And that is how you visualize CCRI and Biton.