In this video, we’ll be covering the process of building decision trees.
So let’s get started!
Consider the drug dataset again.
The question is, “How do we build the decision tree based on that dataset?”
Decision trees are built using recursive partitioning to classify the data.
Let’s say we have 14 patients in our dataset.
The algorithm chooses the most predictive feature to split the data on.
What is important in making a decision tree, is to determine “which attribute is the
best, or more predictive, to split data based on the feature.”
Let’s say we pick “Cholesterol” as the first attribute to split data.
It will split our data into 2 branches.
As you can see, if the patient has high “Cholesterol,” we cannot say with high confidence that Drug B
might be suitable for him.
Also, if the Patient’s “Cholesterol” is normal, we still don’t have sufficient
evidence or information to determine if either Drug A or Drug B is, in fact, suitable.
It is a sample of bad attribute selection for splitting data.
So, let’s try another attribute.
Again, we have our 14 cases.
This time, we pick the “sex” attribute of patients.
It will split our data into 2 branches, Male and Female.
#Pyton #MachineLearning #PythonCoding