Open elpidiofilho opened 2 years ago
Did you ever find an answer to this?
+1 in R 4.3.1 with caret 6.0-94.
> varImp(svmFitLinear)
Error in model.frame.default(formula = y ~ x, na.action = na.omit, drop.unused.levels = TRUE) :
invalid type (list) for variable 'y'
In addition: Warning messages:
1: In mean.default(y, rm.na = TRUE) :
argument is not numeric or logical: returning NA
2: In Ops.factor(left, right) : ‘-’ not meaningful for factors
> filterVarImp(svmFitLinear)
Error in data[, fc] : incorrect number of dimensions
Same with radial SVMs.
Did you ever find an answer to this?
Only factor I have is the output, so my working assumption would be varImp()
's assuming a continuous response variable and thus failing to handle classifiers.
According to the documentation you should use filterVarImp
,
The support vector machine-family of functions doesn't appear to have a variable importance method. This can easily be verified by modifying model-argument to nnet
which runs without any issues.
The Caret package has been showing an error message when I try to get the importance of variables using the svmRadial model for the diabetes dataset. The error message displayed is: "invalid type (list) for variable 'y'"
Created on 2022-06-14 by the reprex package (v2.0.1)
Created on 2022-06-14 by the reprex package (v2.0.1)
Created on 2022-06-14 by the reprex package (v2.0.1)