Skip to content

Commit

Permalink
prevent overly large forecasts which contribute to writing to disk is…
Browse files Browse the repository at this point in the history
…sues
  • Loading branch information
mitokic committed Jan 17, 2024
1 parent dd64b38 commit 2265528
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
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.4.0
Version: 0.4.9000
Authors@R:
c(person(given = "Mike",
family = "Tokic",
Expand Down
6 changes: 6 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# finnts 0.4.9000 (DEVLOPMENT VERSION)

## Bug Fixes

- Issue when writing extremely large forecasts to disk

# finnts 0.4.0

## Improvements
Expand Down
4 changes: 4 additions & 0 deletions R/train_models.R
Original file line number Diff line number Diff line change
Expand Up @@ -637,6 +637,10 @@ train_models <- function(run_info,
tidyr::unite(col = "Model_ID", c("Model_Name", "Model_Type", "Recipe_ID"), sep = "--", remove = FALSE) %>%
dplyr::group_by(Combo_ID, Model_ID, Train_Test_ID) %>%
dplyr::mutate(Horizon = dplyr::row_number()) %>%
dplyr::ungroup() %>%
dplyr::rowwise() %>%
dplyr::mutate(Forecast = ifelse(Forecast > 1000000000000000, 1000000000000000, Forecast)) %>%
dplyr::mutate(Forecast = ifelse(Forecast < -1000000000000000, -1000000000000000, Forecast)) %>%
dplyr::ungroup()

if (unique(final_forecast_tbl$Combo_ID) == "All-Data") {
Expand Down

0 comments on commit 2265528

Please sign in to comment.