Variable importance

81 views
Skip to first unread message
Assigned to ndimhy...@gmail.com by bajohn...@gmail.com

Jordan Engelbrecht

unread,
Aug 5, 2024, 11:18:15 AM8/5/24
to Wallace Ecological Modeling App
Hello!

I am trying to figure out how to generate a table of environmental variable importance once I've run my model. I've tried running the model code in R and including the line: "var.importance(model)" but I've had no success thus far. I've also tried using the package "maxent" and including the following lines: 

occ_matrix <- cbind(occs_Pp, rep(1, nrow(occs_Pp)))  

maxnet_model <- maxnet(
  p = occ_matrix[,3],  # Presences
  data = as.data.frame(envs_Pp),
  f = maxnet.formula(occ_matrix[,3], envs_Pp)
)

importance <- maxnet::importance(model_Pp)
importance_df <- as.data.frame(importance)
importance_df$Variable <- rownames(importance_df)

This did not work either...

Has anyone perhaps figured out how to do this? 

Your help would be much appreciated!

Thank you
Jordy

Wallace Ecological Modeling App

unread,
Aug 5, 2024, 11:53:28 AM8/5/24
to Wallace Ecological Modeling App

I do not believe the `maxnet` package runs permutation importance, but `ENMeval` might. 
I'll tag Jamie Kass, but would `enm.variable.importance()` or `eval.variable.importance()` work for this?

Bethany
The Wallace Team

Jordan Engelbrecht

unread,
Aug 7, 2024, 11:35:29 AM8/7/24
to Wallace Ecological Modeling App
Thank you so much. enm.variable.importance() isn't working and neither is eval.variable.importance(). I saw on Stack Overflow that someone had the same issue and resolved it using maxent.jar. I tried to change the model algorithm from "maxent" to "maxent.jar" but keep getting errors (see screenshot below). Do you or @Jamie Kass have any advice?

Your help would be greatly appreciated!


Screenshot 2024-08-07 132935.png

Jordan Engelbrecht

unread,
Aug 7, 2024, 11:35:32 AM8/7/24
to Wallace Ecological Modeling App
Thank you so much! Neither enm.variable.importance() nor eval.variable.importance() will work. I saw somewhere that someone managed to generate the variable importance results by running the model with the algorithm "maxent.jar" and not "maxent". I did so, but it still won't work...see code in screenshot attached. Do you or @Jamie Kass have any suggestions? (or anyone for that matter). I have installed Java and the Java execution file maxent. 

Your help would be greatly appreciated!!

On Monday, 05 August 2024 at 17:53:28 UTC+2 Wallace Ecological Modeling App wrote:
Screenshot 2024-08-07 132935.png

Wallace Ecological Modeling App

unread,
Aug 7, 2024, 11:39:04 AM8/7/24
to Wallace Ecological Modeling App
Looks like there's a typo (one I myself make frequently). The two options for setting the algMaxent are maxnet or maxent.jar. Try switching the N and the E.

-Bethany

Jordan Engelbrecht

unread,
Aug 7, 2024, 9:14:50 PM8/7/24
to Wallace Ecological Modeling App
Wow haha. Always helps to have another set of eyes look at your code. Thank you so so much!

--
You received this message because you are subscribed to a topic in the Google Groups "Wallace Ecological Modeling App" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/wallaceEcoMod/9p0BJ4YSD-g/unsubscribe.
To unsubscribe from this group and all its topics, send an email to wallaceEcoMo...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/wallaceEcoMod/67637982-3637-4f7d-ab21-0eaf2f6565f3n%40googlegroups.com.

Mariana Mayte Hérnandez Flores

unread,
Nov 3, 2024, 7:52:47 PM11/3/24
to Wallace Ecological Modeling App
Hello! 

Were you able to solve your problem? Did you finally get the contribution of the variables for your models? 

I want to have this information but I have no idea how to do it, could you help me?

Reply all
Reply to author
Forward
0 new messages