hw_week9 (DO NOT SUBMIT THIS FILE )

docx

School

California State University, Long Beach *

*We aren’t endorsed by this school

Course

280

Subject

Computer Science

Date

Jan 9, 2024

Type

docx

Pages

5

Uploaded by dattnguyenn8196

Report
ITM448 Homework – Week9 Edit your submission in this word document, attaching the screenshots of the codes used for each question. Include narrative descriptions, outputs screenshot, or short answers when requested.
Task 1 Please import the “admit.csv” into Rstudio. In this dataset, we know the GRE score, the GPA, and the rank of 400 applicants for a graduate program. We also know if each of the candidates is admitted. In the admit column, 1 stands for “admitted”, and 0 stands for “rejected”. Please answer the following questions and include the codes. 1. import the dataset and call it "mydata". Then check the structure of the data 2. convert the data type of the admit and the rank column from int to factors 3. randomly select 80% of the dataset as training set and the rest as the testing set
4. train a decision tree model, using admit as the category, and gre, gpa, and rank as predictors. Then plot the tree
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
5. Please answer the question: if a candidate has a GPA of 3.7, and rank of 4, does this candidate have a higher chance to be admitted or to be rejected? Please note that when you only have two categories, the darker proportion stands for the proportion for 1 in the end node of the tree plot The chances are higher of being admitted because rank 4 is still to be admitted with 3.7 due to ranking of 2,3,4 likely to be admitted and gpa over 3.7 . 6. Please calculate the accuracy of your decision tree model