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 "rf", "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-clone}{\code{Model$clone()}}
28 \if{html}{\out{<a id="method-new"></a>}}
29 \if{latex}{\out{\hypertarget{method-new}{}}}
30 \subsection{Method \code{new()}}{
31 Create a new generic model.
33 \if{html}{\out{<div class="r">}}\preformatted{Model$new(data, target, task, gmodel = NULL, params = NULL)}\if{html}{\out{</div>}}
36 \subsection{Arguments}{
37 \if{html}{\out{<div class="arguments">}}
39 \item{\code{data}}{Matrix or data.frame}
41 \item{\code{target}}{Vector of targets (generally numeric or factor)}
43 \item{\code{task}}{"regression" or "classification"}
45 \item{\code{gmodel}}{Generic model returning a predictive function; chosen
46 automatically given data and target nature if not provided.}
48 \item{\code{params}}{List of parameters for cross-validation (each defining a model)}
50 \if{html}{\out{</div>}}
54 \if{html}{\out{<a id="method-get"></a>}}
55 \if{latex}{\out{\hypertarget{method-get}{}}}
56 \subsection{Method \code{get()}}{
57 Returns the model at index "index", trained on dataHO/targetHO.
58 index is between 1 and self$nmodels.
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-clone"></a>}}
77 \if{latex}{\out{\hypertarget{method-clone}{}}}
78 \subsection{Method \code{clone()}}{
79 The objects of this class are cloneable with this method.
81 \if{html}{\out{<div class="r">}}\preformatted{Model$clone(deep = FALSE)}\if{html}{\out{</div>}}
84 \subsection{Arguments}{
85 \if{html}{\out{<div class="arguments">}}
87 \item{\code{deep}}{Whether to make a deep clone.}
89 \if{html}{\out{</div>}}