1

I am trying to plot variable importance from a support vector model using the vip package in R. However, the plot is empty.

set.seed(2022)
pet_uv_raw_svm_fit %>% 
extract_fit_parsnip() %>% 
vip(method = "permute",
  target = "class",
  metric = "accuracy",
  nsim = 20,
  pred_wrapper = kernlab::predict,
  train = pet_uv_train[, -1],
  )

enter image description here

With the same code but only different data, then I get a good variable importance plot.

set.seed(2022)
pet_uv_svm_fit %>% 
extract_fit_parsnip() %>% 
vip(method = "permute",
  target = "class",
  metric = "accuracy",
  nsim = 20,
  pred_wrapper = kernlab::predict,
  train = pet_uv_train[, -1],
  )

enter image description here

So, my question is what does an empty vip plot mean? and what is the reason causing the result?

Any idea is very much appreciated.

Adam Quek
  • 6,973
  • 1
  • 17
  • 23
Sukis
  • 13
  • 2
  • 1
    Can you please edit your question into a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example) to make it easier for others to help? – Mohamed Desouky Jun 01 '22 at 23:20

0 Answers0