Skip to content

ENH Add support for GLasso and Adaptive (reweighted) GLasso #280

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
wants to merge 15 commits into
base: main
Choose a base branch
from

Conversation

Perceptronium
Copy link

Context of the PR

Add Graphical Lasso and Adaptive Graphical Lasso estimators

Contributions of the PR

  • A new GraphicalLasso estimator that can:
  1. Handle weighted regularization.
  2. Use two different algorithms to solve the GLasso problem:
    2.1. The "Banerjee" approach as in Banerjee et al., 2008 (the original GLasso algorithm)
    2.2. The "Mazumder" approach as in Mazumder et al., 2012 (the P-GLasso algorithm)
  • A new AdaptiveGraphicalLasso estimator that solves the Reweighted Graphical Lasso problem, where the weights are updated following the procedure of Candès et al., 2008

  • Test functions for the two estimators

  • An illustrative example of the two estimators that plots their performance (in terms of NMSE and F1 score) as a function of the regularization hyperparameter.

@Perceptronium
Copy link
Author

Hello @Badr-MOUFAD ,
Hope everything is going well for you ! Could you take a look at this when you have the time ?
Thanks a lot !

@Badr-MOUFAD
Copy link
Collaborator

Definitely! Thnx for the PR 🚀

@mathurinm
Copy link
Collaborator

@Badr-MOUFAD no need to review yet, we realized that a barebone gramcd solver works much better than anderson working set here, we're still in the benchmarking phase. We'll ping you when the code is ready! 🙏

@mathurinm mathurinm marked this pull request as draft February 14, 2025 08:04
@mathurinm mathurinm changed the title Add support for GLasso and Adaptive (reweighted) GLasso WIP Add support for GLasso and Adaptive (reweighted) GLasso Feb 14, 2025
@mathurinm
Copy link
Collaborator

@Perceptronium the unit tests are failing:

@Perceptronium Perceptronium marked this pull request as ready for review April 3, 2025 08:03
@mathurinm mathurinm changed the title WIP Add support for GLasso and Adaptive (reweighted) GLasso ENH Add support for GLasso and Adaptive (reweighted) GLasso Apr 7, 2025
elif strategy == "mcp":
gamma = 3.
Weights = np.zeros_like(Theta)
Weights[np.abs(Theta)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I find this indentation quite hard to read

return self


def update_weights(Theta, alpha, strategy="log"):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method should be private (start with an underscore)



def update_weights(Theta, alpha, strategy="log"):
if strategy == "log":
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you try to directly use penalty.derivative as is done in IterativeReweightedL1 ?

Copy link
Contributor

@floriankozikowski floriankozikowski Apr 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this one is changed now (see class above AdaptiveGraphicalLassoPenalty), ready for review and to be discussed with Can. I have made tests below which we can delete later (see results in screenshot attached)
To-Dos left: Verify if its correct, check if it works with all penalties
For now, both options yield the same results in the comparison
Comparison_Penalty vs  Strategy code

@mathurinm
Copy link
Collaborator

@Perceptronium you can pull upstream main to fix the tests

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

Successfully merging this pull request may close these issues.

4 participants