mathurinm / celer

Fast solver for L1-type problems: Lasso, sparse Logisitic regression, Group Lasso, weighted Lasso, Multitask Lasso, etc.
https://mathurinm.github.io/celer/
BSD 3-Clause "New" or "Revised" License
204 stars 33 forks source link

FIX - Compatibility with ``scikit-learn`` 1.2.dev #279

Closed Badr-MOUFAD closed 1 year ago

Badr-MOUFAD commented 2 years ago

scikit-learn 1.2.dev breaks down the actual code. debug_script.py provides a small snippet to reproduce.

investigation

scikit-learn seems to have added a validation step of the class parameters at the fit moment. our Lasso estimator doesn't have the same signature as the scikit-learn (e.g. copy_X and random_state), though we inherit from it.

Therefore we get an error when comparing the constructor arguments with the parent class

click to expend error ```shell raise ValueError( ValueError: The parameter constraints ['alpha', 'fit_intercept', 'precompute', 'max_iter', 'copy_X', 'tol', 'warm_start', 'positive', 'random_state', 'selection'] contain unexpected parameters {'copy_X', 'precompute', 'random_state', 'selection'} ```

potential fix

A straightforward fix would be to override _validate_params. But I don't think it's a reliable way to do it.

click to expend code ```python def _validate_params(self): pass ```
Badr-MOUFAD commented 1 year ago

Closing as it's no longer a problem