Skip to content

Commit

Permalink
add logic to prevent overly large forecast in hts recon process
Browse files Browse the repository at this point in the history
  • Loading branch information
mitokic committed Oct 8, 2023
1 parent c91baae commit f0708f1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: finnts
Title: Microsoft Finance Time Series Forecasting Framework
Version: 0.3.0.9005
Version: 0.3.0.9006
Authors@R:
c(person(given = "Mike",
family = "Tokic",
Expand Down
3 changes: 2 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# finnts 0.3.0.9003 (DEVELOPMENT VERSION)
# finnts 0.3.0.9000 (DEVELOPMENT VERSION)

## Improvements

Expand All @@ -12,6 +12,7 @@
## Bug Fixes

- Best model selection
- Hierarchical forecast reconciliation

# finnts 0.3.0

Expand Down
3 changes: 3 additions & 0 deletions R/hierarchy.R
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,9 @@ reconcile_hierarchical_data <- function(run_info,

forecast_tbl <- model_tbl %>%
dplyr::select(Date, Train_Test_ID, Combo, Forecast) %>%
dplyr::rowwise() %>%
dplyr::mutate(Forecast = ifelse(Forecast > 100000000000000, 100000000000000, Forecast)) %>%
dplyr::ungroup() %>%
tidyr::pivot_wider(names_from = Combo, values_from = Forecast)

forecast_tbl[is.na(forecast_tbl)] <- 0
Expand Down

0 comments on commit f0708f1

Please sign in to comment.