Skip to content

Implement predict in Pipeline, AutoRegressivePipeline #970

Merged
merged 8 commits into from
Oct 3, 2022

Conversation

Mr-Geekman
Copy link
Contributor

@Mr-Geekman Mr-Geekman commented Sep 28, 2022

Before submitting (must do checklist)

  • Did you read the contribution guide?
  • Did you update the docs? We use Numpy format for all the methods and classes.
  • Did you write any new necessary tests?
  • Did you update the CHANGELOG?

Proposed Changes

Look #958.

Closing issues

Closes #958.

d.a.bunin added 2 commits September 28, 2022 16:32
…s for predict method in Pipeline, AutoRegressivePipeline
@github-actions
Copy link

github-actions bot commented Sep 28, 2022

🚀 Deployed on https://deploy-preview-970--etna-docs.netlify.app

@github-actions github-actions bot temporarily deployed to pull request September 28, 2022 14:42 Inactive
@github-actions github-actions bot temporarily deployed to pull request September 28, 2022 15:02 Inactive
@codecov-commenter
Copy link

codecov-commenter commented Sep 28, 2022

Codecov Report

❗ No coverage uploaded for pull request base (inference@720fee9). Click here to learn what that means.
The diff coverage is n/a.

@@             Coverage Diff              @@
##             inference     #970   +/-   ##
============================================
  Coverage             ?   49.87%           
============================================
  Files                ?      132           
  Lines                ?     7673           
  Branches             ?        0           
============================================
  Hits                 ?     3827           
  Misses               ?     3846           
  Partials             ?        0           

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

from etna.transforms import Transform


class PipelineModelPredictMixin:
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we add all this functions to BasePipeline?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What for? They aren't needed for ensembles, only for Pipeline and AutoRegressivePipeline?

Copy link
Contributor

Choose a reason for hiding this comment

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

But the naming misleading PipelineModelPredictMixin, looks like it for all Pipelines

Copy link
Contributor Author

Choose a reason for hiding this comment

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

How would you name it? Is ModelPipelinePredictMixin sounds ok?

Copy link
Contributor

@martins0n martins0n Sep 30, 2022

Choose a reason for hiding this comment

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

I don't know. ModelPipelinePredictMixin is the same as PipelineModelPredictMixin. lol

I don't understand why I shouldn't use it in ensembles.

[DateFlagsTransform(), FilterFeaturesTransform(exclude=["regressor_exog_weekend"])],
],
)
def test_prepare_ts(context_size, start_idx, end_idx, transforms, example_reg_tsds):
Copy link
Contributor

Choose a reason for hiding this comment

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

It would be more obvious to specify expected values by hand: now expected values computed in runtime -- I guess it's a bit error prone solution: you use the same code to compute expected values - it helps to find bugs in regression testing but code could already has logical errors.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do you suggest to use start_timestamp and end_timestamp here instead of start_idx and end_idx?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Or add expected_start_idx here?

Copy link
Contributor

@martins0n martins0n Sep 30, 2022

Choose a reason for hiding this comment

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

start_timestamp and end_timestamp

Yep
I guess we know them without any computation

quantiles=[],
)

expected_ts = mixin._recreate_ts.return_value
Copy link
Contributor

Choose a reason for hiding this comment

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

exprcted_ts from return_value?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Method _recreate_ts is tested. So in this test I check that on the result of calling _recreate_ts the transforms are applied as expected.

Copy link
Contributor

Choose a reason for hiding this comment

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

It doesn't make more sense to me.But it's minor issue that could be ignored

@github-actions github-actions bot temporarily deployed to pull request September 30, 2022 10:52 Inactive
@github-actions github-actions bot temporarily deployed to pull request September 30, 2022 11:21 Inactive
etna/pipeline/autoregressive_pipeline.py Outdated Show resolved Hide resolved
etna/pipeline/autoregressive_pipeline.py Show resolved Hide resolved
) -> TSDataset:
raise NotImplementedError()
@staticmethod
def _validate_predict_timestamps(
Copy link
Contributor

Choose a reason for hiding this comment

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

This is not validation I guess

Copy link
Contributor Author

@Mr-Geekman Mr-Geekman Sep 30, 2022

Choose a reason for hiding this comment

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

Why not? It checks that it is in appropriate range and fills the value if it isn't present.

Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like builder creator or something like this

@github-actions github-actions bot temporarily deployed to pull request October 3, 2022 07:23 Inactive
@martins0n martins0n merged commit e1399fb into inference Oct 3, 2022
@martins0n martins0n deleted the issue-958 branch October 3, 2022 09:00
@Mr-Geekman Mr-Geekman mentioned this pull request Oct 26, 2022
4 tasks
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants