Giter Club home page Giter Club logo

glmnet_matlab's Introduction

glmnet_matlab_R2020

Glmnet Logo

Glmnet compiled for MATLAB R2020b, Windows 10 64-bit.

Update: Glmnet compiled for R2020b seems to work fine on R2021a and R2022b.

N.B. Check Releases and Branches for different MATLAB versions (e.g. R2020a).

I also fixed cvglmnet.m, updating the old functions for parallel computing (from matlabpool to parpool).

Installation

The code from this repository is plug-and-play: just download the folder, add it to your MATLAB path and run your GLM!

Background

Glmnet is an extremely efficient package for fitting the entire lasso or elastic-net path for linear regression, logistic and multinomial regression, Poisson regression and the Cox model. It is way faster than MATLAB lassoglm that comes with the Statistics and Machine Learning Toolbox.

Glmnet provided by the authors are not compatible with newer versions of MATLAB (>R2016, I read somewhere). Indeed, my Matlab 2020a on Windows 10 was going into fatal crash when running the original code. Also the code provided by growlix did not work on my system. So I compiled again the Fortran code which glmnet is based on (and makes it so fast). Glmnet does work fine now on my system (MATLAB R2020a, Windows 10 64-bit).

Implementation

N.B. The glmnet toolbox that comes with this repository is already compiled, i.e. the code is plug-and-play: just download the release for a specific MATLAB version, add the code folder to your MATLAB path and run your GLM!
You do not have to run the following steps - these are just to compile glmnet from scracth.

To compile the glmnet code, I first installed:

Then, in MATLAB, I moved into the glmnet folder and ran

mex -v COMPFLAGS='$COMPFLAGS /real_size:64 /integer_size:64' glmnetMex.F GLMnet.f

Please cite the authors if you use Glmnet:

Glmnet for Matlab (2013) Qian, J., Hastie, T., Friedman, J., Tibshirani, R. and Simon, N.
http://www.stanford.edu/~hastie/glmnet_matlab/

Sources

glmnet_matlab's People

Contributors

lachioma avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

glmnet_matlab's Issues

MATLAB crashes when using poisson GLM

Hi there,

Thanks for uploading the compiled code for MATLAB!

I was wondering if you had any issues using the poisson GLM?

When I run this model I get a 'MATLAB has generated an internal error and needs to close message' every time.

I am wondering if this means that the code needed to run poisson is not properly compiled?

Best wishes,
Alice

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.