Title: | Time Series Prediction Integrated Tuning |
---|---|
Description: | Prediction is one of the most important activities while working with time series. There are many alternative ways to model the time series. Finding the right one is challenging to model them. Most data-driven models (either statistical or machine learning) demand tuning. Setting them right is mandatory for good predictions. It is even more complex since time series prediction also demands choosing a data pre-processing that complies with the chosen model. Many time series frameworks have features to build and tune models. The package differs as it provides a framework that seamlessly integrates tuning data pre-processing activities with the building of models. The package provides functions for defining and conducting time series prediction, including data pre(post)processing, decomposition, tuning, modeling, prediction, and accuracy assessment. More information is available at Izau et al. <doi:10.5753/sbbd.2022.224330>. |
Authors: | Eduardo Ogasawara [aut, ths, cre] , Carla Pacheco [aut], Cristiane Gea [aut], Diogo Santos [aut], Rebecca Salles [aut], Vitoria Birindiba [aut], Eduardo Bezerra [aut], Esther Pacitti [aut], Fabio Porto [aut], Federal Center for Technological Education of Rio de Janeiro (CEFET/RJ) [cph] |
Maintainer: | Eduardo Ogasawara <[email protected]> |
License: | MIT + file LICENSE |
Version: | 1.0.787 |
Built: | 2024-12-04 22:04:19 UTC |
Source: | CRAN |
List of Brazilian fertilizers consumption of N, P2O5, K2O.
brazil_n: nitrogen consumption from 1961 to 2020.
brazil_p2o5: phosphate consumption from 1961 to 2020.
brazil_k2o: potash consumption from 1961 to 2020.
data(fertilizers)
data(fertilizers)
list of fertilizers' time series.
This dataset was obtained from the MASS library.
International Fertilizer Association (IFA): http://www.fertilizer.org.
data(fertilizers) head(fertilizers$brazil_n)
data(fertilizers) head(fertilizers$brazil_n)
Time series data augmentation is a technique used to increase the size and diversity of a time series dataset by creating new instances of the original data through transformations or modifications. The goal is to improve the performance of machine learning models trained on time series data by reducing overfitting and improving generalization. Awareness reinforce recent data preferably.
ts_aug_awareness(factor = 1)
ts_aug_awareness(factor = 1)
factor |
increase factor for data augmentation |
a ts_aug_awareness
object.
library(daltoolbox) data(sin_data) #convert to sliding windows xw <- ts_data(sin_data$y, 10) #data augmentation using awareness augment <- ts_aug_awareness() augment <- fit(augment, xw) xa <- transform(augment, xw) ts_head(xa)
library(daltoolbox) data(sin_data) #convert to sliding windows xw <- ts_data(sin_data$y, 10) #data augmentation using awareness augment <- ts_aug_awareness() augment <- fit(augment, xw) xa <- transform(augment, xw) ts_head(xa)
Time series data augmentation is a technique used to increase the size and diversity of a time series dataset by creating new instances of the original data through transformations or modifications. The goal is to improve the performance of machine learning models trained on time series data by reducing overfitting and improving generalization. Awareness Smooth reinforce recent data preferably. It also smooths noise data.
ts_aug_awaresmooth(factor = 1)
ts_aug_awaresmooth(factor = 1)
factor |
increase factor for data augmentation |
a ts_aug_awaresmooth
object.
library(daltoolbox) data(sin_data) #convert to sliding windows xw <- ts_data(sin_data$y, 10) #data augmentation using awareness augment <- ts_aug_awaresmooth() augment <- fit(augment, xw) xa <- transform(augment, xw) ts_head(xa)
library(daltoolbox) data(sin_data) #convert to sliding windows xw <- ts_data(sin_data$y, 10) #data augmentation using awareness augment <- ts_aug_awaresmooth() augment <- fit(augment, xw) xa <- transform(augment, xw) ts_head(xa)
Time series data augmentation is a technique used to increase the size and diversity of a time series dataset by creating new instances of the original data through transformations or modifications. The goal is to improve the performance of machine learning models trained on time series data by reducing overfitting and improving generalization. Flip mirror the sliding observations relative to the mean of the sliding windows.
ts_aug_flip()
ts_aug_flip()
a ts_aug_flip
object.
library(daltoolbox) data(sin_data) #convert to sliding windows xw <- ts_data(sin_data$y, 10) #data augmentation using flip augment <- ts_aug_flip() augment <- fit(augment, xw) xa <- transform(augment, xw) ts_head(xa)
library(daltoolbox) data(sin_data) #convert to sliding windows xw <- ts_data(sin_data$y, 10) #data augmentation using flip augment <- ts_aug_flip() augment <- fit(augment, xw) xa <- transform(augment, xw) ts_head(xa)
Time series data augmentation is a technique used to increase the size and diversity of a time series dataset by creating new instances of the original data through transformations or modifications. The goal is to improve the performance of machine learning models trained on time series data by reducing overfitting and improving generalization. jitter adds random noise to each data point in the time series.
ts_aug_jitter()
ts_aug_jitter()
a ts_aug_jitter
object.
library(daltoolbox) data(sin_data) #convert to sliding windows xw <- ts_data(sin_data$y, 10) #data augmentation using flip augment <- ts_aug_jitter() augment <- fit(augment, xw) xa <- transform(augment, xw) ts_head(xa)
library(daltoolbox) data(sin_data) #convert to sliding windows xw <- ts_data(sin_data$y, 10) #data augmentation using flip augment <- ts_aug_jitter() augment <- fit(augment, xw) xa <- transform(augment, xw) ts_head(xa)
Does not make data augmentation.
ts_aug_none()
ts_aug_none()
a ts_aug_none
object.
library(daltoolbox) data(sin_data) #convert to sliding windows xw <- ts_data(sin_data$y, 10) #no data augmentation augment <- ts_aug_none() augment <- fit(augment, xw) xa <- transform(augment, xw) ts_head(xa)
library(daltoolbox) data(sin_data) #convert to sliding windows xw <- ts_data(sin_data$y, 10) #no data augmentation augment <- ts_aug_none() augment <- fit(augment, xw) xa <- transform(augment, xw) ts_head(xa)
Time series data augmentation is a technique used to increase the size and diversity of a time series dataset by creating new instances of the original data through transformations or modifications. The goal is to improve the performance of machine learning models trained on time series data by reducing overfitting and improving generalization. stretch does data augmentation by decreasing the volatility of the time series.
ts_aug_shrink(scale_factor = 0.8)
ts_aug_shrink(scale_factor = 0.8)
scale_factor |
for shrink |
a ts_aug_shrink
object.
library(daltoolbox) data(sin_data) #convert to sliding windows xw <- ts_data(sin_data$y, 10) #data augmentation using flip augment <- ts_aug_shrink() augment <- fit(augment, xw) xa <- transform(augment, xw) ts_head(xa)
library(daltoolbox) data(sin_data) #convert to sliding windows xw <- ts_data(sin_data$y, 10) #data augmentation using flip augment <- ts_aug_shrink() augment <- fit(augment, xw) xa <- transform(augment, xw) ts_head(xa)
Time series data augmentation is a technique used to increase the size and diversity of a time series dataset by creating new instances of the original data through transformations or modifications. The goal is to improve the performance of machine learning models trained on time series data by reducing overfitting and improving generalization. stretch does data augmentation by increasing the volatility of the time series.
ts_aug_stretch(scale_factor = 1.2)
ts_aug_stretch(scale_factor = 1.2)
scale_factor |
for stretch |
a ts_aug_stretch
object.
library(daltoolbox) data(sin_data) #convert to sliding windows xw <- ts_data(sin_data$y, 10) #data augmentation using flip augment <- ts_aug_stretch() augment <- fit(augment, xw) xa <- transform(augment, xw) ts_head(xa)
library(daltoolbox) data(sin_data) #convert to sliding windows xw <- ts_data(sin_data$y, 10) #data augmentation using flip augment <- ts_aug_stretch() augment <- fit(augment, xw) xa <- transform(augment, xw) ts_head(xa)
Time series data augmentation is a technique used to increase the size and diversity of a time series dataset by creating new instances of the original data through transformations or modifications. The goal is to improve the performance of machine learning models trained on time series data by reducing overfitting and improving generalization. Wormhole does data augmentation by removing lagged terms and adding old terms.
ts_aug_wormhole()
ts_aug_wormhole()
a ts_aug_wormhole
object.
library(daltoolbox) data(sin_data) #convert to sliding windows xw <- ts_data(sin_data$y, 10) #data augmentation using flip augment <- ts_aug_wormhole() augment <- fit(augment, xw) xa <- transform(augment, xw) ts_head(xa)
library(daltoolbox) data(sin_data) #convert to sliding windows xw <- ts_data(sin_data$y, 10) #data augmentation using flip augment <- ts_aug_wormhole() augment <- fit(augment, xw) xa <- transform(augment, xw) ts_head(xa)
Used to smooth out fluctuations, while giving more weight to recent observations. Particularly useful when the data has a trend or seasonality component.
ts_fil_ema(ema = 3)
ts_fil_ema(ema = 3)
ema |
exponential moving average size |
a ts_fil_ema
object.
# time series with noise library(daltoolbox) data(sin_data) sin_data$y[9] <- 2*sin_data$y[9] # filter filter <- ts_fil_ema(ema = 3) filter <- fit(filter, sin_data$y) y <- transform(filter, sin_data$y) # plot plot_ts_pred(y=sin_data$y, yadj=y)
# time series with noise library(daltoolbox) data(sin_data) sin_data$y[9] <- 2*sin_data$y[9] # filter filter <- ts_fil_ema(ema = 3) filter <- fit(filter, sin_data$y) y <- transform(filter, sin_data$y) # plot plot_ts_pred(y=sin_data$y, yadj=y)
EMD Filter
ts_fil_emd(noise = 0.1, trials = 5)
ts_fil_emd(noise = 0.1, trials = 5)
noise |
noise |
trials |
trials |
a ts_fil_emd
object.
# time series with noise library(daltoolbox) data(sin_data) sin_data$y[9] <- 2*sin_data$y[9] # filter filter <- ts_fil_emd() filter <- fit(filter, sin_data$y) y <- transform(filter, sin_data$y) # plot plot_ts_pred(y=sin_data$y, yadj=y)
# time series with noise library(daltoolbox) data(sin_data) sin_data$y[9] <- 2*sin_data$y[9] # filter filter <- ts_fil_emd() filter <- fit(filter, sin_data$y) y <- transform(filter, sin_data$y) # plot plot_ts_pred(y=sin_data$y, yadj=y)
FFT Filter
ts_fil_fft()
ts_fil_fft()
a ts_fil_fft
object.
# time series with noise library(daltoolbox) data(sin_data) sin_data$y[9] <- 2*sin_data$y[9] # filter filter <- ts_fil_fft() filter <- fit(filter, sin_data$y) y <- transform(filter, sin_data$y) # plot plot_ts_pred(y=sin_data$y, yadj=y)
# time series with noise library(daltoolbox) data(sin_data) sin_data$y[9] <- 2*sin_data$y[9] # filter filter <- ts_fil_fft() filter <- fit(filter, sin_data$y) y <- transform(filter, sin_data$y) # plot plot_ts_pred(y=sin_data$y, yadj=y)
This filter eliminates the cyclical component of the series, performs smoothing on it, making it more sensitive to long-term fluctuations. Each observation is decomposed into a cyclical and a growth component.
ts_fil_hp(lambda = 100, preserve = 0.9)
ts_fil_hp(lambda = 100, preserve = 0.9)
lambda |
It is the smoothing parameter of the Hodrick-Prescott filter. Lambda = 100*(frequency)^2 Correspondence between frequency and lambda values annual => frequency = 1 // lambda = 100 quarterly => frequency = 4 // lambda = 1600 monthly => frequency = 12 // lambda = 14400 weekly => frequency = 52 // lambda = 270400 daily (7 days a week) => frequency = 365 // lambda = 13322500 daily (5 days a week) => frequency = 252 // lambda = 6812100 |
preserve |
value between 0 and 1. Balance the composition of observations and applied filter. Values close to 1 preserve original values. Values close to 0 adopts HP filter values. |
a ts_fil_hp
object.
# time series with noise library(daltoolbox) data(sin_data) sin_data$y[9] <- 2*sin_data$y[9] # filter filter <- ts_fil_hp(lambda = 100*(26)^2) #frequency assumed to be 26 filter <- fit(filter, sin_data$y) y <- transform(filter, sin_data$y) # plot plot_ts_pred(y=sin_data$y, yadj=y)
# time series with noise library(daltoolbox) data(sin_data) sin_data$y[9] <- 2*sin_data$y[9] # filter filter <- ts_fil_hp(lambda = 100*(26)^2) #frequency assumed to be 26 filter <- fit(filter, sin_data$y) y <- transform(filter, sin_data$y) # plot plot_ts_pred(y=sin_data$y, yadj=y)
The Kalman filter is an estimation algorithm that produces estimates of certain variables based on imprecise measurements to provide a prediction of the future state of the system. It wraps KFAS package.
ts_fil_kalman(H = 0.1, Q = 1)
ts_fil_kalman(H = 0.1, Q = 1)
H |
variance or covariance matrix of the measurement noise. This noise pertains to the relationship between the true system state and actual observations. Measurement noise is added to the measurement equation to account for uncertainties or errors associated with real observations. The higher this value, the higher the level of uncertainty in the observations. |
Q |
variance or covariance matrix of the process noise. This noise follows a zero-mean Gaussian distribution. It is added to the equation to account for uncertainties or unmodeled disturbances in the state evolution. The higher this value, the greater the uncertainty in the state transition process. |
a ts_fil_kalman
object.
# time series with noise library(daltoolbox) data(sin_data) sin_data$y[9] <- 2*sin_data$y[9] # filter filter <- ts_fil_kalman() filter <- fit(filter, sin_data$y) y <- transform(filter, sin_data$y) # plot plot_ts_pred(y=sin_data$y, yadj=y)
# time series with noise library(daltoolbox) data(sin_data) sin_data$y[9] <- 2*sin_data$y[9] # filter filter <- ts_fil_kalman() filter <- fit(filter, sin_data$y) y <- transform(filter, sin_data$y) # plot plot_ts_pred(y=sin_data$y, yadj=y)
It is a smoothing method that preserves the primary trend of the original observations and is used to remove noise and spikes in a way that allows data reconstruction and smoothing.
ts_fil_lowess(f = 0.2)
ts_fil_lowess(f = 0.2)
f |
smoothing parameter. The larger this value, the smoother the series will be. This provides the proportion of points on the plot that influence the smoothing. |
a ts_fil_lowess
object.
# time series with noise library(daltoolbox) data(sin_data) sin_data$y[9] <- 2*sin_data$y[9] # filter filter <- ts_fil_lowess(f = 0.2) filter <- fit(filter, sin_data$y) y <- transform(filter, sin_data$y) # plot plot_ts_pred(y=sin_data$y, yadj=y)
# time series with noise library(daltoolbox) data(sin_data) sin_data$y[9] <- 2*sin_data$y[9] # filter filter <- ts_fil_lowess(f = 0.2) filter <- fit(filter, sin_data$y) y <- transform(filter, sin_data$y) # plot plot_ts_pred(y=sin_data$y, yadj=y)
Used to smooth out fluctuations and reduce noise in a time series.
ts_fil_ma(ma = 3)
ts_fil_ma(ma = 3)
ma |
moving average size |
a ts_fil_ma
object.
# time series with noise library(daltoolbox) data(sin_data) sin_data$y[9] <- 2*sin_data$y[9] # filter filter <- ts_fil_ma(3) filter <- fit(filter, sin_data$y) y <- transform(filter, sin_data$y) # plot plot_ts_pred(y=sin_data$y, yadj=y)
# time series with noise library(daltoolbox) data(sin_data) sin_data$y[9] <- 2*sin_data$y[9] # filter filter <- ts_fil_ma(3) filter <- fit(filter, sin_data$y) y <- transform(filter, sin_data$y) # plot plot_ts_pred(y=sin_data$y, yadj=y)
Does not make data filter
ts_fil_none()
ts_fil_none()
a ts_fil_none
object.
# time series with noise library(daltoolbox) data(sin_data) sin_data$y[9] <- 2*sin_data$y[9] # filter filter <- ts_fil_none() filter <- fit(filter, sin_data$y) y <- transform(filter, sin_data$y) # plot plot_ts_pred(y=sin_data$y, yadj=y)
# time series with noise library(daltoolbox) data(sin_data) sin_data$y[9] <- 2*sin_data$y[9] # filter filter <- ts_fil_none() filter <- fit(filter, sin_data$y) y <- transform(filter, sin_data$y) # plot plot_ts_pred(y=sin_data$y, yadj=y)
This code implements quadratic exponential smoothing on a time series. Quadratic exponential smoothing is a smoothing technique that includes components of both trend and seasonality in time series forecasting.
ts_fil_qes(gamma = FALSE)
ts_fil_qes(gamma = FALSE)
gamma |
If TRUE, enables the gamma seasonality component. |
a ts_fil_qes
obj.
# time series with noise library(daltoolbox) data(sin_data) sin_data$y[9] <- 2*sin_data$y[9] # filter filter <- ts_fil_qes() filter <- fit(filter, sin_data$y) y <- transform(filter, sin_data$y) # plot plot_ts_pred(y=sin_data$y, yadj=y)
# time series with noise library(daltoolbox) data(sin_data) sin_data$y[9] <- 2*sin_data$y[9] # filter filter <- ts_fil_qes() filter <- fit(filter, sin_data$y) y <- transform(filter, sin_data$y) # plot plot_ts_pred(y=sin_data$y, yadj=y)
Applies linear filtering to a univariate time series or to each series within a multivariate time series. It is useful for outlier detection, and the calculation is done recursively. This recursive calculation has the effect of reducing autocorrelation among observations, so that for each detected outlier, the filter is recalculated until there are no more outliers in the residuals.
ts_fil_recursive(filter)
ts_fil_recursive(filter)
filter |
smoothing parameter. The larger the value, the greater the smoothing. The smaller the value, the less smoothing, and the resulting series shape is more similar to the original series. |
a ts_fil_recursive
object.
# time series with noise library(daltoolbox) data(sin_data) sin_data$y[9] <- 2*sin_data$y[9] # filter filter <- ts_fil_recursive(filter = 0.05) filter <- fit(filter, sin_data$y) y <- transform(filter, sin_data$y) # plot plot_ts_pred(y=sin_data$y, yadj=y)
# time series with noise library(daltoolbox) data(sin_data) sin_data$y[9] <- 2*sin_data$y[9] # filter filter <- ts_fil_recursive(filter = 0.05) filter <- fit(filter, sin_data$y) y <- transform(filter, sin_data$y) # plot plot_ts_pred(y=sin_data$y, yadj=y)
EMD Filter
ts_fil_remd(noise = 0.1, trials = 5)
ts_fil_remd(noise = 0.1, trials = 5)
noise |
noise |
trials |
trials |
a ts_fil_remd
object.
# time series with noise library(daltoolbox) data(sin_data) sin_data$y[9] <- 2*sin_data$y[9] # filter filter <- ts_fil_remd() filter <- fit(filter, sin_data$y) y <- transform(filter, sin_data$y) # plot plot_ts_pred(y=sin_data$y, yadj=y)
# time series with noise library(daltoolbox) data(sin_data) sin_data$y[9] <- 2*sin_data$y[9] # filter filter <- ts_fil_remd() filter <- fit(filter, sin_data$y) y <- transform(filter, sin_data$y) # plot plot_ts_pred(y=sin_data$y, yadj=y)
Removes the seasonal component from the time series without affecting the other components.
ts_fil_seas_adj(frequency = NULL)
ts_fil_seas_adj(frequency = NULL)
frequency |
Frequency of the time series. It is an optional parameter. It can be configured when the frequency of the time series is known. |
a ts_fil_seas_adj
object.
# time series with noise library(daltoolbox) data(sin_data) sin_data$y[9] <- 2*sin_data$y[9] # filter filter <- ts_fil_seas_adj(frequency = 26) filter <- fit(filter, sin_data$y) y <- transform(filter, sin_data$y) # plot plot_ts_pred(y=sin_data$y, yadj=y)
# time series with noise library(daltoolbox) data(sin_data) sin_data$y[9] <- 2*sin_data$y[9] # filter filter <- ts_fil_seas_adj(frequency = 26) filter <- fit(filter, sin_data$y) y <- transform(filter, sin_data$y) # plot plot_ts_pred(y=sin_data$y, yadj=y)
This code implements simple exponential smoothing on a time series. Simple exponential smoothing is a smoothing technique that can include or exclude trend and seasonality components in time series forecasting, depending on the specified parameters.
ts_fil_ses(gamma = FALSE)
ts_fil_ses(gamma = FALSE)
gamma |
If TRUE, enables the gamma seasonality component. |
a ts_fil_ses
obj.
# time series with noise library(daltoolbox) data(sin_data) sin_data$y[9] <- 2*sin_data$y[9] # filter filter <- ts_fil_ses() filter <- fit(filter, sin_data$y) y <- transform(filter, sin_data$y) # plot plot_ts_pred(y=sin_data$y, yadj=y)
# time series with noise library(daltoolbox) data(sin_data) sin_data$y[9] <- 2*sin_data$y[9] # filter filter <- ts_fil_ses() filter <- fit(filter, sin_data$y) y <- transform(filter, sin_data$y) # plot plot_ts_pred(y=sin_data$y, yadj=y)
Used to remove or reduce randomness (noise).
ts_fil_smooth()
ts_fil_smooth()
a ts_fil_smooth
object.
# time series with noise library(daltoolbox) data(sin_data) sin_data$y[9] <- 2*sin_data$y[9] # filter filter <- ts_fil_smooth() filter <- fit(filter, sin_data$y) y <- transform(filter, sin_data$y) # plot plot_ts_pred(y=sin_data$y, yadj=y)
# time series with noise library(daltoolbox) data(sin_data) sin_data$y[9] <- 2*sin_data$y[9] # filter filter <- ts_fil_smooth() filter <- fit(filter, sin_data$y) y <- transform(filter, sin_data$y) # plot plot_ts_pred(y=sin_data$y, yadj=y)
Fits a cubic smoothing spline to a time series.
ts_fil_spline(spar = NULL)
ts_fil_spline(spar = NULL)
spar |
smoothing parameter. When spar is specified, the coefficient
of the integral of the squared second derivative in the fitting criterion (penalized log-likelihood)
is a monotone function of spar.
#'@return a |
# time series with noise library(daltoolbox) data(sin_data) sin_data$y[9] <- 2*sin_data$y[9] # filter filter <- ts_fil_spline(spar = 0.5) filter <- fit(filter, sin_data$y) y <- transform(filter, sin_data$y) # plot plot_ts_pred(y=sin_data$y, yadj=y)
# time series with noise library(daltoolbox) data(sin_data) sin_data$y[9] <- 2*sin_data$y[9] # filter filter <- ts_fil_spline(spar = 0.5) filter <- fit(filter, sin_data$y) y <- transform(filter, sin_data$y) # plot plot_ts_pred(y=sin_data$y, yadj=y)
Wavelet Filter
ts_fil_wavelet(filter = "haar")
ts_fil_wavelet(filter = "haar")
filter |
Availables wavelet filters: haar, d4, la8, bl14, c6 |
a ts_fil_wavelet
object.
# time series with noise library(daltoolbox) data(sin_data) sin_data$y[9] <- 2*sin_data$y[9] # filter filter <- ts_fil_wavelet() filter <- fit(filter, sin_data$y) y <- transform(filter, sin_data$y) # plot plot_ts_pred(y=sin_data$y, yadj=y)
# time series with noise library(daltoolbox) data(sin_data) sin_data$y[9] <- 2*sin_data$y[9] # filter filter <- ts_fil_wavelet() filter <- fit(filter, sin_data$y) y <- transform(filter, sin_data$y) # plot plot_ts_pred(y=sin_data$y, yadj=y)
This code implements the Winsorization technique on a time series. Winsorization is a statistical method used to handle extreme values in a time series by replacing them with values closer to the center of the distribution.
ts_fil_winsor()
ts_fil_winsor()
a ts_fil_winsor
obj.
# time series with noise library(daltoolbox) data(sin_data) sin_data$y[9] <- 2*sin_data$y[9] # filter filter <- ts_fil_winsor() filter <- fit(filter, sin_data$y) y <- transform(filter, sin_data$y) # plot plot_ts_pred(y=sin_data$y, yadj=y)
# time series with noise library(daltoolbox) data(sin_data) sin_data$y[9] <- 2*sin_data$y[9] # filter filter <- ts_fil_winsor() filter <- fit(filter, sin_data$y) y <- transform(filter, sin_data$y) # plot plot_ts_pred(y=sin_data$y, yadj=y)
Time Series Tune
ts_maintune( input_size, base_model, folds = 10, preprocess = list(daltoolbox::ts_norm_gminmax()), augment = list(ts_aug_none()) )
ts_maintune( input_size, base_model, folds = 10, preprocess = list(daltoolbox::ts_norm_gminmax()), augment = list(ts_aug_none()) )
input_size |
input size for machine learning model |
base_model |
base model for tuning |
folds |
number of folds for cross-validation |
preprocess |
list of preprocessing methods |
augment |
data augmentation method |
a ts_maintune
object.
library(daltoolbox) data(sin_data) ts <- ts_data(sin_data$y, 10) samp <- ts_sample(ts, test_size = 5) io_train <- ts_projection(samp$train) io_test <- ts_projection(samp$test) tune <- ts_maintune(input_size=c(3:5), base_model = ts_elm(), preprocess = list(ts_norm_gminmax())) ranges <- list(nhid = 1:5, actfun=c('purelin')) # Generic model tunning model <- fit(tune, x=io_train$input, y=io_train$output, ranges) prediction <- predict(model, x=io_test$input[1,], steps_ahead=5) prediction <- as.vector(prediction) output <- as.vector(io_test$output) ev_test <- evaluate(model, output, prediction) ev_test
library(daltoolbox) data(sin_data) ts <- ts_data(sin_data$y, 10) samp <- ts_sample(ts, test_size = 5) io_train <- ts_projection(samp$train) io_test <- ts_projection(samp$test) tune <- ts_maintune(input_size=c(3:5), base_model = ts_elm(), preprocess = list(ts_norm_gminmax())) ranges <- list(nhid = 1:5, actfun=c('purelin')) # Generic model tunning model <- fit(tune, x=io_train$input, y=io_train$output, ranges) prediction <- predict(model, x=io_test$input[1,], steps_ahead=5) prediction <- as.vector(prediction) output <- as.vector(io_test$output) ev_test <- evaluate(model, output, prediction) ev_test
Does not make data normalization.
ts_norm_none()
ts_norm_none()
a ts_norm_none
object.
library(daltoolbox) data(sin_data) #convert to sliding windows xw <- ts_data(sin_data$y, 10) #no data normalization normalize <- ts_norm_none() normalize <- fit(normalize, xw) xa <- transform(normalize, xw) ts_head(xa)
library(daltoolbox) data(sin_data) #convert to sliding windows xw <- ts_data(sin_data$y, 10) #no data normalization normalize <- ts_norm_none() normalize <- fit(normalize, xw) xa <- transform(normalize, xw) ts_head(xa)