Skip to content

Commit

Permalink
changes for upcoming C5 version
Browse files Browse the repository at this point in the history
  • Loading branch information
topepo committed Nov 28, 2017
1 parent 1c1eff0 commit 8f15fdb
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions models/files/C5.0.R
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ modelInfo <- list(label = "C5.0",
argList <- list(x = x, y = y, weights = wts, trials = param$trials,
rules = param$model == "rules")
argList <- c(argList, theDots)
do.call(C50::C5.0.default, argList)
do.call(C50:::C5.0.default, argList)
},
predict = function(modelFit, newdata, submodels = NULL) {
out <- predict(modelFit, newdata)
Expand Down Expand Up @@ -76,7 +76,7 @@ modelInfo <- list(label = "C5.0",
vars <- C50::C5imp(x, metric = "splits")
rownames(vars)[vars$Overall > 0]
},
varImp = function(object, ...) C5imp(object, ...),
varImp = function(object, ...) C50::C5imp(object, ...),
tags = c("Tree-Based Model", "Rule-Based Model", "Implicit Feature Selection",
"Boosting", "Ensemble Model", "Handle Missing Predictor Data", "Accepts Case Weights"),
sort = function(x) {
Expand Down
4 changes: 2 additions & 2 deletions models/files/C5.0Cost.R
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ modelInfo <- list(label = "Cost-Sensitive C5.0",
} else argList$costs <- cmat

argList <- c(argList, theDots)
do.call(C50::C5.0.default, argList)
do.call(C50:::C5.0.default, argList)
},
predict = function(modelFit, newdata, submodels = NULL) {
out <- predict(modelFit, newdata)
Expand All @@ -77,7 +77,7 @@ modelInfo <- list(label = "Cost-Sensitive C5.0",
rownames(vars)[vars$Overall > 0]
},
levels = function(x) x$obsLevels,
varImp = function(object, ...) C5imp(object, ...),
varImp = function(object, ...) C50::C5imp(object, ...),
tags = c("Tree-Based Model", "Rule-Based Model", "Implicit Feature Selection",
"Boosting", "Ensemble Model", "Cost Sensitive Learning", "Two Class Only",
"Handle Missing Predictor Data", "Accepts Case Weights"),
Expand Down
4 changes: 2 additions & 2 deletions models/files/C5.0Rules.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ modelInfo <- list(label = "Single C5.0 Ruleset",
label = c('none')),
grid = function(x, y, len = NULL, search = "grid") data.frame(parameter = "none"),
fit = function(x, y, wts, param, lev, last, classProbs, ...)
C50::C5.0(x = x, y = y, weights = wts, rules = TRUE, ...),
C50:::C5.0.default(x = x, y = y, weights = wts, rules = TRUE, ...),
predict = function(modelFit, newdata, submodels = NULL)
predict(modelFit, newdata),
prob = function(modelFit, newdata, submodels = NULL)
Expand All @@ -17,7 +17,7 @@ modelInfo <- list(label = "Single C5.0 Ruleset",
rownames(vars)[vars$Overall > 0]
},
levels = function(x) x$obsLevels,
varImp = function(object, ...) C5imp(object, ...),
varImp = function(object, ...) C50::C5imp(object, ...),
tags = c("Rule-Based Model", "Implicit Feature Selection", "Handle Missing Predictor Data", "Accepts Case Weights"),
trim = function(x) {
x$boostResults <- NULL
Expand Down
4 changes: 2 additions & 2 deletions models/files/C5.0Tree.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ modelInfo <- list(label = "Single C5.0 Tree",
label = c('none')),
grid = function(x, y, len = NULL, search = "grid") data.frame(parameter = "none"),
fit = function(x, y, wts, param, lev, last, classProbs, ...)
C50::C5.0(x = x, y = y, weights = wts, ...),
C50:::C5.0.default(x = x, y = y, weights = wts, ...),
predict = function(modelFit, newdata, submodels = NULL)
predict(modelFit, newdata),
prob = function(modelFit, newdata, submodels = NULL)
Expand All @@ -17,7 +17,7 @@ modelInfo <- list(label = "Single C5.0 Tree",
rownames(vars)[vars$Overall > 0]
},
levels = function(x) x$obsLevels,
varImp = function(object, ...) C5imp(object, ...),
varImp = function(object, ...) C50::C5imp(object, ...),
tags = c("Tree-Based Model", "Implicit Feature Selection",
"Handle Missing Predictor Data", "Accepts Case Weights"),
sort = function(x) x[order(x[,1]),],
Expand Down
Binary file modified pkg/caret/inst/models/models.RData
Binary file not shown.

0 comments on commit 8f15fdb

Please sign in to comment.