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
- a) random forests
- 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
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