topepo / caret

caret (Classification And Regression Training) R package that contains misc functions for training and plotting classification and regression models
http://topepo.github.io/caret/index.html
1.61k stars 634 forks source link

Model Lookup Returns Empty Labels #714

Closed DarioS closed 7 years ago

DarioS commented 7 years ago

For example:

> modelLookup("slda")
  model parameter label forReg forClass probModel
1  slda parameter  none  FALSE     TRUE      TRUE

But, a more informative name than just "none" is retrieved by getModelInfo.

> getModelInfo("slda")
$slda
$slda$label
[1] "Stabilized Linear Discriminant Analysis"
...                ...

parameter being parameter also looks wrong.

topepo commented 7 years ago

This is a misnomner. label in modelLookup is a label for the tuning parameter. For example:

> modelLookup("pls")
  model parameter       label forReg forClass probModel
1   pls     ncomp #Components   TRUE     TRUE      TRUE

For getModelInfo, label is for the model and $parameter$label is the tuning parameter label:

> getModelInfo("pls", FALSE)[[1]]$parameter
  parameter   class       label
1     ncomp numeric #Components

parameter being parameter also looks wrong.

It does but isn't. That is the convention when a model has no parameters.

> sum(vapply(getModelInfo(), function(x) any(x$parameter$label == "parameter"), logical(1)))
[1] 18