Skip to content

Add Pipeline class #78

Merged
merged 4 commits into from
Sep 24, 2021
Merged

Add Pipeline class #78

merged 4 commits into from
Sep 24, 2021

Conversation

alex-hse-repository
Copy link
Collaborator

@alex-hse-repository alex-hse-repository commented Sep 22, 2021

IMPORTANT: Please do not create a Pull Request without creating an issue first.

Before submitting (checklist)

  • Was this discussed/approved via a Github issue? (no need for typos and docs improvements)
  • Did you read the contribution guide?
  • Did you check the code style? make lint (poetry install -E style).
  • Did you make sure to update the docs? We use Numpy format for all the methods and classes.
  • Did you write any new necessary tests?
  • Did you check that your code passes the unit tests pytest tests/ ?
  • Did you add your new functionality to the docs?
  • Did you update the CHANGELOG?

Type of Change

  • Examples / docs / tutorials / contributors update
  • Bug fix (non-breaking change which fixes an issue)
  • Improvement (non-breaking change which improves an existing feature)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Proposed Changes

-Add Pipeline class

Related Issue

PR review

Anyone in the community is free to review the PR once the tests have passed.
If we didn't discuss your PR in Github issues there's a high chance it will not be merged.

Closing issues

closes #64
Put closes #XXXX in your comment to auto-close the issue that your PR fixes (if such).

@codecov-commenter
Copy link

codecov-commenter commented Sep 22, 2021

Codecov Report

Merging #78 (9d7345b) into master (d152d9a) will decrease coverage by 2.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #78      +/-   ##
==========================================
- Coverage   90.14%   88.14%   -2.01%     
==========================================
  Files          48       52       +4     
  Lines        2152     2303     +151     
==========================================
+ Hits         1940     2030      +90     
- Misses        212      273      +61     
Impacted Files Coverage Δ
etna/pipeline/__init__.py 100.00% <100.00%> (ø)
etna/pipeline/pipeline.py 100.00% <100.00%> (ø)
etna/analysis/outliers/median_outliers.py 95.83% <0.00%> (-4.17%) ⬇️
etna/analysis/outliers/density_outliers.py 97.72% <0.00%> (-2.28%) ⬇️
etna/models/nn/tft.py 100.00% <0.00%> (ø)
etna/models/catboost.py 100.00% <0.00%> (ø)
etna/loggers/__init__.py 100.00% <0.00%> (ø)
etna/models/nn/deepar.py 100.00% <0.00%> (ø)
etna/transforms/__init__.py 100.00% <0.00%> (ø)
etna/model_selection/backtest.py 97.56% <0.00%> (ø)
... and 9 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d152d9a...9d7345b. Read the comment docs.

self :
Fitted Pipeline instance
"""
ts = deepcopy(ts)
Copy link
Contributor

Choose a reason for hiding this comment

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

May be we can use ts.copy(deep=True) in this case.

Copy link
Contributor

Choose a reason for hiding this comment

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

TSDataset does not have method copy

Copy link
Contributor

Choose a reason for hiding this comment

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

In this case we do not need deep copy because we work with TSDataset (has raw_df) and not with pd.DataFrame

Copy link
Contributor

@iKintosh iKintosh left a comment

Choose a reason for hiding this comment

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

Looks good except for the list as default argument

class Pipeline:
"""Pipeline of transforms with a final estimator."""

def __init__(self, model: Model, transforms: Iterable[Transform] = [], horizon: int = 1):
Copy link
Contributor

Choose a reason for hiding this comment

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

Should not use mutable objects as defaults

Suggested change
def __init__(self, model: Model, transforms: Iterable[Transform] = [], horizon: int = 1):
def __init__(self, model: Model, transforms: Iterable[Transform] = (), horizon: int = 1):

self :
Fitted Pipeline instance
"""
ts = deepcopy(ts)
Copy link
Contributor

Choose a reason for hiding this comment

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

TSDataset does not have method copy

Copy link
Contributor

@iKintosh iKintosh left a comment

Choose a reason for hiding this comment

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

🔥

@iKintosh iKintosh merged commit 3fd40e3 into master Sep 24, 2021
@iKintosh iKintosh deleted the ETNA-795 branch September 24, 2021 17:45
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create class Pipeline
4 participants