Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jmoralez committed Feb 28, 2024
1 parent 1568f3a commit 1c49334
Show file tree
Hide file tree
Showing 7 changed files with 520 additions and 39 deletions.
2 changes: 1 addition & 1 deletion local_environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: mlforecast
channels:
- conda-forge
dependencies:
- coreforecast>=0.0.5
- fsspec
- holidays<0.21
- lightgbm
- matplotlib
Expand Down
5 changes: 5 additions & 0 deletions mlforecast/target_transforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,11 @@ def stack(scalers: Sequence["Differences"]) -> "Differences":
core_scaler = first_scaler.scalers_[0]
diffs = first_scaler.differences
out = Differences(diffs)
out.fitted_ = []
for i in range(len(scalers[0].fitted_)):
data = np.hstack([sc.fitted_[i].data for sc in scalers])
sizes = np.hstack([np.diff(sc.fitted_[i].indptr) for sc in scalers])
out.fitted_.append(GroupedArray(data, np.append(0, sizes.cumsum())))
out.scalers_ = [
core_scaler.stack([sc.scalers_[i] for sc in scalers])
for i in range(len(diffs))
Expand Down
Loading

0 comments on commit 1c49334

Please sign in to comment.