\section{C\+V\+Function$<$ C\+V\+Type, M\+L\+Algorithm, Total\+Args, Bound\+Args $>$ Class Template Reference}
\label{classmlpack_1_1hpt_1_1CVFunction}\index{C\+V\+Function$<$ C\+V\+Type, M\+L\+Algorithm, Total\+Args, Bound\+Args $>$@{C\+V\+Function$<$ C\+V\+Type, M\+L\+Algorithm, Total\+Args, Bound\+Args $>$}}


This wrapper serves for adapting the interface of the cross-\/validation classes to the one that can be utilized by the mlpack optimizers.  


\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\textbf{ C\+V\+Function} (C\+V\+Type \&cv, \textbf{ data\+::\+Dataset\+Mapper}$<$ \textbf{ data\+::\+Increment\+Policy}, double $>$ \&dataset\+Info, const double relative\+Delta, const double min\+Delta, const Bound\+Args \&... args)
\begin{DoxyCompactList}\small\item\em Initialize a \doxyref{C\+V\+Function}{p.}{classmlpack_1_1hpt_1_1CVFunction} object. \end{DoxyCompactList}\item 
M\+L\+Algorithm \& \textbf{ Best\+Model} ()
\begin{DoxyCompactList}\small\item\em Access and modify the best model so far. \end{DoxyCompactList}\item 
double \textbf{ Evaluate} (const arma\+::mat \&parameters)
\begin{DoxyCompactList}\small\item\em Run cross-\/validation with the bound and passed parameters. \end{DoxyCompactList}\item 
void \textbf{ Gradient} (const arma\+::mat \&parameters, arma\+::mat \&gradient)
\begin{DoxyCompactList}\small\item\em Evaluate numerically the gradient of the \doxyref{C\+V\+Function}{p.}{classmlpack_1_1hpt_1_1CVFunction} with the given parameters. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
\subsubsection*{template$<$typename C\+V\+Type, typename M\+L\+Algorithm, size\+\_\+t Total\+Args, typename... Bound\+Args$>$\newline
class mlpack\+::hpt\+::\+C\+V\+Function$<$ C\+V\+Type, M\+L\+Algorithm, Total\+Args, Bound\+Args $>$}

This wrapper serves for adapting the interface of the cross-\/validation classes to the one that can be utilized by the mlpack optimizers. 

This class is not supposed to be used directly by users. To tune hyper-\/parameters see \doxyref{Hyper\+Parameter\+Tuner}{p.}{classmlpack_1_1hpt_1_1HyperParameterTuner}.


\begin{DoxyTemplParams}{Template Parameters}
{\em C\+V\+Type} & A cross-\/validation strategy. \\
\hline
{\em M\+L\+Algorithm} & The machine learning algorithm used in cross-\/validation. \\
\hline
{\em Total\+Args} & The total number of arguments that are supposed to be passed to the Evaluate method of a C\+V\+Type object. \\
\hline
{\em Bound\+Args} & Types of arguments (wrapped into the Bound\+Arg struct) that should be passed into the Evaluate method of a C\+V\+Type object but are not going to be passed into the Evaluate method of a \doxyref{C\+V\+Function}{p.}{classmlpack_1_1hpt_1_1CVFunction} object. \\
\hline
\end{DoxyTemplParams}


Definition at line 39 of file cv\+\_\+function.\+hpp.



\subsection{Constructor \& Destructor Documentation}
\mbox{\label{classmlpack_1_1hpt_1_1CVFunction_a50a025d8898076d3acaca4e20e73c710}} 
\index{mlpack\+::hpt\+::\+C\+V\+Function@{mlpack\+::hpt\+::\+C\+V\+Function}!C\+V\+Function@{C\+V\+Function}}
\index{C\+V\+Function@{C\+V\+Function}!mlpack\+::hpt\+::\+C\+V\+Function@{mlpack\+::hpt\+::\+C\+V\+Function}}
\subsubsection{C\+V\+Function()}
{\footnotesize\ttfamily \textbf{ C\+V\+Function} (\begin{DoxyParamCaption}\item[{C\+V\+Type \&}]{cv,  }\item[{\textbf{ data\+::\+Dataset\+Mapper}$<$ \textbf{ data\+::\+Increment\+Policy}, double $>$ \&}]{dataset\+Info,  }\item[{const double}]{relative\+Delta,  }\item[{const double}]{min\+Delta,  }\item[{const Bound\+Args \&...}]{args }\end{DoxyParamCaption})}



Initialize a \doxyref{C\+V\+Function}{p.}{classmlpack_1_1hpt_1_1CVFunction} object. 


