Skip to content

Instantly share code, notes, and snippets.

@elyase
Last active December 18, 2015 14:29
Show Gist options
  • Save elyase/5797809 to your computer and use it in GitHub Desktop.
Save elyase/5797809 to your computer and use it in GitHub Desktop.
train<-read.csv("C:/Users/vcomas/OIQ/Kaggle/Titanic/train.csv",colClasses=c("survived"="factor","pclass"="factor"))
str(train)
library("randomForest")
library(ipred)
randomForest(survived~fare+sex+pclass,data=train,ntree=100, keep.forest=FALSE)$err.rate[100]
errorest(survived~fare+sex+pclass+age,data=train,
model=randomForest, estimator = "cv", est.para=control.errorest(k=10), ntree=10, mtry=2)$err
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment