ML_HW_8.docx - ML HW#8 Zhongyan Liang library(ISLR attach(College library(leaps library(glmnet Loading required package Matrix Loading required package

ML_HW_8.docx - ML HW#8 Zhongyan Liang library(ISLR...

This preview shows page 1 - 4 out of 7 pages.

ML HW#8 Zhongyan Liang 3/29/2019 library (ISLR) attach (College) library (leaps) library (glmnet) ## Loading required package: Matrix ## Loading required package: foreach ## Loaded glmnet 2.0-16 a. set.seed ( 666 ) n= length (Apps) Z= sample (n,n / 2 ) reg<- regsubsets (Apps ~ ., data= College) summary (reg) ## Subset selection object ## Call: regsubsets.formula(Apps ~ ., data = College) ## 17 Variables (and intercept) ## Forced in Forced out ## PrivateYes FALSE FALSE ## Accept FALSE FALSE ## Enroll FALSE FALSE ## Top10perc FALSE FALSE ## Top25perc FALSE FALSE ## F.Undergrad FALSE FALSE ## P.Undergrad FALSE FALSE ## Outstate FALSE FALSE ## Room.Board FALSE FALSE ## Books FALSE FALSE ## Personal FALSE FALSE ## PhD FALSE FALSE ## Terminal FALSE FALSE ## S.F.Ratio FALSE FALSE ## perc.alumni FALSE FALSE ## Expend FALSE FALSE ## Grad.Rate FALSE FALSE ## 1 subsets of each size up to 8 ## Selection Algorithm: exhaustive ## PrivateYes Accept Enroll Top10perc Top25perc F.Undergrad
Image of page 1

Subscribe to view the full document.

## 1 ( 1 ) " " "*" " " " " " " " " ## 2 ( 1 ) " " "*" " " "*" " " " " ## 3 ( 1 ) " " "*" " " "*" " " " " ## 4 ( 1 ) " " "*" " " "*" " " " " ## 5 ( 1 ) " " "*" "*" "*" " " " " ## 6 ( 1 ) " " "*" "*" "*" " " " " ## 7 ( 1 ) " " "*" "*" "*" "*" " " ## 8 ( 1 ) "*" "*" "*" "*" " " " " ## P.Undergrad Outstate Room.Board Books Personal PhD Terminal ## 1 ( 1 ) " " " " " " " " " " " " " " ## 2 ( 1 ) " " " " " " " " " " " " " " ## 3 ( 1 ) " " " " " " " " " " " " " " ## 4 ( 1 ) " " "*" " " " " " " " " " " ## 5 ( 1 ) " " "*" " " " " " " " " " " ## 6 ( 1 ) " " "*" "*" " " " " " " " " ## 7 ( 1 ) " " "*" "*" " " " " " " " " ## 8 ( 1 ) " " "*" "*" " " " " "*" " " ## S.F.Ratio perc.alumni Expend Grad.Rate ## 1 ( 1 ) " " " " " " " " ## 2 ( 1 ) " " " " " " " " ## 3 ( 1 ) " " " " "*" " " ## 4 ( 1 ) " " " " "*" " " ## 5 ( 1 ) " " " " "*" " " ## 6 ( 1 ) " " " " "*" " " ## 7 ( 1 ) " " " " "*" " " ## 8 ( 1 ) " " " " "*" " " summary (reg) $ cp ## [1] 404.98808 131.68051 106.33057 76.94215 52.18943 43.61538 34.69833 ## [8] 24.82608
Image of page 2
summary (reg) $ bic ## [1] -1702.441 -1902.619 -1919.870 -1941.588 -1959.962 -1963.427 -1967.359
Image of page 3

Subscribe to view the full document.

Image of page 4
  • Fall '18
  • Michael Baron
  • yhat

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern

Ask Expert Tutors You can ask 0 bonus questions You can ask 0 questions (0 expire soon) You can ask 0 questions (will expire )
Answers in as fast as 15 minutes