tag:blogger.com,1999:blog-6424211413492597169.post3901459343191624697..comments2024-03-02T07:11:56.376+01:00Comments on me nugget: Decision making trees and machine learning resources for RMarc in the boxhttp://www.blogger.com/profile/00459761376667614040noreply@blogger.comBlogger4125tag:blogger.com,1999:blog-6424211413492597169.post-72974625565758696892014-05-03T15:07:44.878+02:002014-05-03T15:07:44.878+02:00Thanks for your comment, and for passing along thi...Thanks for your comment, and for passing along this resource Mark. Like your blog by the way. Cheers, MarcMarc in the boxhttps://www.blogger.com/profile/00459761376667614040noreply@blogger.comtag:blogger.com,1999:blog-6424211413492597169.post-47634930936741772612014-05-02T17:00:45.000+02:002014-05-02T17:00:45.000+02:00Thanks for the great post! This inspired me to in...Thanks for the great post! This inspired me to investigate CART models a bit more. I found a set of course notes from Cosma Shlizi quite helpful, and thought I'd pass them along. They're basically a first introduction to prediction trees, but I thought you might be interested nonetheless:<br /><br />http://www.stat.cmu.edu/~cshalizi/350/lectures/22/lecture-22.pdfMark T Pattersonhttps://www.blogger.com/profile/13617500268567880565noreply@blogger.comtag:blogger.com,1999:blog-6424211413492597169.post-85355321195075509512014-05-01T08:19:18.804+02:002014-05-01T08:19:18.804+02:00Hi Rick - That's embarrassing. I had changed a...Hi Rick - That's embarrassing. I had changed a variable name at some point. I have corrected the code now - thanks for pointing that out!Marc in the boxhttps://www.blogger.com/profile/00459761376667614040noreply@blogger.comtag:blogger.com,1999:blog-6424211413492597169.post-38687500582700443902014-05-01T00:46:27.719+02:002014-05-01T00:46:27.719+02:00did I do something wrong?
> library(rpart)
>...did I do something wrong?<br /><br />> library(rpart)<br />> set.seed(1)<br />> perms <- 100<br />> pred <- vector(mode="list", perms)<br />> for(i in seq(perms)){<br />+ train <- sample(nrow(iris), nrow(iris)*0.5)<br />+ valid <- seq(nrow(iris))[-train]<br />+ iristrain <- iris[train,]<br />+ irisvalid <- iris[valid,]<br />+ <br />+ model <- rpart(Species~., data=iristrain)<br />+ #Predict<br />+ prediction <- predict(model, newdata=irisvalid, type='class')<br />+ pred[[i]] <- table(prediction, iristest$Species)<br />+ }<br />Error in table(prediction, iristest$Species) : <br /> object 'iristest' not found<br />Ricknoreply@blogger.com