Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Q4. a. [3 points] Change Algorithm 1 to take a maximum depth parameter d. b. [1 point] Do we also need to change Algorithm 2

Q4. a. [3 points] Change Algorithm 1 to take a maximum depth parameter d.

b. [1 point] Do we also need to change Algorithm 2 ? Why?

image text in transcribed

3: 4: 5: 6: else 7 8: 9: Algorithm 1 DECISIONTREETRAIN(data, remaining features) 1: guess most frequent answer in data // default answer for this data if the labels in data are unambiguous then return LEAF(guess) // base case: no need to split further * else if remaining features is empty then return LEAF(guess) // base case: cannot split further // we need to query more features for all f e remaining features do NO + the subset of data on which f=no YES + the subset of data on which f=yes score[f] + # of majority vote answers in NO + # of majority vote answers in YES // the accuracy we would get if we only queried on f end for ft the feature with maximal score(f) NO + the subset of data on which f=no YES + the subset of data on which f=yes left + DecisionTREETRAIN(NO, remaining features \ {f}) right + DECISION TREETRAIN(YES, remaining features {f}) return NODE(f, left, right) 10: 11: 12: 13: 14: 15: 16: 17: 19 end if 2: : Algorithm 2 DECISION TREETEST(tree, test point) 1: if tree is of the form LEAF(guess) then return guess 3: else if tree is of the form Node(f, left, right) then if f = no in test point then return Decision TreeTest(left, test point) else return DECISION TREE TEST(right, test point) end if 4: 5: 6: 7: 8: 4 end if

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database And Transaction Processing

Authors: Philip M. Lewis, Arthur Bernstein, Michael Kifer

1st Edition

0201708728, 978-0201708721

More Books

Students also viewed these Databases questions