Last updated: 2019-12-21

Checks: 7 0

Knit directory: 2019-feature-selection/

This reproducible R Markdown analysis was created with workflowr (version 1.6.0). The Checks tab describes the reproducibility checks that were applied when the results were created. The Past versions tab lists the development history.


Great! Since the R Markdown file has been committed to the Git repository, you know the exact version of the code that produced these results.

Great job! The global environment was empty. Objects defined in the global environment can affect the analysis in your R Markdown file in unknown ways. For reproduciblity it’s best to always run the code in an empty environment.

The command set.seed(20190522) was run prior to running the code in the R Markdown file. Setting a seed ensures that any results that rely on randomness, e.g. subsampling or permutations, are reproducible.

Great job! Recording the operating system, R version, and package versions is critical for reproducibility.

Nice! There were no cached chunks for this analysis, so you can be confident that you successfully produced the results during this run.

Great job! Using relative paths to the files within your workflowr project makes it easier to run your code on other machines.

Great! You are using Git for version control. Tracking code development and connecting the code version to the results is critical for reproducibility. The version displayed above was the version of the Git repository at the time these results were generated.

Note that you need to be careful to ensure that all relevant files for the analysis have been committed to Git prior to generating the results (you can use wflow_publish or wflow_git_commit). workflowr only checks the R Markdown file, but you know if there are other scripts or data files that it depends on. Below is the status of the Git repository when the results were generated:


Ignored files:
    Ignored:    .Rhistory
    Ignored:    .Rproj.user/
    Ignored:    .Ruserdata/
    Ignored:    .drake/
    Ignored:    analysis/rosm.cache/
    Ignored:    data/
    Ignored:    inst/Benchmark for Filter Methods for Feature Selection in High-Dimensional  Classification Data.pdf
    Ignored:    inst/study-area-map/study-area.qgs~
    Ignored:    log/
    Ignored:    renv/library/
    Ignored:    renv/staging/
    Ignored:    reviews/
    Ignored:    rosm.cache/

Untracked files:
    Untracked:  .pre-commit-config.yaml
    Untracked:  .vscode/
    Untracked:  analysis/figure/
    Untracked:  code/98-paper/ieee/._IEEEtran.cls
    Untracked:  code/98-paper/ieee/IEEEtran.cls
    Untracked:  code/98-paper/ieee/ieee-manuscript.dvi
    Untracked:  ieee-manuscript.aux
    Untracked:  ieee-manuscript.fdb_latexmk
    Untracked:  ieee-manuscript.fls
    Untracked:  ieee-manuscript.log

Unstaged changes:
    Modified:   .Rbuildignore
    Modified:   .Rprofile
    Modified:   _drake.R
    Modified:   analysis/eval-performance.Rmd
    Modified:   analysis/report-defoliation.Rmd
    Modified:   code/98-paper/ieee/pdf/correlation-filter-nri-1.pdf
    Modified:   code/98-paper/ieee/pdf/correlation-nbins-1.pdf
    Modified:   code/98-paper/ieee/pdf/defoliation-distribution-plot-1.pdf
    Modified:   code/98-paper/ieee/pdf/spectral-signatures-1.pdf
    Modified:   code/98-paper/journal/defoliation-distribution-plot-1.pdf

Note that any generated files, e.g. HTML, png, CSS, etc., are not included in this status report because it is ok for generated content to have uncommitted changes.


These are the previous versions of the R Markdown and HTML files. If you’ve configured a remote Git repository (see ?wflow_git_remote), click on the hyperlinks in the table below to view them.

