search
LoginSignup
11

More than 5 years have passed since last update.

posted at

updated at

R言語で決定木分析

R言語で決定木分析を行うサンプルプログラムを書いたので投稿します。

03_Decision_tree.R
library(rpart)
library(partykit)
library(epitools)

#Read data
data_titanic<-expand.table(Titanic)

#Making decision tree
result<-rpart(Survived~., data = data_titanic)

#Plot result
plot(as.party(result)

結果
03_Output.jpg

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
What you can do with signing up
11