# Code to reproduce variable importance paper

## GUIDE

The latest version of GUIDE may require a new input file from this code implementation.

The latest GUIDE can be downloaded at: [GUIDE homepage](http://pages.stat.wisc.edu/~loh/guide.html)

- GUIDE used in the paper 
  - version: 36.0 [GUIDE/](GUIDE)
  - [GUIDE/imp_t.in](GUIDE/imp_t.in) importance for continue outcome (simulation)
- Tested platform: Ubuntu 18.04.5 LTS (GNU/Linux 4.15.0-132-generic x86_64) with SLURM

## Methods

**Code**: [R](R/)

Prequest R package: [pacman](https://CRAN.R-project.org/package=pacman) for R packages management.

- [R/data_gen.R](R/data_gen.R) R code to generate simulation model. E0 - E5
- [R/rf.R](rf.R) Random forest importance
- [R/ranger.R](R/ranger.R) ranger importance
- [R/rpart.R](R/rpart.R) rpart importance
- [R/gbm.R](R/gbm.R) gbm importance
- [R/cforest.R](R/cforest.R) cforest1, 2 importance
- [R/ctree.R](R/ctree.R) ctree importance
- [R/guide.R](R/guide.R) guide importance. Only work for GUIDE 36.0 linux
- [R/rfSRC.R](R/rfSRC.R) rfsrc importance
- [R/glmnet.R](R/glmnet.R) glmnet importance
- [R/rlt.R](R/rlt.R) rlt importance
- [R/bart.R](R/bart.R) bartm importance. Require bartMachine installed

## Simulation

**Code**: [simulation](simulation/)

  - [simu.R](simulation/simu.R) Main code to run simulation for each time
  - [run.sh](simulation/run.sh) Shell script to execute each model and repeat model for multiple times
  - [run_example.sh](simulation/run_example.sh) Shell script to run a single trail for models E0 - E5

## Predictive importance & Real data

**Codes**: [realdata](realdata/)

  - [realdata/other_ss.R](realdata/other_ss.R) Crossponding to f and g in section 5
  - [realdata/all_ss.R](realdata/all_ss.R) Crossponding to h in section 5
  - [realdata/run.sh](realdata/run.sh) Shell script to run each data file

**Data**: [realdata/data](realdata/data)

All data files can be open and edit via a standard text editor.

GUIDE requires a raw data file and description file.

  - [baseball](realdata/data/bbdata.txt) 
  - [mpg](realdata/data/mpgdata.txt)
  - [solder](realdata/data/solder.dat)
  - covid (please directly request from author) or download from there website [https://doi.org/10.1371/journal.pmed.1003321.s006](https://doi.org/10.1371/journal.pmed.1003321.s006)
