BwUniCluster2.0/Software/R/Glmnet: Difference between revisions
< BwUniCluster2.0 | Software | R
Jump to navigation
Jump to search
(Created page with "= Installation instructions = Consider starting an interactive job for compiling. Copy and paste the following to your shell. <pre> # Load the R software module, e.g. module...") |
No edit summary |
||
(7 intermediate revisions by 5 users not shown) | |||
Line 1: | Line 1: | ||
<span style="color:red"><b>Note that the instructions provided below refer to R 4.2.1 (but not R 4.3.3)! We are currently updating our guides for R 4.3.3. </b></span> |
|||
= General information = |
|||
glmnet is a R library for lasso and elastic-net regularized generalized linear models |
|||
= Installation instructions = |
= Installation instructions = |
||
Line 11: | Line 16: | ||
# Write the following environment variables to Makevars |
# Write the following environment variables to Makevars |
||
# Skip the 2nd and 3rd commands below if Makevars already consist these variables (1st command shows content of Makevars) |
|||
⚫ | |||
cat ~/.R/Makevars |
|||
⚫ | |||
⚫ | |||
⚫ | |||
# Install the glmnet package from within R session |
# Install the glmnet package from within R session |
||
Line 20: | Line 29: | ||
# Run a quick test |
# Run a quick test |
||
> library(glmnet) |
> library(glmnet) |
||
> data(QuickStartExample) |
|||
> x <- QuickStartExample$x |
|||
> y <- QuickStartExample$y |
|||
> fit <- glmnet(x, y) |
|||
> print(fit) |
|||
</pre> |
</pre> |
Latest revision as of 09:51, 18 June 2024
Note that the instructions provided below refer to R 4.2.1 (but not R 4.3.3)! We are currently updating our guides for R 4.3.3.
General information
glmnet is a R library for lasso and elastic-net regularized generalized linear models
Installation instructions
Consider starting an interactive job for compiling. Copy and paste the following to your shell.
# Load the R software module, e.g. module load math/R/4.1.2 # Prepare .R directory (if it does not already exists) mkdir -p ~/.R # Write the following environment variables to Makevars # Skip the 2nd and 3rd commands below if Makevars already consist these variables (1st command shows content of Makevars) cat ~/.R/Makevars echo "CXX17=icpc" >> ~/.R/Makevars echo "CXX17FLAGS=-O3 -fPIC -std=c++17 -axCORE-AVX512,CORE-AVX2,AVX -xSSE4.2 -fp-model strict -qopenmp" >> ~/.R/Makevars # Install the glmnet package from within R session R -q > install.packages("glmnet", dependencies=TRUE) # Run a quick test > library(glmnet) > data(QuickStartExample) > x <- QuickStartExample$x > y <- QuickStartExample$y > fit <- glmnet(x, y) > print(fit)