skglm icon indicating copy to clipboard operation
skglm copied to clipboard

MNT sklearn 1.2dev breaks estimator fitting

Open mathurinm opened this issue 2 years ago • 1 comments

Validation of parameters at fit time seems to be an issue, parameters which should be set by the parent class of, e.g., MCPRegressor, are not returned by get_params() and so clf._validate_params() fails:

FAILED skglm/tests/test_estimators.py::test_check_estimator[Lasso] - ValueError: The parameter constraints ['alpha', 'fit_intercept', 'normalize', 'precompute', 'max_iter', 'copy_X', 'tol', 'war...
FAILED skglm/tests/test_estimators.py::test_check_estimator[wLasso] - ValueError: The parameter constraints ['alpha', 'fit_intercept', 'normalize', 'precompute', 'max_iter', 'copy_X', 'tol', 'wa...
FAILED skglm/tests/test_estimators.py::test_check_estimator[ElasticNet] - ValueError: The parameter constraints ['alpha', 'l1_ratio', 'fit_intercept', 'normalize', 'precompute', 'max_iter', 'cop...
FAILED skglm/tests/test_estimators.py::test_check_estimator[MCP] - ValueError: The parameter constraints ['alpha', 'fit_intercept', 'normalize', 'precompute', 'max_iter', 'copy_X', 'tol', 'warm_...
FAILED skglm/tests/test_estimators.py::test_estimator[X0-Lasso] - ValueError: The parameter constraints ['alpha', 'fit_intercept', 'normalize', 'precompute', 'max_iter', 'copy_X', 'tol', 'warm_s...
FAILED skglm/tests/test_estimators.py::test_estimator[X0-wLasso] - ValueError: The parameter constraints ['alpha', 'fit_intercept', 'normalize', 'precompute', 'max_iter', 'copy_X', 'tol', 'warm_...
FAILED skglm/tests/test_estimators.py::test_estimator[X0-ElasticNet] - ValueError: The parameter constraints ['alpha', 'l1_ratio', 'fit_intercept', 'normalize', 'precompute', 'max_iter', 'copy_X...
FAILED skglm/tests/test_estimators.py::test_estimator[X0-MCP] - ValueError: The parameter constraints ['alpha', 'fit_intercept', 'normalize', 'precompute', 'max_iter', 'copy_X', 'tol', 'warm_sta...
FAILED skglm/tests/test_estimators.py::test_estimator[X1-Lasso] - ValueError: The parameter constraints ['alpha', 'fit_intercept', 'normalize', 'precompute', 'max_iter', 'copy_X', 'tol', 'warm_s...
FAILED skglm/tests/test_estimators.py::test_estimator[X1-wLasso] - ValueError: The parameter constraints ['alpha', 'fit_intercept', 'normalize', 'precompute', 'max_iter', 'copy_X', 'tol', 'warm_...
FAILED skglm/tests/test_estimators.py::test_estimator[X1-ElasticNet] - ValueError: The parameter constraints ['alpha', 'l1_ratio', 'fit_intercept', 'normalize', 'precompute', 'max_iter', 'copy_X...
FAILED skglm/tests/test_estimators.py::test_estimator[X1-MCP] - ValueError: The parameter constraints ['alpha', 'fit_intercept', 'normalize', 'precompute', 'max_iter', 'copy_X', 'tol', 'warm_sta...
FAILED skglm/tests/test_estimators.py::test_generic_estimator[Quadratic-L1-False-Lasso-pen_args0] - ValueError: The parameter constraints ['alpha', 'fit_intercept', 'normalize', 'precompute', 'm...
FAILED skglm/tests/test_estimators.py::test_generic_estimator[Quadratic-WeightedL1-False-WeightedLasso-pen_args1] - ValueError: The parameter constraints ['alpha', 'fit_intercept', 'normalize', ...
FAILED skglm/tests/test_estimators.py::test_generic_estimator[Quadratic-L1_plus_L2-False-ElasticNet-pen_args2] - ValueError: The parameter constraints ['alpha', 'l1_ratio', 'fit_intercept', 'nor...
FAILED skglm/tests/test_estimators.py::test_generic_estimator[Quadratic-MCPenalty-False-MCPRegression-pen_args3] - ValueError: The parameter constraints ['alpha', 'fit_intercept', 'normalize', '...
FAILED skglm/tests/test_estimators.py::test_grid_search[Lasso] - ValueError: 
FAILED skglm/tests/test_estimators.py::test_grid_search[wLasso] - ValueError: 
FAILED skglm/tests/test_estimators.py::test_grid_search[ElasticNet] - ValueError: 
FAILED skglm/tests/test_estimators.py::test_grid_search[MCP] - ValueError: 
FAILED skglm/tests/test_group.py::test_equivalence_lasso - ValueError: The parameter constraints ['alpha', 'fit_intercept', 'normalize', 'precompute', 'max_iter', 'copy_X', 'tol', 'warm_start', ...
FAILED skglm/tests/test_group.py::test_vs_celer_grouplasso[15-50-True] - ValueError: The parameter constraints ['alpha', 'fit_intercept', 'normalize', 'precompute', 'max_iter', 'copy_X', 'tol', ...
FAILED skglm/tests/test_group.py::test_vs_celer_grouplasso[5-50-False] - ValueError: The parameter constraints ['alpha', 'fit_intercept', 'normalize', 'precompute', 'max_iter', 'copy_X', 'tol', ...
FAILED skglm/tests/test_group.py::test_vs_celer_grouplasso[19-59-False] - ValueError: The parameter constraints ['alpha', 'fit_intercept', 'normalize', 'precompute', 'max_iter', 'copy_X', 'tol',...
================================================================ 24 failed, 112 passed, 1 xfailed, 16 warnings in 114.40s (0:01:54) ================================================

Reproduce by

    clf = MCPRegression(
        alpha=alpha, gamma=np.inf, fit_intercept=False, tol=tol)
    print(clf.get_params())
    clf.fit(X, y)

in the setup of test_estimators.py

mathurinm avatar Jul 26 '22 13:07 mathurinm

@PABannier can you still reproduce?

mathurinm avatar Feb 20 '23 07:02 mathurinm

No longer able to reproduce, closing.

mathurinm avatar Jul 15 '24 07:07 mathurinm