vimp
Perform inference on algorithm-agnostic variable importance
Science Score: 49.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
✓DOI references
Found 6 DOI reference(s) in README -
○Academic publication links
-
✓Committers with academic emails
3 of 6 committers (50.0%) from academic institutions -
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (18.7%) to scientific vocabulary
Keywords
Repository
Perform inference on algorithm-agnostic variable importance
Basic Info
- Host: GitHub
- Owner: bdwilliamson
- License: other
- Language: R
- Default Branch: master
- Homepage: http://bdwilliamson.github.io/vimp/
- Size: 15 MB
Statistics
- Stars: 24
- Watchers: 5
- Forks: 8
- Open Issues: 0
- Releases: 27
Topics
Metadata Files
README.md
R/vimp: inference on algorithm-agnostic variable importance 
<!-- badges: start -->
<!-- badges: end -->
Software authors: Brian Williamson, Jean Feng, and Charlie Wolock
Methodology authors: Brian Williamson, Peter Gilbert, Noah Simon, Marco Carone, Jean Feng
Python package: https://github.com/bdwilliamson/vimpy
Introduction
In predictive modeling applications, it is often of interest to determine the relative contribution of subsets of features in explaining an outcome; this is often called variable importance. It is useful to consider variable importance as a function of the unknown, underlying data-generating mechanism rather than the specific predictive algorithm used to fit the data. This package provides functions that, given fitted values from predictive algorithms, compute algorithm-agnostic estimates of population variable importance, along with asymptotically valid confidence intervals for the true importance and hypothesis tests of the null hypothesis of zero importance.
Specifically, the types of variable importance supported by vimp include: difference in population classification accuracy, difference in population area under the receiver operating characteristic curve, difference in population deviance, difference in population R-squared.
More detail may be found in our papers on R-squared-based variable importance, general variable importance, and general Shapley-based variable importance.
This method works on low-dimensional and high-dimensional data.
Issues
If you encounter any bugs or have any specific feature requests, please file an issue.
R installation
You may install a stable release of vimp from CRAN via install.packages("vimp"). You may also install a stable release of vimp from GitHub via devtools by running the following code (replace v2.1.0 with the tag for the specific release you wish to install):
```r
install.packages("devtools") # only run this line if necessary
devtools::install_github(repo = "bdwilliamson/vimp@v2.1.0") ```
You may install a development release of vimp from GitHub via devtools by running the following code:
```r
install.packages("devtools") # only run this line if necessary
devtools::install_github(repo = "bdwilliamson/vimp") ```
Example
This example shows how to use vimp in a simple setting with simulated data, using SuperLearner to estimate the conditional mean functions and specifying the importance measure of interest as the R-squared-based measure. For more examples and detailed explanation, please see the vignette.
```r
load required functions and libraries
library("SuperLearner") library("vimp") library("xgboost") library("glmnet")
-------------------------------------------------------------
problem setup
-------------------------------------------------------------
set up the data
n <- 100 p <- 2 s <- 1 # desire importance for X_1 x <- as.data.frame(replicate(p, runif(n, -1, 1))) y <- (x[,1])^2(x[,1]+7/5) + (25/9)(x[,2])^2 + rnorm(n, 0, 1)
-------------------------------------------------------------
get variable importance!
-------------------------------------------------------------
set up the learner library, consisting of the mean, boosted trees,
elastic net, and random forest
learner.lib <- c("SL.mean", "SL.xgboost", "SL.glmnet", "SL.randomForest")
get the variable importance estimate, SE, and CI
I'm using only 2 cross-validation folds to make things run quickly; in practice, you should use more
set.seed(20231213) vimp <- vimp_rsquared(Y = y, X = x, indx = 1, V = 2) ```
Citation
After using the vimp package, please cite the following (for R-squared-based variable importance):
@article{williamson2020,
author={Williamson, BD and Gilbert, PB and Carone, M and Simon, R},
title={Nonparametric variable importance assessment using machine learning techniques},
journal={Biometrics},
year={2020},
doi={10.1111/biom.13392}
}
or the following (for general variable importance parameters):
@article{williamson2021,
author={Williamson, BD and Gilbert, PB and Simon, NR and Carone, M},
title={A general framework for inference on algorithm-agnostic variable importance},
journal={Journal of the American Statistical Association},
year={2021},
doi={10.1080/01621459.2021.2003200}
}
or the following (for Shapley-based variable importance):
@inproceedings{williamson2020,
title={Efficient nonparametric statistical inference on population feature importance using {S}hapley values},
author={Williamson, BD and Feng, J},
year={2020},
booktitle={Proceedings of the 37th International Conference on Machine Learning},
volume={119},
pages={10282--10291},
series = {Proceedings of Machine Learning Research},
URL = {http://proceedings.mlr.press/v119/williamson20a.html}
}
License
The contents of this repository are distributed under the MIT license. See below for details:
``` MIT License
Copyright (c) [2018-present] [Brian D. Williamson]
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ```
Logo
The logo was created using hexSticker and lisa. Many thanks to the maintainers of these packages and the Color Lisa team.
Owner
- Name: Brian Williamson
- Login: bdwilliamson
- Kind: user
- Location: Seattle, Washington USA
- Company: Kaiser Permanente Washington Health Research Institute
- Website: https://bdwilliamson.github.io/
- Repositories: 46
- Profile: https://github.com/bdwilliamson
Assistant Investigator at Kaiser Permanente Washington Health Research Institute. Interested in inference in high-dimensional settings.
GitHub Events
Total
- Release event: 1
- Watch event: 5
- Push event: 21
- Pull request review event: 2
- Pull request event: 1
- Create event: 1
Last Year
- Release event: 1
- Watch event: 5
- Push event: 21
- Pull request review event: 2
- Pull request event: 1
- Create event: 1
Committers
Last synced: over 2 years ago
Top Committers
| Name | Commits | |
|---|---|---|
| Brian Williamson | b****6@u****u | 856 |
| Brian Williamson | b****n@k****g | 69 |
| Brian Williamson | b****2@f****g | 59 |
| Brian Williamson | b****6@B****U | 18 |
| Jean Feng | j****g@g****m | 4 |
| cwolock | c****k@u****u | 1 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 7
- Total pull requests: 13
- Average time to close issues: about 1 month
- Average time to close pull requests: about 1 hour
- Total issue authors: 2
- Total pull request authors: 3
- Average comments per issue: 2.86
- Average comments per pull request: 0.0
- Merged pull requests: 12
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 0
- Pull requests: 2
- Average time to close issues: N/A
- Average time to close pull requests: about 1 hour
- Issue authors: 0
- Pull request authors: 1
- Average comments per issue: 0
- Average comments per pull request: 0.0
- Merged pull requests: 1
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- bdwilliamson (5)
- ddimmery (2)
Pull Request Authors
- bdwilliamson (9)
- cwolock (3)
- jjfeng (1)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- cran 724 last-month
- Total dependent packages: 0
- Total dependent repositories: 1
- Total versions: 22
- Total maintainers: 1
cran.r-project.org: vimp
Perform Inference on Algorithm-Agnostic Variable Importance
- Homepage: https://bdwilliamson.github.io/vimp/
- Documentation: http://cran.r-project.org/web/packages/vimp/vimp.pdf
- License: MIT + file LICENSE
-
Latest release: 2.3.6
published 6 months ago
Rankings
Maintainers (1)
Dependencies
- R >= 3.1.0 depends
- MASS * imports
- ROCR * imports
- SuperLearner * imports
- boot * imports
- data.table * imports
- dplyr * imports
- magrittr * imports
- rlang * imports
- stats * imports
- tibble * imports
- covr * suggests
- cowplot * suggests
- cvAUC * suggests
- gam * suggests
- ggplot2 * suggests
- glmnet * suggests
- knitr * suggests
- polspline * suggests
- quadprog * suggests
- ranger * suggests
- rmarkdown * suggests
- testthat * suggests
- tidyselect * suggests
- xgboost * suggests
- actions/checkout v2 composite
- r-lib/actions/setup-pandoc v1 composite
- r-lib/actions/setup-r v1 composite
- r-lib/actions/setup-r-dependencies v1 composite
- actions/checkout v4 composite
- r-lib/actions/check-r-package v2 composite
- r-lib/actions/setup-r v2 composite
- r-lib/actions/setup-r-dependencies v2 composite
- r-hub/actions/checkout v1 composite
- r-hub/actions/platform-info v1 composite
- r-hub/actions/run-check v1 composite
- r-hub/actions/setup v1 composite
- r-hub/actions/setup-deps v1 composite
- r-hub/actions/setup-r v1 composite