Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Here the library can be obtained using below commands in R software library(ISLR) attach(Hitters) to omit NA values: Hitters dim(Hitters) i need answer of the

Here the library can be obtained using below commands in R software

library(ISLR)

attach(Hitters)

to omit NA values:

Hitters

dim(Hitters)

i need answer of the question below, using R software

image text in transcribed
1. Consider the Hitters dataset from the previous project. It consists of 20 variables measured on 263 major league baseball players (after removing those with missing data). Take log(Sa1ary) as response (due to skewness in Salary) and the remaining 19 variables as predictors. All data will be taken as training data. For all the models below, use leave-oneout cross-validation (LOOCV) to compute the estimated test MSE. (a) Fit a tree to the data. Summarize the results. Unless the number of terminal nodes is large, diSplay the tree graphically and explicitly describe the regions corresponding to the terminal nodes that provide a partition of the predictor Space (i.e., provide expressions for the regions R1, . . . ,RJ). Report its estimated test MSE. (b) Use LOOCV to determine whether pruning is helpful and determine the Optimal size for the pruned tree. Campare the best pruned and un-pruned trees. Report estimated test MSE for the best pruned tree. Which predictors seem to be the most important? (c) Use a bagging approach to analyze the data with B = 1000. Compute the estimated test MSE. Which predictors seem to be the most important? (d) Use a randOm forest approach to analyze the data with B = 1000 and m m p/ 3. Compute the estimated test MSE. Which predictors seem to be the most important? (e) Use a boosting approach to analyze the data with B = 1000, d = 1, and A = 0.01. Compute the estimated test MSE. Which predictors seem to be the most important? (f) Compare the results from the various methods. Which method would you recommend? How does your recommendation compare with the method you recommended in the previous project

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

Calculus I With Integrated Precalculus

Authors: Laura Taalman

1st Edition

1464153027, 9781464153020

More Books

Students also viewed these Mathematics questions