#' Saldae Forecasting tool
#' @description Time Series Forecasting engine ....
#' @author Farid Azouaou
#' @param tisefka input data
#' @param target_variables target variables
#' @param actuals_time_periode historical data to use for training
#' @param Saldae_model forecasting model
#' @param anomaly_detection logical whether to activate or not anomaly detection
#' @return a list of forecasts
#' @export
Saldae_Forecaster <- function(tisefka = NULL,target_variables = NULL,date_frequency = NULL,actuals_time_periode = NULL,anomaly_detection = FALSE,sald_holidays = NULL,Saldae_model = c("saldae_prophet") ){
asurif_arzdat <- max(min(floor(nrow(tisefka) / 2), 1000),60)
tisefka <- tisefka%>%dplyr::arrange(date)
if(is.null(target_variables))target_variables <- tisefka%>%dplyr::select(-date)%>%colnames()
#. outliers correction
if (anomaly_detection == TRUE) {
tisefka <- SaldaeDataExplorer::anomaly_detection_nnegh(tisefka = tisefka, anomaly_mode = "anomalize", target_ts = target_variables)
}else{
tisefka <- target_variables%>%purrr::map(~interpolate_missing_dates(tisefka = tisefka[,c("date",.x)], target_variable = .x, date_unit = date_frequency))%>%
stats::setNames(target_variables)
}
#. generate forecast
if(Saldae_model =="saldae_prophet"){
fcast_object <- Saldae_prophet_multiple(tisefka_list = tisefka,ukud_unit = date_frequency,actuals_time_periode = actuals_time_periode,sald_holidays = sald_holidays, asurif_zdat = asurif_arzdat)
}
return(fcast_object)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.