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