View source: R/hypervolume_variable_importance.R

hypervolume_variable_importance | R Documentation |

Assesses the contribution of each variable to the total hypervolume as a rough metric of variable importance.

hypervolume_variable_importance(hv, verbose = TRUE)

`hv` |
A hypervolume for which the importance of each variable should be calculated. |

`verbose` |
If |

The algorithm proceeds by comparing the n-dimensional input hypervolume's volume to all possible n-1 dimensional hypervolumes where each variable of interest has been deleted. The importance score reported is the ratio of the n-dimensional hypervolume relative to each of the n-1 dimensional hypervolumes. Larger values indicate that a variable makes a proportionally higher contribution to the overall volume.

The algorithm can only be used on Hypervolumes that have a `Data`

and `Method`

value, because the variable deletion process is not well defined for objects that are not associated with a particular set of observations and construction method.

A named vector with importance scores for each axis. Note that these scores are not dimensionless but rather have units corresponding to the original units of each variable.

# low parameter values for speed data(penguins,package='palmerpenguins') penguins_no_na = as.data.frame(na.omit(penguins)) penguins_adelie = penguins_no_na[penguins_no_na$species=="Adelie", c("bill_length_mm","bill_depth_mm","flipper_length_mm")] hv = hypervolume_box(penguins_adelie,name='Adelie') varimp = hypervolume_variable_importance(hv,verbose=FALSE) barplot(varimp,ylab='Importance',xlab='Variable')

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.