Last active
November 29, 2016 16:04
-
-
Save euclidjda/387a0384bb419ffdae94 to your computer and use it in GitHub Desktop.
Simple C5.0 Tuning and Training Example
This file contains hidden or 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
| library(caret) | |
| library(C50) | |
| library(mlbench) | |
| fitControl <- trainControl(method = "repeatedcv", | |
| number = 10, | |
| repeats = 10, returnResamp="all") | |
| # Choose the features and classes | |
| data(PimaIndiansDiabetes2) | |
| x <- PimaIndiansDiabetes2[c("age","glucose","insulin","mass","pedigree","pregnant","pressure","triceps")] | |
| y <- PimaIndiansDiabetes2$diabetes | |
| grid <- expand.grid( .winnow = c(TRUE,FALSE), .trials=c(1,5,10,15,20), .model="tree" ) | |
| mdl<- train(x=x,y=y,tuneGrid=grid,trControl=fitControl,method="C5.0",verbose=FALSE) | |
| mdl | |
| # visualize the resample distributions | |
| xyplot(mdl,type = c("g", "p", "smooth")) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment