Skip to content

Refactor Prophet#1005

Merged
fkiraly merged 3 commits intosktime:mainfrom
thayeylolu:refactor-prophet
Jun 23, 2021
Merged

Refactor Prophet#1005
fkiraly merged 3 commits intosktime:mainfrom
thayeylolu:refactor-prophet

Conversation

@thayeylolu
Copy link
Copy Markdown
Collaborator

Reference : #955

We need to slowly re-factor all forecasters to be compliant with the new interface (see PR #912). i.e., no overrides of fit etc and descendant classes only implementing core logic, while the BaseForecaster implements check etc logic.

Currently this is running due to various downwards compatibility workarounds, which should be removed once all forecasters are ready (in "no-override" state)

The forecasters that still need a downstream refactor are:

  • FProphet

@thayeylolu
Copy link
Copy Markdown
Collaborator Author

@fkiraly Removing self._set_y_X(y, X, enforce_index_type=pd.DatetimeIndex) fails test with time_index. It is currently not removed. What do you suggest is the way forward?

@fkiraly
Copy link
Copy Markdown
Collaborator

fkiraly commented Jun 21, 2021

hm, interesting - I would introduce a tag called enforce_index_type.
If this tag exists, the value is passed to check_y_X in the base class.

The second line is done in the base class, the first (addition of tag) in the concrete class.

@fkiraly
Copy link
Copy Markdown
Collaborator

fkiraly commented Jun 21, 2021

I've suggested addition of this as a tag in #1013.

Once that is agreed and merged, you could set the enforce_index_type=pd.DatetimeIndex tag to the tags, and modify the base forecaster that the tag is passed to check_y_X.

@fkiraly
Copy link
Copy Markdown
Collaborator

fkiraly commented Jun 21, 2021

hm, I guess a temporary solution is to leave the conversion inside, as you did.

Opinions, @mloning?

@fkiraly fkiraly requested review from aiwalter, fkiraly and mloning June 22, 2021 11:40
fkiraly
fkiraly previously approved these changes Jun 22, 2021
Copy link
Copy Markdown
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.

happy with this to be merged as is, assuming we'll deal later with the enforece_index_type tag

@thayeylolu thayeylolu marked this pull request as ready for review June 22, 2021 11:58
Copy link
Copy Markdown
Contributor

@aiwalter aiwalter left a comment

Choose a reason for hiding this comment

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

I left one comment @thayeylolu

mloning
mloning previously approved these changes Jun 22, 2021
@thayeylolu
Copy link
Copy Markdown
Collaborator Author

Hello @aiwalter . I would like to suggest leaving the univariate only tag as True for the meantime. then, when we resolve the tag issues, we can go ahead and set it as False

Copy link
Copy Markdown
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.

happy with this - @aiwalter changed the tags by direct commit, so I think they are now good? And we agreed to change them later potentially in a new PR.

@fkiraly fkiraly merged commit 8fa4b58 into sktime:main Jun 23, 2021
fkiraly added a commit that referenced this pull request Jun 26, 2021
Adds some default tag values in `BaseForecaster` - these are automatically inherited via `_all_tags`.

Also adds two new tags that I anticipate we will need:
* `"X-y-must-have-same-index"` - do `X` and `y` need to have the same index?
* `"enforce-index-type"` argument to `check_X`/`check_y` if needed - this has to be a tag now, see the problem in #1005 .

I've also added these new tags to the extension template.

This PR also:
* corrects a minor bug: mis-spelled tags in the extension template
* adds the new tags to the allowed tags in tests
* removes the requirement for tags to be boolean
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants