-
Notifications
You must be signed in to change notification settings - Fork 37
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
base: main
Are you sure you want to change the base?
ENH Add support for GLasso and Adaptive (reweighted) GLasso #280
Conversation
Hello @Badr-MOUFAD , |
Definitely! Thnx for the PR 🚀 |
@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! 🙏 |
@Perceptronium the unit tests are failing:
|
…into graphical_lasso
elif strategy == "mcp": | ||
gamma = 3. | ||
Weights = np.zeros_like(Theta) | ||
Weights[np.abs(Theta) |
There was a problem hiding this comment.
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"): |
There was a problem hiding this comment.
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": |
There was a problem hiding this comment.
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 ?
There was a problem hiding this comment.
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
@Perceptronium you can pull upstream main to fix the tests |
…dos: review math, check if it works with all other penalties and clean up code to one version if everything is correct
Context of the PR
Add Graphical Lasso and Adaptive Graphical Lasso estimators
Contributions of the PR
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.