Refactoring: separate standard CV from agghoo + some bug fixes
[agghoo.git] / man / AgghooCV.Rd
CommitLineData
c5946158 1% Generated by roxygen2: do not edit by hand
cca5f1c6
BA
2% Please edit documentation in R/R6_AgghooCV.R
3\name{AgghooCV}
4\alias{AgghooCV}
c5946158
BA
5\title{R6 class with agghoo functions fit() and predict().}
6\description{
7Class encapsulating the methods to run to obtain the best predictor
8from the list of models (see 'Model' class).
9}
504afaad
BA
10\section{Public fields}{
11\if{html}{\out{<div class="r6-fields">}}
12\describe{
13\item{\code{params}}{List of parameters of the V selected models}
14}
15\if{html}{\out{</div>}}
16}
c5946158
BA
17\section{Methods}{
18\subsection{Public methods}{
19\itemize{
cca5f1c6
BA
20\item \href{#method-new}{\code{AgghooCV$new()}}
21\item \href{#method-fit}{\code{AgghooCV$fit()}}
22\item \href{#method-predict}{\code{AgghooCV$predict()}}
504afaad 23\item \href{#method-getParams}{\code{AgghooCV$getParams()}}
cca5f1c6 24\item \href{#method-clone}{\code{AgghooCV$clone()}}
c5946158
BA
25}
26}
27\if{html}{\out{<hr>}}
28\if{html}{\out{<a id="method-new"></a>}}
29\if{latex}{\out{\hypertarget{method-new}{}}}
30\subsection{Method \code{new()}}{
cca5f1c6 31Create a new AgghooCV object.
c5946158 32\subsection{Usage}{
504afaad 33\if{html}{\out{<div class="r">}}\preformatted{AgghooCV$new(data, target, task, gmodel, loss = NULL)}\if{html}{\out{</div>}}
c5946158
BA
34}
35
36\subsection{Arguments}{
37\if{html}{\out{<div class="arguments">}}
38\describe{
39\item{\code{data}}{Matrix or data.frame}
40
41\item{\code{target}}{Vector of targets (generally numeric or factor)}
42
43\item{\code{task}}{"regression" or "classification"}
44
45\item{\code{gmodel}}{Generic model returning a predictive function}
46
504afaad 47\item{\code{loss}}{Function assessing the error of a prediction}
c5946158
BA
48}
49\if{html}{\out{</div>}}
50}
51}
52\if{html}{\out{<hr>}}
53\if{html}{\out{<a id="method-fit"></a>}}
54\if{latex}{\out{\hypertarget{method-fit}{}}}
55\subsection{Method \code{fit()}}{
56Fit an agghoo model.
57\subsection{Usage}{
504afaad 58\if{html}{\out{<div class="r">}}\preformatted{AgghooCV$fit(CV = list(type = "MC", V = 10, test_size = 0.2, shuffle = TRUE))}\if{html}{\out{</div>}}
c5946158
BA
59}
60
61\subsection{Arguments}{
62\if{html}{\out{<div class="arguments">}}
63\describe{
64\item{\code{CV}}{List describing cross-validation to run. Slots:
65- type: 'vfold' or 'MC' for Monte-Carlo (default: MC)
66- V: number of runs (default: 10)
67- test_size: percentage of data in the test dataset, for MC
68 (irrelevant for V-fold). Default: 0.2.
69- shuffle: wether or not to shuffle data before V-fold.
70 Irrelevant for Monte-Carlo; default: TRUE}
c5946158
BA
71}
72\if{html}{\out{</div>}}
73}
74}
75\if{html}{\out{<hr>}}
76\if{html}{\out{<a id="method-predict"></a>}}
77\if{latex}{\out{\hypertarget{method-predict}{}}}
78\subsection{Method \code{predict()}}{
79Predict an agghoo model (after calling fit())
80\subsection{Usage}{
504afaad 81\if{html}{\out{<div class="r">}}\preformatted{AgghooCV$predict(X)}\if{html}{\out{</div>}}
c5946158
BA
82}
83
84\subsection{Arguments}{
85\if{html}{\out{<div class="arguments">}}
86\describe{
87\item{\code{X}}{Matrix or data.frame to predict}
c5946158
BA
88}
89\if{html}{\out{</div>}}
90}
504afaad
BA
91}
92\if{html}{\out{<hr>}}
93\if{html}{\out{<a id="method-getParams"></a>}}
94\if{latex}{\out{\hypertarget{method-getParams}{}}}
95\subsection{Method \code{getParams()}}{
96Return the list of V best parameters (after calling fit())
97\subsection{Usage}{
98\if{html}{\out{<div class="r">}}\preformatted{AgghooCV$getParams()}\if{html}{\out{</div>}}
99}
100
c5946158
BA
101}
102\if{html}{\out{<hr>}}
103\if{html}{\out{<a id="method-clone"></a>}}
104\if{latex}{\out{\hypertarget{method-clone}{}}}
105\subsection{Method \code{clone()}}{
106The objects of this class are cloneable with this method.
107\subsection{Usage}{
cca5f1c6 108\if{html}{\out{<div class="r">}}\preformatted{AgghooCV$clone(deep = FALSE)}\if{html}{\out{</div>}}
c5946158
BA
109}
110
111\subsection{Arguments}{
112\if{html}{\out{<div class="arguments">}}
113\describe{
114\item{\code{deep}}{Whether to make a deep clone.}
115}
116\if{html}{\out{</div>}}
117}
118}
119}