File tree Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -35,7 +35,6 @@ Suggests:
3535 rmarkdown,
3636 survival,
3737 keras,
38- C50,
3938 xgboost,
4039 covr
4140
Original file line number Diff line number Diff line change @@ -437,17 +437,21 @@ C5.0_train <-
437437 other_args <- list (... )
438438 protect_ctrl <- c(" minCases" , " sample" )
439439 protect_fit <- " trials"
440+ f_names <- names(formals(getFromNamespace(" C5.0.default" , " C50" )))
441+ c_names <- names(formals(getFromNamespace(" C5.0Control" , " C50" )))
440442 other_args <- other_args [! (other_args %in% c(protect_ctrl , protect_fit ))]
441- ctrl_args <- other_args [names(other_args ) %in% names(formals( C50 :: C5.0Control )) ]
442- fit_args <- other_args [names(other_args ) %in% names(formals( C50 :: C5.0.default )) ]
443+ ctrl_args <- other_args [names(other_args ) %in% c_names ]
444+ fit_args <- other_args [names(other_args ) %in% f_names ]
443445
444- ctrl <- expr( C50 :: C5.0Control() )
446+ ctrl <- call2( " C5.0Control" , .ns = " C50 " )
445447 ctrl $ minCases <- minCases
446448 ctrl $ sample <- sample
447449 for (i in names(ctrl_args ))
448450 ctrl [[i ]] <- ctrl_args [[i ]]
449451
450- fit_call <- expr(C50 :: C5.0(x = x , y = y ))
452+ fit_call <- call2(" C5.0" , .ns = " C50" )
453+ fit_call $ x <- expr(x )
454+ fit_call $ y <- expr(y )
451455 fit_call $ trials <- trials
452456 fit_call $ control <- ctrl
453457 if (! is.null(weights ))
You can’t perform that action at this time.
0 commit comments