forked from nantesmetropole/school_meal_forecast_xgboost
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathloop_pred3.R
39 lines (26 loc) · 1.28 KB
/
loop_pred3.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
library(tidyverse)
library(shiny)
shiny::reactiveConsole(enabled = TRUE)
all_freqs <- dt()$freqs
filt_freqs <- all_freqs %>%
dplyr::filter(date < lubridate::ymd("2020-01-31") | date > lubridate::ymd("2020-02-14")) %>%
dplyr::filter(date < lubridate::ymd("2020-03-23") | date > lubridate::ymd("2020-07-03")) %>%
dplyr::filter(date < lubridate::ymd("2021-03-08") | date > lubridate::ymd("2021-04-23"))
filt_freqs %>%
readr::write_csv(index$path[index$name == "freqs"])
mypreds2 <- tibble::tribble(
~annee, ~periode, ~debut, ~fin, ~colpred, ~training_type, ~confidence,
"2021-2022", "Hiver-Printemps", "2022-02-20", "2022-04-08", "reel", "xgb_interval", 0.9,
"2021-2022", "Ete-Printemps", "2021-08-31", "2022-04-08", "prevision", "xgb_interval", 0.7
)
for (i in 1:nrow(mypreds2)) {
print(paste(mypreds2$annee[i], mypreds2$periode[i], mypreds2$colpred[i]))
run_verteego(begin_date = mypreds2$debut[i],
column_to_predict = mypreds2$colpred[i],
data_path = "data",
confidence = mypreds2$confidence[i],
end_date = mypreds2$fin[i],
start_training_date='2016-09-01',
training_type=mypreds2$training_type[i],
weeks_latency=1)
}