| 1 | % Generated by roxygen2: do not edit by hand |
| 2 | % Please edit documentation in R/R6_AgghooCV.R |
| 3 | \name{AgghooCV} |
| 4 | \alias{AgghooCV} |
| 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{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 | } |
| 17 | \section{Methods}{ |
| 18 | \subsection{Public methods}{ |
| 19 | \itemize{ |
| 20 | \item \href{#method-new}{\code{AgghooCV$new()}} |
| 21 | \item \href{#method-fit}{\code{AgghooCV$fit()}} |
| 22 | \item \href{#method-predict}{\code{AgghooCV$predict()}} |
| 23 | \item \href{#method-getParams}{\code{AgghooCV$getParams()}} |
| 24 | \item \href{#method-clone}{\code{AgghooCV$clone()}} |
| 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()}}{ |
| 31 | Create a new AgghooCV object. |
| 32 | \subsection{Usage}{ |
| 33 | \if{html}{\out{<div class="r">}}\preformatted{AgghooCV$new(data, target, task, gmodel, loss = NULL)}\if{html}{\out{</div>}} |
| 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 | |
| 47 | \item{\code{loss}}{Function assessing the error of a prediction} |
| 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()}}{ |
| 56 | Fit an agghoo model. |
| 57 | \subsection{Usage}{ |
| 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>}} |
| 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} |
| 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()}}{ |
| 79 | Predict an agghoo model (after calling fit()) |
| 80 | \subsection{Usage}{ |
| 81 | \if{html}{\out{<div class="r">}}\preformatted{AgghooCV$predict(X)}\if{html}{\out{</div>}} |
| 82 | } |
| 83 | |
| 84 | \subsection{Arguments}{ |
| 85 | \if{html}{\out{<div class="arguments">}} |
| 86 | \describe{ |
| 87 | \item{\code{X}}{Matrix or data.frame to predict} |
| 88 | } |
| 89 | \if{html}{\out{</div>}} |
| 90 | } |
| 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()}}{ |
| 96 | Return 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 | |
| 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()}}{ |
| 106 | The objects of this class are cloneable with this method. |
| 107 | \subsection{Usage}{ |
| 108 | \if{html}{\out{<div class="r">}}\preformatted{AgghooCV$clone(deep = FALSE)}\if{html}{\out{</div>}} |
| 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 | } |