Skip to content
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

ENH add weights for Group Lasso #223

Merged
merged 24 commits into from
Apr 1, 2022

Conversation

Badr-MOUFAD
Copy link
Collaborator

@Badr-MOUFAD Badr-MOUFAD commented Mar 11, 2022

closes #219

@codecov-commenter
Copy link

codecov-commenter commented Mar 11, 2022

Codecov Report

Merging #223 (5f0913f) into main (d4d7b77) will increase coverage by 0.70%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #223      +/-   ##
==========================================
+ Coverage   85.79%   86.50%   +0.70%     
==========================================
  Files          14       14              
  Lines         929      963      +34     
  Branches      128      128              
==========================================
+ Hits          797      833      +36     
+ Misses        101      100       -1     
+ Partials       31       30       -1     
Flag Coverage Δ
unittests ∅ <ø> (∅)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
celer/dropin_sklearn.py 95.71% <100.00%> (+0.03%) ⬆️
celer/homotopy.py 86.82% <100.00%> (+1.47%) ⬆️
celer/tests/test_docstring_parameters.py 73.61% <100.00%> (-0.19%) ⬇️
celer/tests/test_lasso.py 100.00% <100.00%> (ø)
celer/tests/test_mtl.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d4d7b77...5f0913f. Read the comment docs.

@mathurinm mathurinm changed the title WIP Group Lasso WIP Add weights for Group Lasso Mar 11, 2022
environment.yml Outdated Show resolved Hide resolved
@mathurinm mathurinm marked this pull request as draft March 11, 2022 11:57
celer/dropin_sklearn.py Outdated Show resolved Hide resolved
celer/dropin_sklearn.py Outdated Show resolved Hide resolved
celer/group_fast.pyx Outdated Show resolved Hide resolved
celer/group_fast.pyx Outdated Show resolved Hide resolved
celer/group_fast.pyx Outdated Show resolved Hide resolved
celer/homotopy.py Outdated Show resolved Hide resolved
celer/homotopy.py Outdated Show resolved Hide resolved
celer/homotopy.py Outdated Show resolved Hide resolved
environment.yml Outdated Show resolved Hide resolved
tt_numpydoc.py Outdated Show resolved Hide resolved
celer/group_fast.pyx Outdated Show resolved Hide resolved
celer/group_fast.pyx Outdated Show resolved Hide resolved
celer/group_fast.pyx Outdated Show resolved Hide resolved
celer/tests/test_mtl.py Outdated Show resolved Hide resolved
celer/tests/test_mtl.py Outdated Show resolved Hide resolved
celer/tests/test_mtl.py Outdated Show resolved Hide resolved
celer/tests/test_mtl.py Outdated Show resolved Hide resolved
@mathurinm
Copy link
Owner

The automatic build of the documentation fails. Can you check why and fix it ?

@mathurinm
Copy link
Owner

It's unrelated to this PR. #224 will fix it and I will merge main into this branch.

If we are all set can you clean up the various comments etc ?

@Badr-MOUFAD
Copy link
Collaborator Author

Sure, I will do it!
Could you check this https://github.com/mathurinm/celer/pull/223/files#r838150121
I m still struggling with test_weights_group_lasso. It's the only reason why the build fails.

@mathurinm
Copy link
Owner

Do you see a test failure locally ?
The tests pass on GH actions : https://github.com/mathurinm/celer/runs/5758904704?check_suite_focus=true

celer/homotopy.py Outdated Show resolved Hide resolved
celer/homotopy.py Outdated Show resolved Hide resolved
celer/homotopy.py Outdated Show resolved Hide resolved
celer/homotopy.py Outdated Show resolved Hide resolved
celer/homotopy.py Outdated Show resolved Hide resolved
celer/homotopy.py Outdated Show resolved Hide resolved
raise ValueError("Unsupported problem %s" % pb)
if pb.lower() == "lasso":
# prevent referenced before assigned error
grp_ptr, grp_indices, n_groups = None, None, None
Copy link
Owner

Choose a reason for hiding this comment

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

can you avoid diff like that ? They make the PR harder to review. Can you revert ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

grp_ptr, grp_indices, n_groups = None, None, None is necessary to avoid breaking down_check_weights

Copy link
Owner

Choose a reason for hiding this comment

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

grp_ptr, grp_indices are not needed in check_weights, so we can remove these 2

Fewer variable definitions makes simpler code, fewer sources of mistake.

Can you think of a design where you would'nt have to do this ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I added these two variables for code readability.
I will remove them and keep n_groups

celer/homotopy.py Outdated Show resolved Hide resolved
celer/homotopy.py Outdated Show resolved Hide resolved
celer/homotopy.py Outdated Show resolved Hide resolved
@Badr-MOUFAD Badr-MOUFAD requested a review from mathurinm March 31, 2022 09:56
@Badr-MOUFAD Badr-MOUFAD changed the title WIP Add weights for Group Lasso ENH add weights for Group Lasso Mar 31, 2022
@mathurinm mathurinm marked this pull request as ready for review April 1, 2022 14:13
@mathurinm mathurinm merged commit 700c280 into mathurinm:main Apr 1, 2022
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.

ENH add weights to GroupLasso to provide support for an Adaptive GroupLasso
3 participants