-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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] Change GGS to inherit from BaseSeriesAnnotator #5315
[ENH] Change GGS to inherit from BaseSeriesAnnotator #5315
Conversation
Adding a pointer to my comment in the merged PR re |
Agreed. It is also related to the interesting question how the final interface should look like.
I don't know whethe this should be done, at all - might be too invasive to the existing code. |
Btw, this has been a frequent point of discussion for transformations too - some transformers do not have any essential logic in In order to adhere to the "strategy pattern", all objects of the same type must have the same interface, so even if This may seem counterintuitive from a parsimony perspective if looking only at the individual class, but the point is to ensure all classes fit to the same base interface. |
df0844d
to
f8c31e7
Compare
The get_params and set_params methods from the parent BaseObject class are sufficient.
@fkiraly, thanks for pointing that out. I think you are right, the
Removed |
The _intermediate_change_points and _intermediate_ll are attributes according to the GreedyGaussianSegmentation docstring but since they were attributes of the GGS adaptee class they were not accessible. This commit makes them into properties so they are accessible.
Yes - the default |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
One blocking but minor thing, we should not override _repr_
as the BaseObject
also handles that (and it plays a role in the html representation of nested estimators afaik)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, didn't spot that you fixed the small request.
(if you click the circling arrows next to the reviewer symbol, you re-request a review)
Re having fit or not - interesting question. |
Reference Issues/PRs
#5296 must be merged before this PR can.
What does this implement/fix? Explain your changes.
Updates
GreedyGaussianSegmentation
to inherit fromBaseSerieAnnotator
following theHMM
class as a guide.Does your contribution introduce a new dependency? If yes, which one?
No.
What should a reviewer concentrate their feedback on?
_predict
method. It would be good to refactor this out into theBaseSeriesAnnotator
class but I think that is a job for another PR.GGS
class to inherit fromBaseSeriesAnnotator
class. It would be good for this to be done but again I think this is a job for another PR.Did you add any tests for the change?
No but I had to add the type conversions in the
_predict
method to get theannotation
tests to pass locally.Any other comments?
This changes means that, similarly to the
HMM
class, thefit
method has to be called before thepredict
method even thoughfit
does not contain any essential logic. Perhaps these classes should only have afit_predict
method and neither afit
orpredict
method. Here is the example from theHMM
docstring demontstrating this.PR checklist
For all contributions
How to: add yourself to the all-contributors file in the
sktime
root directory (not theCONTRIBUTORS.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 pluscode
if you also fixed the bug in the PR).maintenance
- CI, test framework, release.See here for full badge reference
See here for further details on the algorithm maintainer role.
For new estimators
docs/source/api_reference/taskname.rst
, follow the pattern.Examples
section.python_dependencies
tag and ensureddependency isolation, see the estimator dependencies guide.