Skip to content

Fix forecast first point in CatBoostPerSegmentModel #1010

Merged
merged 4 commits into from
Nov 25, 2022
Merged

Conversation

DBcreator
Copy link
Contributor

@DBcreator DBcreator commented Nov 23, 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

Closing issues

closes #785

@github-actions
Copy link

github-actions bot commented Nov 23, 2022

@github-actions github-actions bot temporarily deployed to pull request November 23, 2022 13:37 Inactive
@codecov-commenter
Copy link

codecov-commenter commented Nov 23, 2022

Codecov Report

Merging #1010 (8092039) into master (a465a2a) will increase coverage by 0.04%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master    #1010      +/-   ##
==========================================
+ Coverage   85.74%   85.79%   +0.04%     
==========================================
  Files         162      162              
  Lines        8616     8616              
==========================================
+ Hits         7388     7392       +4     
+ Misses       1228     1224       -4     
Impacted Files Coverage Δ
etna/models/mixins.py 95.65% <100.00%> (ø)
etna/auto/utils.py 94.73% <0.00%> (+21.05%) ⬆️

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

@github-actions github-actions bot temporarily deployed to pull request November 23, 2022 14:38 Inactive
@Mr-Geekman
Copy link
Contributor

Update changelog.

@github-actions github-actions bot temporarily deployed to pull request November 23, 2022 17:19 Inactive
@@ -288,8 +288,7 @@ def _make_predictions_segment(
model: Any, segment: str, ts: TSDataset, prediction_method: Callable, **kwargs
) -> pd.DataFrame:
"""Make predictions for one segment."""
segment_features = ts[:, segment, :]
segment_features = segment_features.droplevel("segment", axis=1)
segment_features = ts.to_pandas()[segment]
Copy link
Contributor

Choose a reason for hiding this comment

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

I have doubts that it will slow down all our per-segment models because conversion to_pandas will happen for each segment and it isn't free (we make a copy where).

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 make this copy only once in _make_prediction and remember it.

@github-actions github-actions bot temporarily deployed to pull request November 24, 2022 09:17 Inactive
@DBcreator DBcreator merged commit 554d4ea into master Nov 25, 2022
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.

[BUG] Can't forecast first point with CatBoostPerSegmentModel
3 participants