Skip to content

Instantly share code, notes, and snippets.

# 乱数種を設定し、同じ結果が返されるようにする
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))