logo

Assignment:. Write a python program to implement the Hu

1 Pages431 Words174 Views
   

Added on  2019-09-16

Assignment:. Write a python program to implement the Hu

   Added on 2019-09-16

ShareRelated Documents
Assignment:Writeapython program toimplementthe Hunts algorithm fordecision tree:1. Function 1 to build a decision tree:a. Theinputis alist of tuples:i. Thefirst tuple ofthis list isto describethe attributetypeof theitems inthe rest of the list. The attributetypescould be n, ‘o, ‘c’,and ’l’for nominal, ordinal, continuous, and label, respectively. Notethat wecan assumethe label attribute l’ is alwaysthe lastattributein thetuple, and it’s value is always either 0 or 1.ii. Therest of the list is of fixed sized integer-tuples.iii. For example, [(n’,n’,c’,’l),(1,0,125,0),(0,2,100,0), ...]iv. Notethat allthe input values areof integer. For example, we canconvert ourexample in theppt file,yes/no to be1/0.b. Theoutputis a tree-likestructurewhichcould be atupleof tuples asdescribedin the class. (left-child, information of current node, right-child). Pleasenote that nullpointer is the keywordNone in Python.c. The choiceof attribute for next node is in the same order ofinputattribute.That is, root nodeis based on first attribute, and its child nodes aretheattribute2.d. Assume that each nodecan haveat most two children.e. We can assumethe inputlist is legitimate. That is, wedo not need to checkthe qualityof theinput.f.You might need tocreatemorefunctionsto be called to completethe tasks forthis function.2. Function 2 returnsalabel(class)for a given tuplewhich is same structure(withoutlabel) as the tuple in thelistof thefirst function.a. For example, the input could be (1,0,120) compared to the exampleoffunction 1 above.b. Theoutputis eitherthe label which is 0 or 1 for this assignment.3. Create oneexamplebyconvertingourexamplefrom theppt file, and test theresultswith newtuples.
Assignment:. Write a python program to implement the Hu_1

End of preview

Want to access all the pages? Upload your documents or become a member.

Related Documents
ASSINMENT ON Data analysis in Rapid miner.
|8
|888
|14

Data System and Integration: A Study on Data Cleaning, Merging, RESTful Web Services, and Mashups
|12
|1694
|296

Exploring Data using Python: Assignment
|11
|2022
|1178