knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)
library(xgboost)
library(drake)
library(tidymodels)
library(modeltime)
library(tidyverse)
library(tidyquant)
library(lubridate)
library(timetk)
library(modeltime.ensemble)
library(dplyr)
# R.utils::sourceDirectory("D:/R/bml_stocks/R/")
R.utils::sourceDirectory("R/")
interactive <- FALSE

Dự báo giá cổ phiếu ACB

Dữ liệu giá theo thời gian

readd(input_data) %>%
  plot_time_series(date, value, .interactive = interactive)

Chia dữ liệu thành 2 tập train/ test

readd(splits) %>%
  tk_time_series_cv_plan() %>%
  plot_time_series_cv_plan(date, value, .interactive = FALSE)

Modeltime Table

readd(models_tbl)

Calibration

readd(calibration_tbl)

Forecast (Testing Set)

readd(forecast_tbl) %>% 
  plot_modeltime_forecast(.legend_max_width = 25, # For mobile screens
                          .interactive      = interactive)

Accuracy table

readd(accuracy_tbl)$`_data`

Next week forecast

readd(one_week_fc)
# # Tunning
# readd(resamples_tscv) %>% 
#   tk_time_series_cv_plan() %>% 
#   plot_time_series_cv_plan(
#         date, value,
#         .facet_ncol  = 2,
#         .interactive = FALSE
#     )


nguyenngocbinh/bml_stocks documentation built on March 20, 2022, 7:11 a.m.