This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 乱数種を設定し、同じ結果が返されるようにする | |
set.seed(754) | |
# Survivedが目的変数で、~以降が説明変数、全ての変数を利用するわけではない | |
rf_model <- randomForest(factor(Survived) ~ | |
Pclass + SibSp + Parch + Fare + Parch, | |
data = train) | |
# Show model error | |
plot(rf_model, ylim=c(0, 0.6)) |