1 % Generated by roxygen2: do not edit by hand
2 % Please edit documentation in R/R6_Model.R
5 \title{R6 class representing a (generic) model.}
7 "Model" class, containing a (generic) learning function, which from
8 data + target [+ params] returns a prediction function X --> y.
9 Parameters for cross-validation are either provided or estimated.
10 Model family can be chosen among "tree", "ppr" and "knn" for now.
12 \section{Public fields}{
13 \if{html}{\out{<div class="r6-fields">}}
15 \item{\code{nmodels}}{Number of parameters (= number of [predictive] models)}
17 \if{html}{\out{</div>}}
20 \subsection{Public methods}{
22 \item \href{#method-new}{\code{Model$new()}}
23 \item \href{#method-get}{\code{Model$get()}}
24 \item \href{#method-getParam}{\code{Model$getParam()}}
25 \item \href{#method-clone}{\code{Model$clone()}}
29 \if{html}{\out{<a id="method-new"></a>}}
30 \if{latex}{\out{\hypertarget{method-new}{}}}
31 \subsection{Method \code{new()}}{
32 Create a new generic model.
34 \if{html}{\out{<div class="r">}}\preformatted{Model$new(data, target, task, gmodel = NULL, params = NULL)}\if{html}{\out{</div>}}
37 \subsection{Arguments}{
38 \if{html}{\out{<div class="arguments">}}
40 \item{\code{data}}{Matrix or data.frame}
42 \item{\code{target}}{Vector of targets (generally numeric or factor)}
44 \item{\code{task}}{"regression" or "classification"}
46 \item{\code{gmodel}}{Generic model returning a predictive function; chosen
47 automatically given data and target nature if not provided.}
49 \item{\code{params}}{List of parameters for cross-validation (each defining a model)}
51 \if{html}{\out{</div>}}
55 \if{html}{\out{<a id="method-get"></a>}}
56 \if{latex}{\out{\hypertarget{method-get}{}}}
57 \subsection{Method \code{get()}}{
58 Returns the model at index "index", trained on dataHO/targetHO.
60 \if{html}{\out{<div class="r">}}\preformatted{Model$get(dataHO, targetHO, index)}\if{html}{\out{</div>}}
63 \subsection{Arguments}{
64 \if{html}{\out{<div class="arguments">}}
66 \item{\code{dataHO}}{Matrix or data.frame}
68 \item{\code{targetHO}}{Vector of targets (generally numeric or factor)}
70 \item{\code{index}}{Index of the model in 1...nmodels}
72 \if{html}{\out{</div>}}
76 \if{html}{\out{<a id="method-getParam"></a>}}
77 \if{latex}{\out{\hypertarget{method-getParam}{}}}
78 \subsection{Method \code{getParam()}}{
79 Returns the parameter at index "index".
81 \if{html}{\out{<div class="r">}}\preformatted{Model$getParam(index)}\if{html}{\out{</div>}}
84 \subsection{Arguments}{
85 \if{html}{\out{<div class="arguments">}}
87 \item{\code{index}}{Index of the model in 1...nmodels}
89 \if{html}{\out{</div>}}
93 \if{html}{\out{<a id="method-clone"></a>}}
94 \if{latex}{\out{\hypertarget{method-clone}{}}}
95 \subsection{Method \code{clone()}}{
96 The objects of this class are cloneable with this method.
98 \if{html}{\out{<div class="r">}}\preformatted{Model$clone(deep = FALSE)}\if{html}{\out{</div>}}
101 \subsection{Arguments}{
102 \if{html}{\out{<div class="arguments">}}
104 \item{\code{deep}}{Whether to make a deep clone.}
106 \if{html}{\out{</div>}}