Some fixes + refactoring
[agghoo.git] / man / Model.Rd
... / ...
CommitLineData
1% Generated by roxygen2: do not edit by hand
2% Please edit documentation in R/R6_Model.R
3\name{Model}
4\alias{Model}
5\title{R6 class representing a (generic) model.}
6\description{
7"Model" class, containing a (generic) learning function, which from
8data + target [+ params] returns a prediction function X --> y.
9Parameters for cross-validation are either provided or estimated.
10Model family can be chosen among "rf", "tree", "ppr" and "knn" for now.
11}
12\section{Public fields}{
13\if{html}{\out{<div class="r6-fields">}}
14\describe{
15\item{\code{nmodels}}{Number of parameters (= number of [predictive] models)}
16}
17\if{html}{\out{</div>}}
18}
19\section{Methods}{
20\subsection{Public methods}{
21\itemize{
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()}}
26}
27}
28\if{html}{\out{<hr>}}
29\if{html}{\out{<a id="method-new"></a>}}
30\if{latex}{\out{\hypertarget{method-new}{}}}
31\subsection{Method \code{new()}}{
32Create a new generic model.
33\subsection{Usage}{
34\if{html}{\out{<div class="r">}}\preformatted{Model$new(data, target, task, gmodel = NULL, params = NULL)}\if{html}{\out{</div>}}
35}
36
37\subsection{Arguments}{
38\if{html}{\out{<div class="arguments">}}
39\describe{
40\item{\code{data}}{Matrix or data.frame}
41
42\item{\code{target}}{Vector of targets (generally numeric or factor)}
43
44\item{\code{task}}{"regression" or "classification"}
45
46\item{\code{gmodel}}{Generic model returning a predictive function; chosen
47automatically given data and target nature if not provided.}
48
49\item{\code{params}}{List of parameters for cross-validation (each defining a model)}
50}
51\if{html}{\out{</div>}}
52}
53}
54\if{html}{\out{<hr>}}
55\if{html}{\out{<a id="method-get"></a>}}
56\if{latex}{\out{\hypertarget{method-get}{}}}
57\subsection{Method \code{get()}}{
58Returns the model at index "index", trained on dataHO/targetHO.
59\subsection{Usage}{
60\if{html}{\out{<div class="r">}}\preformatted{Model$get(dataHO, targetHO, index)}\if{html}{\out{</div>}}
61}
62
63\subsection{Arguments}{
64\if{html}{\out{<div class="arguments">}}
65\describe{
66\item{\code{dataHO}}{Matrix or data.frame}
67
68\item{\code{targetHO}}{Vector of targets (generally numeric or factor)}
69
70\item{\code{index}}{Index of the model in 1...nmodels}
71}
72\if{html}{\out{</div>}}
73}
74}
75\if{html}{\out{<hr>}}
76\if{html}{\out{<a id="method-getParam"></a>}}
77\if{latex}{\out{\hypertarget{method-getParam}{}}}
78\subsection{Method \code{getParam()}}{
79Returns the parameter at index "index".
80\subsection{Usage}{
81\if{html}{\out{<div class="r">}}\preformatted{Model$getParam(index)}\if{html}{\out{</div>}}
82}
83
84\subsection{Arguments}{
85\if{html}{\out{<div class="arguments">}}
86\describe{
87\item{\code{index}}{Index of the model in 1...nmodels}
88}
89\if{html}{\out{</div>}}
90}
91}
92\if{html}{\out{<hr>}}
93\if{html}{\out{<a id="method-clone"></a>}}
94\if{latex}{\out{\hypertarget{method-clone}{}}}
95\subsection{Method \code{clone()}}{
96The objects of this class are cloneable with this method.
97\subsection{Usage}{
98\if{html}{\out{<div class="r">}}\preformatted{Model$clone(deep = FALSE)}\if{html}{\out{</div>}}
99}
100
101\subsection{Arguments}{
102\if{html}{\out{<div class="arguments">}}
103\describe{
104\item{\code{deep}}{Whether to make a deep clone.}
105}
106\if{html}{\out{</div>}}
107}
108}
109}