Professional Documents
Culture Documents
Experiment 3: Name: Reena Kale Te Comps Roll No:23
Experiment 3: Name: Reena Kale Te Comps Roll No:23
Experiment 3: Name: Reena Kale Te Comps Roll No:23
THEORY:
Decision Tree : Decision tree is the most powerful and popular tool for classification and
prediction.
A Decision tree is a flowchart like tree structure, where each internal node denotes a test on
an
attribute, each branch represents an outcome of the test, and each leaf node (terminal node)
holds a
class label.
Construction of Decision Tree : A tree can be “learned” by splitting the source set into
subsets based
on an attribute value test. This process is repeated on each derived subset in a recursive
manner called
recursive partitioning. The recursion is completed when the subset at a node all has the
same value of
the target variable, or when splitting no longer adds value to the predictions. The construction
of
decision tree classifier does not require any domain knowledge or parameter setting, and
therefore is
appropriate for exploratory knowledge discovery. Decision trees can handle high dimensional
data. In
general decision tree classifier has good accuracy. Decision tree induction is a typical
inductive
approach to learn knowledge on classification.
ALGORITHM:
Create node N
If tuples in D are all of same class C, then
Return N as leaf node labeled with class C
If attribute_list empty then
Return N as leaf node labeled with majority class in D or majority voting
Apply attribute_selection_method (D, attribute_list)
To find best splitting criterion
Label node N with splitting criterion
If splitting_attribute is discrete valued and multiway splits allowed then
attribute_list=splitting attribute
for each outcome j of splitting criterion
let Dj be set of data tuples in D satisfying outcome j
if Dj is empty then
attach a leaf labeled with the majority
class in D to node N
else
attach node returned by Generate decision tree(Dj, attribute_list) to node N
end for
Return N
QUESTION:
Buying_Price Maintenance_Price Lug_Boot Safety Evaluation?
High High Small High Unacceptable
High High Small Low Unacceptable
Medium High Small High Acceptable
Low Medium Small High Acceptable
Low Low Big High Acceptable
Low Low Big Low Unacceptable
Medium Low Big Low Acceptable
High Medium Small High Unacceptable
High Low Big High Acceptable
Low Medium Big High Acceptable
High Medium Big Low Acceptable
Medium Medium Small Low Acceptable
Medium High Big High Acceptable
Low Medium Small Low Unacceptable
CODE:
OUTPUT:
CONCLUSION:
We successfully understood and implemented the concept of Decision Tree using
programming language.