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 modular Group Prox Newton solver #103

Merged
merged 29 commits into from
Nov 2, 2022

Conversation

Badr-MOUFAD
Copy link
Collaborator

@Badr-MOUFAD Badr-MOUFAD commented Oct 19, 2022

This implements a group proximal Newton solver to extend skglm to handle problems with non-quadratic datafit and group separable penalties.

It proceeds as follows:

  • implement GroupProxNewton
  • unitest the solver for Group Logistic regression
  • perform benchmarks

link to benchmarks results
link to benchmark repo

@Badr-MOUFAD
Copy link
Collaborator Author

For the benchmarks,
I am not aware of any solver that solves Group Logistic regression problem
(yngvem do that but uses cross entropy as a loss).
Share with me If you have one in mind. I would like to add it to the benchmark.

@mathurinm
Copy link
Collaborator

@Badr-MOUFAD the cross entropy for 2 classes should be the logistic loss

@Badr-MOUFAD
Copy link
Collaborator Author

Badr-MOUFAD the cross entropy for 2 classes should be the logistic loss

Pls have a look at this potion the code. Also in the benchmark, we don't converge to the same objective.

@mathurinm
Copy link
Collaborator

@Badr-MOUFAD
Copy link
Collaborator Author

https://en.wikipedia.org/wiki/Cross_entropy#Cross-entropy_loss_function_and_logistic_regression

no ?

This is what one would expect. Also, after checking, yngvem LogisticGroupLasso with groups of size one does not give similar results to scikit-learn's LogisiticRegression.

I raised an issue yngvem/group-lasso#36.

Copy link
Collaborator

@QB3 QB3 left a comment

Choose a reason for hiding this comment

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

First round of review

skglm/solvers/group_prox_newton.py Outdated Show resolved Hide resolved
skglm/solvers/group_prox_newton.py Show resolved Hide resolved
Copy link
Collaborator

@QB3 QB3 left a comment

Choose a reason for hiding this comment

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

Thanks a lot for the outstanding work @Badr-MOUFAD !
One last question, GroupProxNewton has not been added to all the tests in the test_group.py file, is there a specific reason?

skglm/solvers/group_prox_newton.py Show resolved Hide resolved
skglm/solvers/group_prox_newton.py Outdated Show resolved Hide resolved
@Badr-MOUFAD
Copy link
Collaborator Author

One last question, GroupProxNewton has not been added to all the tests in the test_group.py file, is there a specific reason?

It's mainly to avoid redundancy and complications of unittest:

  1. for alpha_max test: group log reg and group lasso do not have the same alpha_max
  2. I didn't want to add tests for quadratic problems as prox newton is meant for non-quadratic ones, and we test it for log reg

@Badr-MOUFAD Badr-MOUFAD merged commit 34da16f into scikit-learn-contrib:main Nov 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants