Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Add individual penalization to precision matrix in graphical_lasso.py #27652

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

Open
marcellobarylli opened this issue Oct 24, 2023 · 4 comments
Open
Labels

Comments

@marcellobarylli
Copy link

Describe the workflow you want to enable

Friedman et al. (2008) describe the coordinate descent procedure used for the graphical lasso.
In the paper, there is a REMARK 2.1, which states that the objective function to be optimized can be modified to allow for a matrix of penalty values, rather than a scalar value.

Describe your proposed solution

This has been implemented here.
However, linear_model._cd_fast.pyx still has to be updated to allow for vectorized alpha input in enet_coordinate_descent_gram

Describe alternatives you've considered, if relevant

No response

Additional context

This change is motivated to allow for prior incorporation into the inference procedure. When strong priors for edges are available, this can affect the strength of the corresponding edges' penalization.

@marcellobarylli marcellobarylli added Needs Triage Issue requires triage New Feature labels Oct 24, 2023
@Dracocybertech
Copy link

I'm new on GitHub but I would like to contribute to this issue if this is possible.

@marcellobarylli
Copy link
Author

@Dracocybertech Awesome! Here is the link to my fork: https://github.com/m-barylli/scikit-learn-graphical-lasso-edit

If you want to make edits, please refer to this guide: https://scikit-learn.org/stable/developers/advanced_installation.html

Currently, _cd_fast.pyx (Here: https://github.com/scikit-learn/scikit-learn/blob/main/sklearn/linear_model/_cd_fast.pyx) needs to be updated according to the changes made in _graph_lasso.py.

If you are still interested, let me know!

@adrinjalali adrinjalali added help wanted Needs Decision Requires decision and removed Needs Triage Issue requires triage help wanted labels Dec 1, 2023
@ogrisel
Copy link
Member

ogrisel commented Dec 1, 2023

We already discussed the possibility of adding matrix-parameterized regularization to linear models in the pass (I think it was for GLMs with @lorentzenchr and discussed with @agramfort and at the time we decided that this kind of feature would be outside of the scope of scikit-learn because we would need consistent support for various estimators / solver combinations and it can severely increase the maintenance cost of the library.

Still the code change is not that large in the case of graphical lasso. So I am a bit undecided. But if we decide one way or another we should be consistent.

@lorentzenchr
Copy link
Member

Related to #11566.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants