-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathModelBuildNNforCaret.Rd
194 lines (173 loc) · 6.57 KB
/
ModelBuildNNforCaret.Rd
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/ModelBuildNNforCaret.R
\name{ModelBuildNNforCaret}
\alias{ModelBuildNNforCaret}
\title{R6 class ModelBuildNNforCaret}
\value{
A dataframe containing the information about the different models
A dataframe containing the hyperparameters for the best model
}
\description{
R6 class ModelBuildNNforCaret
R6 class ModelBuildNNforCaret
}
\section{Methods}{
\subsection{Public methods}{
\itemize{
\item \href{#method-new}{\code{ModelBuildNNforCaret$new()}}
\item \href{#method-get_data}{\code{ModelBuildNNforCaret$get_data()}}
\item \href{#method-summarize_hyperparam_results}{\code{ModelBuildNNforCaret$summarize_hyperparam_results()}}
\item \href{#method-summarize_best_hyperparams}{\code{ModelBuildNNforCaret$summarize_best_hyperparams()}}
\item \href{#method-plot_hyperparam_results}{\code{ModelBuildNNforCaret$plot_hyperparam_results()}}
\item \href{#method-get_final_models}{\code{ModelBuildNNforCaret$get_final_models()}}
\item \href{#method-summarize_build}{\code{ModelBuildNNforCaret$summarize_build()}}
\item \href{#method-clone}{\code{ModelBuildNNforCaret$clone()}}
}
}
\if{html}{\out{<hr>}}
\if{html}{\out{<a id="method-new"></a>}}
\if{latex}{\out{\hypertarget{method-new}{}}}
\subsection{Method \code{new()}}{
Initialize an object to compare several Univatiate Time Series Models
\subsection{Usage}{
\if{html}{\out{<div class="r">}}\preformatted{ModelBuildNNforCaret$new(
data = NA,
var_interest = NA,
m = NA,
search = "grid",
grid = NA,
tuneLength = NA,
batch_size = NA,
h = NA,
parallel = TRUE,
seed = 1,
verbose = 0,
...
)}\if{html}{\out{</div>}}
}
\subsection{Arguments}{
\if{html}{\out{<div class="arguments">}}
\describe{
\item{\code{data}}{The dataframe containing the time series realizations (data should not contain time index)}
\item{\code{var_interest}}{The output variable of interest (dependent variable)}
\item{\code{m}}{The frequency of the variable of interest}
\item{\code{search}}{Caret grid search method: 'grid' or 'random' (Default = 'grid')}
\item{\code{grid}}{If search = 'grid', what combinations of hyperparameters to use (See format in vignette).
Allowed parameters in grid are "reps", "hd", and "allow.det.season"}
\item{\code{tuneLength}}{If search = 'random', how many random combinations to try (Default = 3)}
\item{\code{batch_size}}{Batch Size to use}
\item{\code{h}}{Forecast Horizon}
\item{\code{parallel}}{Should the grid search be run in parallel or not (Default = TRUE)}
\item{\code{seed}}{The seed to use for training the the Neural Network (Default = 1)}
\item{\code{verbose}}{How much to print during the model building and other processes (Default = 0)}
\item{\code{...}}{Additional parameers to feed to nnfor::mlp function for building the model
It is highly recommended to pass the frequency of the variable of interest 'm' to get a good model
Other arguments that can be passed can be found by typing ?nnfor::mlp in the console}
}
\if{html}{\out{</div>}}
}
\subsection{Returns}{
A new `ModelBuildNNforCaret` object.
}
}
\if{html}{\out{<hr>}}
\if{html}{\out{<a id="method-get_data"></a>}}
\if{latex}{\out{\hypertarget{method-get_data}{}}}
\subsection{Method \code{get_data()}}{
Returns the time series realization
\subsection{Usage}{
\if{html}{\out{<div class="r">}}\preformatted{ModelBuildNNforCaret$get_data()}\if{html}{\out{</div>}}
}
\subsection{Returns}{
The Time Series Realization
}
}
\if{html}{\out{<hr>}}
\if{html}{\out{<a id="method-summarize_hyperparam_results"></a>}}
\if{latex}{\out{\hypertarget{method-summarize_hyperparam_results}{}}}
\subsection{Method \code{summarize_hyperparam_results()}}{
Summarizes the results of all the hyperparameter combinations
\subsection{Usage}{
\if{html}{\out{<div class="r">}}\preformatted{ModelBuildNNforCaret$summarize_hyperparam_results()}\if{html}{\out{</div>}}
}
}
\if{html}{\out{<hr>}}
\if{html}{\out{<a id="method-summarize_best_hyperparams"></a>}}
\if{latex}{\out{\hypertarget{method-summarize_best_hyperparams}{}}}
\subsection{Method \code{summarize_best_hyperparams()}}{
Summarizes the best hyperparameter combination
\subsection{Usage}{
\if{html}{\out{<div class="r">}}\preformatted{ModelBuildNNforCaret$summarize_best_hyperparams()}\if{html}{\out{</div>}}
}
}
\if{html}{\out{<hr>}}
\if{html}{\out{<a id="method-plot_hyperparam_results"></a>}}
\if{latex}{\out{\hypertarget{method-plot_hyperparam_results}{}}}
\subsection{Method \code{plot_hyperparam_results()}}{
Plots the ASE metric variation along the hyperparameter space
\subsection{Usage}{
\if{html}{\out{<div class="r">}}\preformatted{ModelBuildNNforCaret$plot_hyperparam_results(level_plot = TRUE)}\if{html}{\out{</div>}}
}
\subsection{Arguments}{
\if{html}{\out{<div class="arguments">}}
\describe{
\item{\code{level_plot}}{A boolean indicating whether a level plot should be shown. useful for 'grid' search (Default = TRUE).}
}
\if{html}{\out{</div>}}
}
}
\if{html}{\out{<hr>}}
\if{html}{\out{<a id="method-get_final_models"></a>}}
\if{latex}{\out{\hypertarget{method-get_final_models}{}}}
\subsection{Method \code{get_final_models()}}{
Returns a final models
\subsection{Usage}{
\if{html}{\out{<div class="r">}}\preformatted{ModelBuildNNforCaret$get_final_models(subset = "a")}\if{html}{\out{</div>}}
}
\subsection{Arguments}{
\if{html}{\out{<div class="arguments">}}
\describe{
\item{\code{subset}}{The subset of models to get.
'a': All models (Default)
'r': Only the recommended models}
}
\if{html}{\out{</div>}}
}
\subsection{Returns}{
If subset = 'a', returns the caret model object
If subset = 'r', returns just the nnfor model
}
}
\if{html}{\out{<hr>}}
\if{html}{\out{<a id="method-summarize_build"></a>}}
\if{latex}{\out{\hypertarget{method-summarize_build}{}}}
\subsection{Method \code{summarize_build()}}{
Summarizes the entire build process
\subsection{Usage}{
\if{html}{\out{<div class="r">}}\preformatted{ModelBuildNNforCaret$summarize_build(level_plot = TRUE)}\if{html}{\out{</div>}}
}
\subsection{Arguments}{
\if{html}{\out{<div class="arguments">}}
\describe{
\item{\code{level_plot}}{A boolean indicating whether a level plot should be shown. useful for 'grid' search (Default = TRUE).}
}
\if{html}{\out{</div>}}
}
}
\if{html}{\out{<hr>}}
\if{html}{\out{<a id="method-clone"></a>}}
\if{latex}{\out{\hypertarget{method-clone}{}}}
\subsection{Method \code{clone()}}{
The objects of this class are cloneable with this method.
\subsection{Usage}{
\if{html}{\out{<div class="r">}}\preformatted{ModelBuildNNforCaret$clone(deep = FALSE)}\if{html}{\out{</div>}}
}
\subsection{Arguments}{
\if{html}{\out{<div class="arguments">}}
\describe{
\item{\code{deep}}{Whether to make a deep clone.}
}
\if{html}{\out{</div>}}
}
}
}