File Version Author Date Message
html 3e8e33d pat-s 2019-11-06 Build site.
html 9241b85 pat-s 2019-10-05 Build site.
html fdc8064 pat-s 2019-09-28 Build site.
html 0b18307 pat-s 2019-09-21 Build site.
html aa0486b pat-s 2019-09-15 Build site.
Rmd bfd9ac1 pat-s 2019-09-15 wflow_publish(knitr_in(“analysis/response-normality.Rmd”), view =
Rmd 4b59fe9 pat-s 2019-09-12 wflow_publish(knitr_in(“analysis/response-normality.Rmd”), view =
Rmd 518d0cb pat-s 2019-09-01 style files using tidyverse style
Rmd 7582c67 pat-s 2019-08-31 Build site.
Rmd a5308c2 pat-s 2019-08-31 add response-normality Rmd

This document originated from the fear of having a response variable which is not normally distributed “enough”.

The response variable looks as follows:

Version Author Date
9241b85 pat-s 2019-10-05
fdc8064 pat-s 2019-09-28
aa0486b pat-s 2019-09-15

When applying the Shapiro-Wilk test we get


    Shapiro-Wilk normality test

data:  vi_data$defoliation
W = 0.86183, p-value < 2.2e-16

Exploring model residuals

Visualizing model residuals of LASSO and RF to see how they differ. The LASSO “predicted vs. fitted” plot shows limited model power.

Lasso model with no transformation of the response variable

Version Author Date
3e8e33d pat-s 2019-11-06
9241b85 pat-s 2019-10-05
fdc8064 pat-s 2019-09-28
0b18307 pat-s 2019-09-21
aa0486b pat-s 2019-09-15

RF model with no transformation of the response variable

Version Author Date
3e8e33d pat-s 2019-11-06
9241b85 pat-s 2019-10-05
fdc8064 pat-s 2019-09-28
0b18307 pat-s 2019-09-21
aa0486b pat-s 2019-09-15

Variable Transformations

The following transformations of the response variable were done to check if it they have an effect on the “residuals vs. fitted” and “QQ-Plot” shown above.

Power transformation

One option to enforce more normality of a variable is by applying a power transformation. The Box-Cox power transformation estimates a lambda value from the variable. Next, the transformation can be applied via

\[(y^lambda - 1) / lambda\]

There is a Stackoverflow question that shows how to do this.


R version 3.6.1 (2019-07-05)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: CentOS Linux 7 (Core)

Matrix products: default
BLAS:   /opt/spack/opt/spack/linux-centos7-x86_64/gcc-9.2.0/r-3.6.1-j25wr6zcofibs2zfjwg37357rjj26lqb/rlib/R/lib/libRblas.so
LAPACK: /opt/spack/opt/spack/linux-centos7-x86_64/gcc-9.2.0/r-3.6.1-j25wr6zcofibs2zfjwg37357rjj26lqb/rlib/R/lib/libRlapack.so

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
 [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] ggplot2_3.2.1    tidyselect_0.2.5 drake_7.8.0     

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.0         txtq_0.1.4         lattice_0.20-38   
 [4] tidyr_0.8.2        foreach_1.4.4      assertthat_0.2.0  
 [7] glmnet_2.0-16      rprojroot_1.3-2    digest_0.6.22     
[10] R6_2.4.1           smoof_1.5.1        backports_1.1.5   
[13] evaluate_0.13      httr_1.4.0         pillar_1.3.1      
[16] rlang_0.4.1        lazyeval_0.2.1     misc3d_0.8-4      
[19] data.table_1.12.6  whisker_0.3-2      Matrix_1.2-15     
[22] checkmate_1.9.1    rmarkdown_1.13     labeling_0.3      
[25] mco_1.0-15.1       splines_3.6.1      stringr_1.4.0     
[28] htmlwidgets_1.3    igraph_1.2.4.1     munsell_0.5.0     
[31] compiler_3.6.1     httpuv_1.4.5.1     xfun_0.5          
[34] DiceKriging_1.5.6  ParamHelpers_1.12  pkgconfig_2.0.3   
[37] mlr_2.16.0.9000    BBmisc_1.11        htmltools_0.3.6   
[40] tibble_2.0.1       workflowr_1.6.0    codetools_0.2-16  
[43] viridisLite_0.3.0  crayon_1.3.4       dplyr_0.8.0.1     
[46] withr_2.1.2        later_0.8.0        grid_3.6.1        
[49] jsonlite_1.6       gtable_0.2.0       git2r_0.26.1      
[52] magrittr_1.5       storr_1.2.1        mlrMBO_1.1.2      
[55] scales_1.0.0       stringi_1.3.1      fs_1.3.1          
[58] promises_1.0.1     parallelMap_1.4    filelock_1.0.2    
[61] lhs_1.0.1          fastmatch_1.1-0    plot3D_1.1.1      
[64] RColorBrewer_1.1-2 iterators_1.0.10   tools_3.6.1       
[67] RJSONIO_1.3-1.1    glue_1.3.0         purrr_0.3.0       
[70] parallel_3.6.1     survival_2.43-3    yaml_2.2.0        
[73] colorspace_1.4-0   base64url_1.4      plotly_4.8.0      
[76] knitr_1.23