Suppose the table of Figure 17.16 is stored in a relational database. Use SQL to compute the probabilities needed to compute the information gain when using the PrevDefault attribute as the topmost attribute of a decision tree based on that table.
What will be an ideal response?
SELECT C.PreviousDefault,
COUNT(DefYes.Count)/COUNT(*),
COUNT(DefNo.Count)/COUNT(*)
FROM Customer C,
(SELECT DISTINCT C1.PrevDefault COUNT(*) AS Count
FROM Customer C1
WHERE C1.Default = ’yes’
GROUP BY C1.PrevDefault) AS DefYes
(SELECT DISTINCT C1.PrevDefault COUNT(*) AS Count
FROM Customer C1
WHERE C1.Default = ’no’
GROUP BY C1.PrevDefault) AS DefNo
WHERE C.PrevDefault = DefYes.PrevDefault
AND C.PrevDefault = DefNo.PrevDefault
GROUP BY C.PrevDefault
Computer Science & Information Technology
You might also like to view...
An iterative solution involves loops.
What will be an ideal response?
Computer Science & Information Technology
On a network that does not fully support IPv6, how can DirectAccess clients communicate with IPv4 resources?
What will be an ideal response?
Computer Science & Information Technology