Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # tree = 500
- oob.err1 = numeric(15)
- for (mtry in 1:15) {
- fit1 = randomForest(lable ~ .-user_id -product_id, data = train_2, mtry = mtry)
- oob.err1[mtry] = fit1$err.rate[500]
- cat('We are performing iteration', mtry, '\n')
- }
- plot(1:15, oob.err11, pch = 16, type = 'b',
- xlab = 'Variance Cosidered at Each Split',
- ylab = 'OOB Mean Squared Error',
- main = '1_Random Forest OOB Error Rates\nby # of Variables')
- # variane important:
- varImpPlot(fit1)
- oob.err1[4]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement