-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
glmnet work #7
Open
madrury
wants to merge
80
commits into
dwf:master
Choose a base branch
from
madrury:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
glmnet work #7
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fit methods now take parameters such as weights and offsets that should only be known at fit time. Validation method factored into multiple small mathods to help with this.
Cross validation with two strategies: weighted and unweighted. Also refactored the cv code into multiple modules.
Cross validation folds all use same values of lambda. Calculation of lambda max added to elastic_net to facilitate this, need to investigate the calculation for logistic_net more deeply before implementing.
Imlemented weight adjustment for the max lambda calculation. Also a strategy for the alpha = 0 (ridge) case. No idea what the fortran code does currently, the literature is silent on this point.
This bug was introduced upon updating the fortran code. The interceps attribute shape changed, a call to ravel was added to compensate.
Calculation researched and validated to give the same results as the fortran code. Cross validation for logistic models is done.
Remove dependence on sklearn.standardize. NotImplementedErrors. Better handling of y in .fit.
The describe method is now more robust. 1) Moved to glmnet.py, so its available to all subclasses. 2) Factored into few helper methods, alowing it to give different levels of detail depending on the state of the mdoel when called.
This is necessary any time a matrix is standardized.
* zero variance predictors. * non non-zero predictors.
Still not sure how to get perfectly stable tests. Maybe consider not generating random data and instead taking data from static files.
* Improve documentation. * Add describe method. * Add error checking.
Allow passing an existing kfold object when creating a new CVGlmNet.
Implement KFold class, which can be used as a generator in much the same way as weighted_k_fold could before, but carres meta information so that the same object can be used multiple times.
This enhancement was suggested by Declan Groves. Allow the fill model to be fit in parallel along with the sub models (fit on folds of the data during cross validation). This can potentially cut cross validation model fitting time in half.
Move max lambda calculations outside of .fit
Added util/importers.py to handle importing of optional dependencies (joblib, pyplot).
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I've been working on the python glmnet for a couple weeks now. Here's what i've accomplished:
I plan on continuing to expand, my next goal is to add support for poisson regression.
As a side note, I had trouble getting the setup.py you provided to work, so I have to come back to this at some point.