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

[MNT] Deprecation message for CyclicBoosting changes #320

Merged

Conversation

setoguchi-naoki
Copy link
Contributor

Reference Issues/PRs

#232

What does this implement/fix? Explain your changes.

  • Add deprication warning
  • Docstring

Does your contribution introduce a new dependency? If yes, which one?

No

No

What should a reviewer concentrate their feedback on?

I'm not familiar with the detail for deprecation process and which future version we should set for removing default parameters.

Did you add any tests for the change?

No

Any other comments?

PR checklist

For all contributions
  • I've added myself to the list of contributors with any new badges I've earned :-)
    How to: add yourself to the all-contributors file in the skpro root directory (not the CONTRIBUTORS.md). Common badges: code - fixing a bug, or adding code logic. doc - writing or improving documentation or docstrings. bug - reporting or diagnosing a bug (get this plus code if you also fixed the bug in the PR).maintenance - CI, test framework, release.
    See here for full badge reference
  • The PR title starts with either [ENH], [MNT], [DOC], or [BUG]. [BUG] - bugfix, [MNT] - CI, test framework, [ENH] - adding or improving code, [DOC] - writing or improving documentation or docstrings.
For new estimators
  • I've added the estimator to the API reference - in docs/source/api_reference/taskname.rst, follow the pattern.
  • I've added one or more illustrative usage examples to the docstring, in a pydocstyle compliant Examples section.
  • If the estimator relies on a soft dependency, I've set the python_dependencies tag and ensured
    dependency isolation, see the estimator dependencies guide.

@fkiraly fkiraly changed the title [MNT] Deplication announcement for CyclicBoosting [MNT] Deprecation message for CyclicBoosting changes May 12, 2024
@fkiraly fkiraly added maintenance Continuous integration, unit testing & package distribution module:regression probabilistic regression module labels May 12, 2024
comment = "Parameter 'lower' and 'upper' will be moved to \
class parameters in version X.X.X. \
To retain prior behaviour, set 'lower' to 0.0 \
and 'upper' to large number explicitly"
Copy link
Collaborator

Choose a reason for hiding this comment

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

should this not be None instead of a large number?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It should be a large number here because 'upper' is used as the range of the differential. However, I made a mistake in the docstring for the default value of 'upper ', it is not None but 1e3 in the future version. In this case too, the large number should be set to the 'upper' parameter to cover the range of the user's dataset.

Copy link
Collaborator

@fkiraly fkiraly left a comment

Choose a reason for hiding this comment

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

I think this is good, given the changes.

I would improve it as follows:

  • the message in __init__ needs only be raised if the changing parameters are invoked with a non-default, since that is the only case where behaviour changes or can break.

The parameters in the methods imo can be removed without deprecation message, as they were not API compliant

@setoguchi-naoki
Copy link
Contributor Author

the message in init needs only be raised if the changing parameters are invoked with a non-default, since that is the only case where behaviour changes or can break.

Thanks, I modified as following your comment. the default values of 'lower' and 'upper' will be removed in the future version. I made a wrong deprecation message. It is also modified. If the default value is removed, a deprecation message is always raised, as this can break the user's code.

The parameters in the methods imo can be removed without deprecation message, as they were not API compliant

Sorry, I'm not sure I understand your comment. Which method did you mention?

@setoguchi-naoki
Copy link
Contributor Author

In addition, what future version should we specify in deprecation message?

@fkiraly
Copy link
Collaborator

fkiraly commented May 15, 2024

2.4.0 - the second next MINOR release.

I've opened a new PR here that covers only the regressor class: #329
The distribution should be covered by this: #327

@fkiraly
Copy link
Collaborator

fkiraly commented May 16, 2024

If we want to make further changes, these will have to wait until 2.5.0, as we will now proceed to the 2.3.0 release shortly, after which the second next MINOR release will be 2.5.0 - see point 4 here which explains this: https://www.sktime.net/en/stable/developer_guide/deprecation.html#deprecation-policy

The changes in #329 or #327 should not prevent us from making further changes to the distribution interface.

fkiraly added a commit that referenced this pull request May 16, 2024
Deprecation messages for `CyclicBoosting` for deprecations and changes
in 2.4.0.
Alternative to #320.

* restores sequence of parameters to sequence in version 2.2.2, to avoid
breakage in the 2.3.0 release
* adds deprecation message for `bound` parameter
* renames new `version` parameter to `dist_type` - the name is a bit
misleading, as it will probably imply "version" in the semantic
versioning sense to an ordinary user. Does not require deprecation,
because added since 2.2.2.

Also makes improvements to the docstring of the `CyclicBoosting`
estimator.

Difference to #320: does not carry out deprecations for distributions,
under a working assumption that #327 will be merged.
@setoguchi-naoki
Copy link
Contributor Author

Thank you for your contribution. As there are no tasks left for me to do, I have no problem closing this PR if it is unnecessary.

@fkiraly
Copy link
Collaborator

fkiraly commented May 19, 2024

