1 Getting started
1.1 Installation
(require glmnet)
The package ships a prebuilt native library (libglmnetcompat) for each supported platform under "glmnet/native-libs/", staged at install time by the pre-install hook. No Fortran toolchain is needed to use the package; you only need one to rebuild the native library (see User guide).
1.2 A first call
Fit ordinary least squares and read off the result:
(require glmnet) (define fit (ols '((1.0 2.0) (2.0 1.0) (3.0 4.0) (4.0 3.0)) '(1.0 4.0 3.0 6.0))) (elnet-result-intercept fit) (elnet-result-coefficients fit)
You can also confirm the native library loaded and was built with the double-precision contract the numeric API depends on:
(glmnet-default-real-bytes) ; => 8 (glmnet-capi-abi-version) ; => 1
If (glmnet-default-real-bytes) is anything other than 8, the native library was built without -fdefault-real-8 and the numeric results would be wrong; the package raises an error at load time in that case rather than returning silent garbage.
Continue to User guide for the model concepts, or jump to Examples for runnable code.