Question
Write a program in Python: Consider the criteria for accepting graduate students at the hypothetical Univ. of Excellence. Each candidate is evaluated according to four
Write a program in Python:
Consider the criteria for accepting graduate students at the hypothetical Univ. of Excellence. Each candidate is evaluated according to four attributes:
1. the grade point average (GPA)
2. the quality of the undergraduate degree
3. the publication record
4. the strength of the recommendation letters
To simplify our example, lets limit the possible values of each attribute: Possible GPA scores are 3.9, 3.9 > GP A > 3.2, and 3.2; universities are categorized as Rank 1, Rank 2, and Rank 3; Prior research is a binary attribute - either the applicant has performed prior research or not. Recommendation letters are similarly binary, they are either good or normal. Finally, the candidates are classified into two classes: accepted, or P (for positive) and rejected, or N (for negative). Figure below provides an example of one possible decision tree determining acceptance.
An applicant doesnt know this decision tree, but does have the data regarding twelve of last years applicants as in Table 1.
a) Does the provided tree correctly categorize the provided examples?
b) The applicant uses the decision tree algorithm shown in class (with the information gain computations for selecting split variables) to induce the decision tree employed by U. of E. officials. What tree will the algorithm come up with? Show the computations involved, in addition to the decision tree itself.
[Hint: The information content of the examples before choosing any split variable is:
You have to find the attribute that has the highest information gain:
where attribute A divides the examples into i subsets, and pi and ni represent the number of positive and negative examples in subset i.]
c) Is the tree that you got in part b) equivalent to the tree provided here (i.e., do the two trees classify every application in the same way)? If the answer is yes, explain whether this is a coincidence or not. If the answer is no, give an example of a data case that will be classified differently by the two trees.
GPA 4.0 3.6 , 3.3 Publications yes no Universitv rank 1 rank 3 rank 2 GPA 4.0 3.6 , 3.3 Publications yes no Universitv rank 1 rank 3 rank 2Step 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