Skip to content

Create method TSDataset.flatten #241

Merged
merged 8 commits into from
Nov 2, 2021
Merged

Create method TSDataset.flatten #241

merged 8 commits into from
Nov 2, 2021

Conversation

alex-hse-repository
Copy link
Collaborator

@alex-hse-repository alex-hse-repository commented Nov 1, 2021

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

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?

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

Create method TSDataset.flatten

Related Issue

Closing issues

closes #226

@codecov-commenter
Copy link

codecov-commenter commented Nov 1, 2021

Codecov Report

Merging #241 (1cf09cf) into master (6b3e6b9) will increase coverage by 0.06%.
The diff coverage is 94.11%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #241      +/-   ##
==========================================
+ Coverage   86.43%   86.49%   +0.06%     
==========================================
  Files          89       89              
  Lines        4232     4244      +12     
==========================================
+ Hits         3658     3671      +13     
+ Misses        574      573       -1     
Impacted Files Coverage Δ
etna/datasets/tsdataset.py 92.59% <94.11%> (+0.96%) ⬆️
etna/loggers/wandb_logger.py 34.78% <0.00%> (-1.09%) ⬇️
etna/transforms/lags.py 100.00% <0.00%> (ø)
etna/transforms/detrend.py 98.21% <0.00%> (ø)
etna/transforms/outliers.py 98.80% <0.00%> (ø)
etna/transforms/statistics.py 98.80% <0.00%> (ø)
etna/ensembles/voting_ensemble.py 100.00% <0.00%> (ø)
.../analysis/outliers/confidence_interval_outliers.py 90.62% <0.00%> (+3.66%) ⬆️

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 6b3e6b9...1cf09cf. Read the comment docs.

Copy link
Contributor

@julia-shenshina julia-shenshina left a comment

Choose a reason for hiding this comment

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

Looks 👍🏼
could you please add test that checks smth like

assert (df == TSDataset.to_flatten(TSDataset.to_dataset(df))).all().all()

3 2021-06-04 segment_0 1.00
4 2021-06-05 segment_0 1.00
>>> df_ts_format = TSDataset.to_dataset(df)
>>> ts = TSDataset(df_ts_format, "D")
Copy link
Contributor

Choose a reason for hiding this comment

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

actually you don't need to create ts here, you can just run

df_ts_format = TSDataset.to_dataset(df)
TSDataset.to_flatten(df_ts_format).head(5)

🤔

julia-shenshina
julia-shenshina previously approved these changes Nov 2, 2021
@@ -384,3 +384,13 @@ def test_right_format_sorting():
inv_df = tsd.to_pandas(flatten=True)
pd.testing.assert_series_equal(df["reg_1"], inv_df["reg_1"])
pd.testing.assert_series_equal(df["reg_2"], inv_df["reg_2"])
'''
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
'''

@@ -52,6 +51,7 @@ def df_and_regressors() -> Tuple[pd.DataFrame, pd.DataFrame]:
return df, df_exog


'''
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
'''

julia-shenshina
julia-shenshina previously approved these changes Nov 2, 2021
@julia-shenshina julia-shenshina merged commit a51a363 into master Nov 2, 2021
@iKintosh iKintosh deleted the issue-226 branch November 18, 2021 15:50
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.

Make TSDataset.to_flatten static method
3 participants