Question
Using the dataset above, create a decision tree by hand based on the Markdown and Item variables to predict the value of Purchase. For the
Using the dataset above, create a decision tree by hand based on the "Markdown" and "Item" variables to predict the value of "Purchase". For the splitting criteria, use the weighted gini index as the splitting criteria and show the resulting leaf nodes for each branch of the tree. For the root and each node of the decision tree, calculate the gini index, sample size, and sample distribution. Do not use code. Hint: Sample distribution = [a,b] where a is the number of yes of target value in the current sample, b is the number of no of target value in the current sample.
\begin{tabular}{|l|l|l|} \hline Markdown & \multicolumn{1}{|c|}{ Item } & Purchase \\ \hline No & Yes & Yes \\ \hline No & Yes & Yes \\ \hline No & No & No \\ \hline Yes & Yes & Yes \\ \hline Yes & Yes & Yes \\ \hline Yes & No & No \\ \hline Yes & Yes & Yes \\ \hline No & Yes & Yes \\ \hline Yes & Yes & Yes \\ \hline Yes & Yes & Yes \\ \hline Yes & No & Yes \\ \hline Yes & No & No \\ \hline Yes & Yes & Yes \\ \hline Yes & Yes & Yes \\ \hline Yes & Yes & Yes \\ \hline No & Yes & Yes \\ \hline Yes & No & Yes \\ \hline No & Yes & Yes \\ \hline Yes & No & Yes \\ \hline Yes & No & Yes \\ \hline \end{tabular} \begin{tabular}{|l|l|l|} \hline Markdown & \multicolumn{1}{|c|}{ Item } & Purchase \\ \hline No & Yes & Yes \\ \hline No & Yes & Yes \\ \hline No & No & No \\ \hline Yes & Yes & Yes \\ \hline Yes & Yes & Yes \\ \hline Yes & No & No \\ \hline Yes & Yes & Yes \\ \hline No & Yes & Yes \\ \hline Yes & Yes & Yes \\ \hline Yes & Yes & Yes \\ \hline Yes & No & Yes \\ \hline Yes & No & No \\ \hline Yes & Yes & Yes \\ \hline Yes & Yes & Yes \\ \hline Yes & Yes & Yes \\ \hline No & Yes & Yes \\ \hline Yes & No & Yes \\ \hline No & Yes & Yes \\ \hline Yes & No & Yes \\ \hline Yes & No & Yes \\ \hline \end{tabular}Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started