This is a software library meant to be a performance-competitive alternative to the library glmnet. Currently supported features include:
- solving the elastic net optimization problem
- generating a regularization path
- selecting a lambda value that has excellent generalization performance via cross validation
I have written one usage example per described feature, which you can see in the src directory:
- cvx_validation.cc
- cross_validation.cc
- regularization_path.cc .
For more details, see the preliminary paper about the library.
###Dependencies
- g++ (at least v. 4.8).
- armadillo (at least v. 4.300).
- a linear algebra subroutine package supported by armadillo such as OpenBLAS.
In addition, I have only tested the library on machines running Linux.
###Installation To compile the examples and the rest of the improved_glmnet source code, perform the below steps:
-
You'll need modify the Makefile in the src directory to specify a linear algebra library to link against. I assume you took my advice and are using OpenBLAS. In this case, just change the OpenBLAS_DIR variable to point to the installation directory on your machine. That's it.
-
Run
make
.
###Usage Each example program expects paths to the data you'll be using. There are several sample datasets of different sizes included in the tests directory that you can use. So, for instance, after you have built the examples, you can run cvx_validation.out with the below command.
./cvx_validation.out 0.5 ../tests/fat/_100_300/_A ../tests/fat/_100_300/_b ../tests/fat/_100_300/_z
See the comments in any of the example source files for more detailed usage instructions.