How to find algo type(regression,classification) in Caret in R for all algos at once?

259 views Asked by At

How do I find whether model type for all models at once? I know how to access this info if I know the algo name, e.g.:

library('Caret')
tail(name(getModelInfo()))
[1] "widekernelpls" "WM"            "wsrf"          "xgbLinear"     "xgbTree"      
[6] "xyf"

getModelInfo()$xyf$type
[1] "Classification" "Regression"    

How do I see the $type for all the algos in one place?

1

There are 1 answers

0
topepo On BEST ANSWER

Look at the help page ?models. Also, here are some links too.

Also:

> is_class <- unlist(lapply(mods, function(x) any(x$type == "Classification")))
> class_mods <- names(is_class)[is_class]
> head(class_mods)
[1] "ada"         "AdaBag"      "AdaBoost.M1" "amdai"       "avNNet"     
[6] "bag"