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

[BUG] fix unreported set_params bug in ClassifierPipeline and RegressorPipeline #3857

Merged
merged 13 commits into from Dec 22, 2022

Conversation

fkiraly
Copy link
Collaborator

@fkiraly fkiraly commented Nov 30, 2022

set_params bug in ClassifierPipeline and RegressorPipeline was broken, it would not correctly update parameters.

The failure to detect this is an instance of the known problem #3429

The bug has been fixed, and is now covered by appropriate tests (addition of a second parameter set).

The fix is as follow:

  • the issue was in set_params which accidentally had one too many layer of nesting in the param dict indexing, e.g., classifier__ etc. This would materialize only for doubly nested estimators.
  • this was fixed, with a concomitant extension of the dict subset utility in the _HetereogenousMetaEstimator.

Depends on #3858 as the DummyClassifier is used as one of two param sets.

@fkiraly fkiraly added module:classification classification module: time series classification module:regression regression module: time series regression bugfix Fixes a known bug or removes unintended behavior labels Nov 30, 2022
aiwalter
aiwalter previously approved these changes Nov 30, 2022
@aiwalter aiwalter self-requested a review November 30, 2022 16:47
@miraep8
Copy link
Collaborator

miraep8 commented Nov 30, 2022

Hmmm, any thoughts on the error messages? Seem to be specific to this PR, but only crop up in certain python versions I am guessing?

@fkiraly
Copy link
Collaborator Author

fkiraly commented Dec 1, 2022

Hmmm, any thoughts on the error messages? Seem to be specific to this PR, but only crop up in certain python versions I am guessing?

The fact that it´s in different versions is coming from estimators being split across version/OS combinations to minimize runtime of tests

fkiraly added a commit that referenced this pull request Dec 22, 2022
This adds an equality dunder to `BaseObject` descendants.

Two `BaseObject` descendants are considered equal if they define the same estimator blueprint, i.e., nested `get_params` result in value-identical dictionaries (with nested call to `__eq__` should those dictionaries contain `BaseObject` descendants).

Includes a test for expected properties of the dunder.

This is prompted by issues of equality testing in tests such as in the failure relevant for #3857, where equality currently means object identity rather than parameter identity.

FYI @RNKuhns, this could/should be an `skbase` feature, so would appreciate opinion on whether it interacts with any of the other tests or properties.
@fkiraly fkiraly merged commit 84a8ef3 into main Dec 22, 2022
@fkiraly fkiraly deleted the pipeline_set_params_fix branch December 22, 2022 01:03
fkiraly added a commit that referenced this pull request Feb 13, 2023
…3631)

This PR isolates `numba` throughout `sktime`.

Note: does *not* turn `numba` into a soft dependency.

This is required for all approaches to making `sktime` python 3.11 compatible as long as `numba` is not python 3.11 compatible, because that requires being able to run the framework components of `sktime` without `numba` imports.

See also #3963.

The general recipe to isolate `numba`:

* move `numba` imports into functions and classes, where possible
* where loose functions are decorated with `jit` and `njit`, move them to a private module `_orig_modulename_numba`, and move imports of that into functions or classes
* add the package dependency tag to `numba` dependent estimators to isolate them
* use `pytest.skipif` to conditionally skip `numba` dependent non-suite tests if `numba` is not installed

Makes the following changes:
* changes the `test_module_softdeps` test to ignore private modules (starting with `_`), i.e., to not require a user warning. This is ok since users are not expected to import private modules.

Depends on #3857
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix Fixes a known bug or removes unintended behavior module:classification classification module: time series classification module:regression regression module: time series regression
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants