-
-
Save hatosuke/7955d5c9598489efe822a152d6466fe0 to your computer and use it in GitHub Desktop.
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)) | |
# legend : plotに判例をつける | |
# col : ラインの色 | |
# fill : boxの色 | |
legend('topright', colnames(rf_model$err.rate), col=1:3, fill=1:3) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment