% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/R6_Model.R
\name{Model}
\alias{Model}
\title{R6 class representing a (generic) model.}
\description{
"Model" class, containing a (generic) learning function, which from
data + target [+ params] returns a prediction function X --> y.
Parameters for cross-validation are either provided or estimated.
Model family can be chosen among "rf", "tree", "ppr" and "knn" for now.
}
\section{Public fields}{
\if{html}{\out{
}}
\describe{
\item{\code{nmodels}}{Number of parameters (= number of [predictive] models)}
}
\if{html}{\out{
}}
}
\section{Methods}{
\subsection{Public methods}{
\itemize{
\item \href{#method-new}{\code{Model$new()}}
\item \href{#method-get}{\code{Model$get()}}
\item \href{#method-clone}{\code{Model$clone()}}
}
}
\if{html}{\out{
}}
\if{html}{\out{}}
\if{latex}{\out{\hypertarget{method-new}{}}}
\subsection{Method \code{new()}}{
Create a new generic model.
\subsection{Usage}{
\if{html}{\out{}}\preformatted{Model$new(data, target, task, gmodel = NULL, params = NULL)}\if{html}{\out{
}}
}
\subsection{Arguments}{
\if{html}{\out{}}
\describe{
\item{\code{data}}{Matrix or data.frame}
\item{\code{target}}{Vector of targets (generally numeric or factor)}
\item{\code{task}}{"regression" or "classification"}
\item{\code{gmodel}}{Generic model returning a predictive function; chosen
automatically given data and target nature if not provided.}
\item{\code{params}}{List of parameters for cross-validation (each defining a model)}
}
\if{html}{\out{
}}
}
}
\if{html}{\out{
}}
\if{html}{\out{}}
\if{latex}{\out{\hypertarget{method-get}{}}}
\subsection{Method \code{get()}}{
Returns the model at index "index", trained on dataHO/targetHO.
index is between 1 and self$nmodels.
\subsection{Usage}{
\if{html}{\out{}}\preformatted{Model$get(dataHO, targetHO, index)}\if{html}{\out{
}}
}
\subsection{Arguments}{
\if{html}{\out{}}
\describe{
\item{\code{dataHO}}{Matrix or data.frame}
\item{\code{targetHO}}{Vector of targets (generally numeric or factor)}
\item{\code{index}}{Index of the model in 1...nmodels}
}
\if{html}{\out{
}}
}
}
\if{html}{\out{
}}
\if{html}{\out{}}
\if{latex}{\out{\hypertarget{method-clone}{}}}
\subsection{Method \code{clone()}}{
The objects of this class are cloneable with this method.
\subsection{Usage}{
\if{html}{\out{}}\preformatted{Model$clone(deep = FALSE)}\if{html}{\out{
}}
}
\subsection{Arguments}{
\if{html}{\out{}}
\describe{
\item{\code{deep}}{Whether to make a deep clone.}
}
\if{html}{\out{
}}
}
}
}