Skip to content

Commit

Permalink
Add sorting by timestamp before the fit in catboost models (#1337)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mr-Geekman authored Jul 31, 2023
1 parent aac0fe1 commit e4c121c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed
-
-
- Add sorting by timestamp before the fit in `CatBoostPerSegmentModel` and `CatBoostMultiSegmentModel` ([#1337](https://github.com/tinkoff-ai/etna/pull/1337))
- Unify errors, warnings and checks in models ([#1312](https://github.com/tinkoff-ai/etna/pull/1312))
- Remove upper limitation on version of numba ([#1321](https://github.com/tinkoff-ai/etna/pull/1321))

Expand Down
1 change: 1 addition & 0 deletions etna/models/catboost.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ def fit(self, df: pd.DataFrame, regressors: List[str]) -> "_CatBoostAdapter":
:
Fitted model
"""
df = df.sort_values(by="timestamp")
features = df.drop(columns=["timestamp", "target"])
target = df["target"]
train_pool = self._prepare_pool(features, target.values)
Expand Down

1 comment on commit e4c121c

@github-actions
Copy link

Choose a reason for hiding this comment

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

Please sign in to comment.