\begin{DoxyParams}{Parameters}
{\em cv} & A cross-\/validation object. \\
\hline
{\em dataset\+Info} & Information on each parameter (categorical/numeric). Contains mappings from optimizer-\/passed size\+\_\+t indices to double values that should be used. \\
\hline
{\em relative\+Delta} & Relative increase of arguments for calculation of partial derivatives (by the definition). The exact increase for some particular argument is equal to the absolute value of the argument multiplied by the relative increase (see also the documentation for the min\+Delta parameter). \\
\hline
{\em min\+Delta} & Minimum increase of arguments for calculation of partial derivatives (by the definition). This value is going to be used when it is greater than the increase calculated with the rules described in the documentation for the relative\+Delta parameter. \\
\hline
{\em Bound\+Args} & Arguments that should be passed into the Evaluate method of the C\+V\+Type object but are not going to be passed into the Evaluate method of this object. \\
\hline
\end{DoxyParams}


\subsection{Member Function Documentation}
\mbox{\label{classmlpack_1_1hpt_1_1CVFunction_a0c2bf016556a87be5f6f9e86f6b37dd9}} 
\index{mlpack\+::hpt\+::\+C\+V\+Function@{mlpack\+::hpt\+::\+C\+V\+Function}!Best\+Model@{Best\+Model}}
\index{Best\+Model@{Best\+Model}!mlpack\+::hpt\+::\+C\+V\+Function@{mlpack\+::hpt\+::\+C\+V\+Function}}
\subsubsection{Best\+Model()}
{\footnotesize\ttfamily M\+L\+Algorithm\& Best\+Model (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



Access and modify the best model so far. 



Definition at line 87 of file cv\+\_\+function.\+hpp.



References C\+V\+Function$<$ C\+V\+Type, M\+L\+Algorithm, Total\+Args, Bound\+Args $>$\+::\+Evaluate().

\mbox{\label{classmlpack_1_1hpt_1_1CVFunction_a1ca0efaedbc2e7e7542c89901cdcf2ee}} 
\index{mlpack\+::hpt\+::\+C\+V\+Function@{mlpack\+::hpt\+::\+C\+V\+Function}!Evaluate@{Evaluate}}
\index{Evaluate@{Evaluate}!mlpack\+::hpt\+::\+C\+V\+Function@{mlpack\+::hpt\+::\+C\+V\+Function}}
\subsubsection{Evaluate()}
{\footnotesize\ttfamily double Evaluate (\begin{DoxyParamCaption}\item[{const arma\+::mat \&}]{parameters }\end{DoxyParamCaption})}



Run cross-\/validation with the bound and passed parameters. 


\begin{DoxyParams}{Parameters}
{\em parameters} & Arguments (rather than the bound arguments) that should be passed into the Evaluate method of the C\+V\+Type object. \\
\hline
\end{DoxyParams}


Referenced by C\+V\+Function$<$ C\+V\+Type, M\+L\+Algorithm, Total\+Args, Bound\+Args $>$\+::\+Best\+Model().

\mbox{\label{classmlpack_1_1hpt_1_1CVFunction_aaf078432f3f27bda4dd66a2ad0e76886}} 
\index{mlpack\+::hpt\+::\+C\+V\+Function@{mlpack\+::hpt\+::\+C\+V\+Function}!Gradient@{Gradient}}
\index{Gradient@{Gradient}!mlpack\+::hpt\+::\+C\+V\+Function@{mlpack\+::hpt\+::\+C\+V\+Function}}
\subsubsection{Gradient()}
{\footnotesize\ttfamily void Gradient (\begin{DoxyParamCaption}\item[{const arma\+::mat \&}]{parameters,  }\item[{arma\+::mat \&}]{gradient }\end{DoxyParamCaption})}



Evaluate numerically the gradient of the \doxyref{C\+V\+Function}{p.}{classmlpack_1_1hpt_1_1CVFunction} with the given parameters. 


\begin{DoxyParams}{Parameters}
{\em parameters} & Arguments (rather than the bound arguments) that should be passed into the Evaluate method of the C\+V\+Type object. \\
\hline
{\em gradient} & Vector to output the gradient into. \\
\hline
\end{DoxyParams}


The documentation for this class was generated from the following file\+:\begin{DoxyCompactItemize}
\item 
/var/www/mlpack.\+ratml.\+org/mlpack.\+org/\+\_\+src/mlpack-\/3.\+3.\+0/src/mlpack/core/hpt/\textbf{ cv\+\_\+function.\+hpp}\end{DoxyCompactItemize}
