Skip to content

Add find_change_points and tests for it #521

Merged
merged 8 commits into from
Feb 14, 2022
Merged

Conversation

Mr-Geekman
Copy link
Contributor

@Mr-Geekman Mr-Geekman commented Feb 9, 2022

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

Look #485.

Related Issue

#485.

Closing issues

Closes #485.

@Mr-Geekman Mr-Geekman added the enhancement New feature or request label Feb 9, 2022
@Mr-Geekman Mr-Geekman self-assigned this Feb 9, 2022
@codecov-commenter
Copy link

codecov-commenter commented Feb 9, 2022

Codecov Report

Merging #521 (fda9fdc) into master (d80a910) will increase coverage by 0.03%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #521      +/-   ##
==========================================
+ Coverage   87.99%   88.03%   +0.03%     
==========================================
  Files         116      118       +2     
  Lines        5538     5556      +18     
==========================================
+ Hits         4873     4891      +18     
  Misses        665      665              
Impacted Files Coverage Δ
etna/analysis/__init__.py 100.00% <100.00%> (ø)
etna/analysis/change_points_trend/__init__.py 100.00% <100.00%> (ø)
...analysis/change_points_trend/find_change_points.py 100.00% <100.00%> (ø)
...na/transforms/decomposition/change_points_trend.py 98.94% <100.00%> (-0.12%) ⬇️
etna/transforms/math/statistics.py 98.54% <0.00%> (ø)

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 d80a910...fda9fdc. Read the comment docs.

@Mr-Geekman Mr-Geekman marked this pull request as ready for review February 11, 2022 09:20
series: pd.Series, change_point_model: BaseEstimator, **model_predict_params
) -> List[pd.Timestamp]:
"""Find change trend points within one segment."""
signal = _prepare_signal(series=series, model=change_point_model)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Make the order of parameters consistent with the order of parameters in signature(or vice versa)

def find_change_points(
ts: TSDataset, in_column: str, change_point_model: BaseEstimator, **model_predict_params
) -> Dict[str, List[pd.Timestamp]]:
"""Find change trend points using ruptures models.
Copy link
Collaborator

Choose a reason for hiding this comment

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

May be "change trend points" -> "trend change points"

Returns
-------
result:
dictionary with list of change trend points for each segment
Copy link
Collaborator

Choose a reason for hiding this comment

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

May be "change trend points" -> "trend change points"

@alex-hse-repository alex-hse-repository merged commit ab4a3e5 into master Feb 14, 2022
@iKintosh iKintosh deleted the issue-485 branch March 22, 2022 08:38
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 change point find method
3 participants