Well, I dealt only with the CyclicBoosting class for deprecation.

We may stlil have to decide what to do with the distributions, in deprecation. For instance:

  • all QPD_X distributions have parameters lower and upper. Are these needed? Or should we deprecate them? I think @FelixWick mentioned this in his review of [ENH] native implementation of Johnson QPD family, explicit pdf #327, and I replied that I left these because they were in the initial implementation.
  • what about dist_shape?
  • do we want to allow arbitrary distributions, incl scipy and skpro distributions as base distributions in QPD?

My advice would hence be, let's be clear about the target interfaces, from that it will become clear whether we need any further change/deprecation management, or not.

@setoguchi-naoki
Copy link
Contributor Author

all QPD_X distributions have parameters lower and upper. Are these needed? Or should we deprecate them? I think @FelixWick mentioned this in his review of #327, and I replied that I left these because they were in the initial implementation.

As mentioned in #327 , the lower and upper parameters are not necessarily needed in all QPD classes if findiff is not used. Therefore, the upper parameter can be removed in QPD_S and the lower and upper parameters in QPD_U.

what about dist_shape?

The dist_shape parameter is an option for fine-tuning the QPD_U. Therefore, it can be removed as a deprecated parameter if simplification of the QPD class interface is a priority. How do you think?

do we want to allow arbitrary distributions, incl scipy and skpro distributions as base distributions in QPD?

It would be good to be able to specify scipy and skpro distributions, as you have implemented in #327. In this case, I don't think some support is needed in the deprecated process.

Let me check the situation. Should I add a deplication message to this PR to meet the #327 specification? Is there anything else I should consider?

@FelixWick
Copy link

The shape parameter is only used for the extended QPD versions (Which include QPD_U. That means only QPD_S and QPD_B are "original" ones.), which I suggest to remove here.

@fkiraly
Copy link
Collaborator

fkiraly commented May 20, 2024

As mentioned in #327 , the lower and upper parameters are not necessarily needed in all QPD classes if findiff is not used. Therefore, the upper parameter can be removed in QPD_S and the lower and upper parameters in QPD_U.

Ok, that makes sense, I was wondering what these were used for, already.

The need to use findiff is completely removed now, since the current native implementation computes pdf explicitly (just use the chain rule 😁 ). So let's deprecate the unused parameters then.

The dist_shape parameter is an option for fine-tuning the QPD_U. Therefore, it can be removed as a deprecated parameter if simplification of the QPD class interface is a priority. How do you think?

I agree it should be removed. I would actually replace it by:

  • renaming version to a more appropriate name, e.g., base_dist
  • allowing base_dist to be a parametric skpro distirbution, which can have its own parameters. If users want to pass dist_shape, they can pass it as a parameter to base_dist.

@fkiraly
Copy link
Collaborator

fkiraly commented May 20, 2024

Let me check the situation. Should I add a deplication message to this PR to meet the #327 specification? Is there anything else I should consider?

This might require extending the logic, at least addition of a test case that passes an skpro distirbution.

I would also strongly suggest to rename the parameter version, as it has strong connotations with versioning, e.g., semver.

Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@setoguchi-naoki
Copy link
Contributor Author

@fkiraly
I modfied deplication message like

  • Removal of uppers and dist_shape from some QPD classes
  • Rename version to base_dist

at least addition of a test case that passes an skpro distirbution.

The skpro distribution has not yet been introduced and tested in qpd.py. Should it be done in other branches?

@fkiraly
Copy link
Collaborator

fkiraly commented May 22, 2024

Great!

I think you're quite out of sync with your branch since the new release - can you merge main into your branch, and ensure to resolve all conflicts? Only the files related to CyclicBootsing should be changed.

@fkiraly
Copy link
Collaborator

fkiraly commented May 22, 2024

FYI, see
image

I think you somehow ended up on a conflicting branch - can you kindly sync with main?

@setoguchi-naoki
Copy link
Contributor Author

I think I have resolved the conflicts in the main branch.

@fkiraly
Copy link
Collaborator

fkiraly commented May 22, 2024

I think I have resolved the conflicts in the main branch.

👍 yes, looks like it!

Copy link
Collaborator

@fkiraly fkiraly left a comment

Choose a reason for hiding this comment

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

Great!

One minor thing, we should ensure that users can already move to the future behaviour, i.e., have a chance to update their code in advance. That would mean adding the base_dist parameter already right now, an dif it is passed, it overrides version.

Have a look here how renaming a parameter works, including a suggested warning message: https://www.sktime.net/en/stable/developer_guide/deprecation.html#id2

@setoguchi-naoki
Copy link
Contributor Author

Thank you. Fixes for parameter renaming have been applied.

Copy link
Collaborator

@fkiraly fkiraly left a comment

Choose a reason for hiding this comment

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

Made some minor tweaks around the docstrings (moved to the "final" form), and release manager actions.

@fkiraly fkiraly merged commit 5198603 into sktime:main May 28, 2024
36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance Continuous integration, unit testing & package distribution module:regression probabilistic regression module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants