Question: Using R studio and following library / data library(MASS) data(Boston) 1. For Boston Housing case study, continue using 12201408 as the seed. Randomly sample a

Using R studio and following library / data

library(MASS)

data(Boston)

1. For Boston Housing case study, continue using 12201408 as the seed. Randomly sample a training data set that contains 80% of the original data and set the rest 20% aside as testing data. Build a random forest model. You may use ">library(randomForest)" and default options from ">randomForest()".

Using your random forest model, what is your out-of-sample mean (average) squared prediction error (MSPE) for your 20% testing data? (Note. Testing data should NOT be used in building the model nor finding the tuning parameters. Hence, generally, out-of-sample MSPE is a better criterion for model comparison.) Please keep two decimals. (e.g. 11.73)

.

2. For Boston Housing case study, build a boosting model on your 80% training data. You may use ">library(gbm)" and default options from ">gbm()". Using your boosting model, what is your out-of-sample mean (average) squared prediction error (MSPE) for your 20% testing data? (Note. Testing data should NOT be used in building the model nor finding the tuning parameters. Hence, generally, out-of-sample MSPE is a better criterion for model comparison.) Please keep two decimals. (e.g. 14.53).

please report your out-of-sample MSPE for your 20% testing sample for Boston Housing case using 12201408 as the seed for

  1. a) random forests
  2. b) boosting example( MSPE rf=11.73; MSPE boosting=14.53)

3. What are the top two important variables according to your random forest model?

a. crim and zn

b. indus and lstat

c. lstat and rm

d. crim and nox

.

4. What are the top two most important variables according to boosting trees using "relative influence"

a. crim and zn

b. indus and lstat

c. lstat and rm

d. crim and nox

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Mathematics Questions!