\section{Load\+C\+SV Class Reference}
\label{classmlpack_1_1data_1_1LoadCSV}\index{Load\+C\+SV@{Load\+C\+SV}}


Load the csv file.\+This class use boost\+::spirit to implement the parser, please refer to following link {\tt http\+://theboostcpplibraries.\+com/boost.\+spirit} for quick review.  


\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\textbf{ Load\+C\+SV} (const std\+::string \&file)
\begin{DoxyCompactList}\small\item\em Construct the \doxyref{Load\+C\+SV}{p.}{classmlpack_1_1data_1_1LoadCSV} object on the given file. \end{DoxyCompactList}\item 
{\footnotesize template$<$typename T , typename Map\+Policy $>$ }\\void \textbf{ Get\+Matrix\+Size} (size\+\_\+t \&rows, size\+\_\+t \&cols, \textbf{ Dataset\+Mapper}$<$ Map\+Policy $>$ \&info)
\begin{DoxyCompactList}\small\item\em Peek at the file to determine the number of rows and columns in the matrix, assuming a non-\/transposed matrix. \end{DoxyCompactList}\item 
{\footnotesize template$<$typename T , typename Map\+Policy $>$ }\\void \textbf{ Get\+Transpose\+Matrix\+Size} (size\+\_\+t \&rows, size\+\_\+t \&cols, \textbf{ Dataset\+Mapper}$<$ Map\+Policy $>$ \&info)
\begin{DoxyCompactList}\small\item\em Peek at the file to determine the number of rows and columns in the matrix, assuming a transposed matrix. \end{DoxyCompactList}\item 
{\footnotesize template$<$typename T , typename Policy\+Type $>$ }\\void \textbf{ Load} (arma\+::\+Mat$<$ T $>$ \&inout, \textbf{ Dataset\+Mapper}$<$ Policy\+Type $>$ \&info\+Set, const bool transpose=true)
\begin{DoxyCompactList}\small\item\em Load the file into the given matrix with the given \doxyref{Dataset\+Mapper}{p.}{classmlpack_1_1data_1_1DatasetMapper} object. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
Load the csv file.\+This class use boost\+::spirit to implement the parser, please refer to following link {\tt http\+://theboostcpplibraries.\+com/boost.\+spirit} for quick review. 

Definition at line 36 of file load\+\_\+csv.\+hpp.



\subsection{Constructor \& Destructor Documentation}
\mbox{\label{classmlpack_1_1data_1_1LoadCSV_a39a5511767ebc8669a67744d5f959a5e}} 
\index{mlpack\+::data\+::\+Load\+C\+SV@{mlpack\+::data\+::\+Load\+C\+SV}!Load\+C\+SV@{Load\+C\+SV}}
\index{Load\+C\+SV@{Load\+C\+SV}!mlpack\+::data\+::\+Load\+C\+SV@{mlpack\+::data\+::\+Load\+C\+SV}}
\subsubsection{Load\+C\+S\+V()}
{\footnotesize\ttfamily \textbf{ Load\+C\+SV} (\begin{DoxyParamCaption}\item[{const std\+::string \&}]{file }\end{DoxyParamCaption})}



Construct the \doxyref{Load\+C\+SV}{p.}{classmlpack_1_1data_1_1LoadCSV} object on the given file. 

This will construct the rules necessary for loading and attempt to open the file. 

\subsection{Member Function Documentation}
\mbox{\label{classmlpack_1_1data_1_1LoadCSV_ac22f0004512d4333b29b2e685ef3a5d7}} 
\index{mlpack\+::data\+::\+Load\+C\+SV@{mlpack\+::data\+::\+Load\+C\+SV}!Get\+Matrix\+Size@{Get\+Matrix\+Size}}
\index{Get\+Matrix\+Size@{Get\+Matrix\+Size}!mlpack\+::data\+::\+Load\+C\+SV@{mlpack\+::data\+::\+Load\+C\+SV}}
\subsubsection{Get\+Matrix\+Size()}
{\footnotesize\ttfamily void Get\+Matrix\+Size (\begin{DoxyParamCaption}\item[{size\+\_\+t \&}]{rows,  }\item[{size\+\_\+t \&}]{cols,  }\item[{\textbf{ Dataset\+Mapper}$<$ Map\+Policy $>$ \&}]{info }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



Peek at the file to determine the number of rows and columns in the matrix, assuming a non-\/transposed matrix. 

This will also take a first pass over the data for \doxyref{Dataset\+Mapper}{p.}{classmlpack_1_1data_1_1DatasetMapper}, if Map\+Policy\+::\+Needs\+First\+Pass is true. The info object will be re-\/initialized with the correct dimensionality.


\begin{DoxyParams}{Parameters}
{\em rows} & Variable to be filled with the number of rows. \\
\hline
{\em cols} & Variable to be filled with the number of columns. \\
\hline
{\em info} & \doxyref{Dataset\+Mapper}{p.}{classmlpack_1_1data_1_1DatasetMapper} object to use for first pass. \\
\hline
\end{DoxyParams}


Definition at line 78 of file load\+\_\+csv.\+hpp.

\mbox{\label{classmlpack_1_1data_1_1LoadCSV_aa47dac31ae48b7a106733cbe1937c134}} 
\index{mlpack\+::data\+::\+Load\+C\+SV@{mlpack\+::data\+::\+Load\+C\+SV}!Get\+Transpose\+Matrix\+Size@{Get\+Transpose\+Matrix\+Size}}
\index{Get\+Transpose\+Matrix\+Size@{Get\+Transpose\+Matrix\+Size}!mlpack\+::data\+::\+Load\+C\+SV@{mlpack\+::data\+::\+Load\+C\+SV}}
\subsubsection{Get\+Transpose\+Matrix\+Size()}
{\footnotesize\ttfamily void Get\+Transpose\+Matrix\+Size (\begin{DoxyParamCaption}\item[{size\+\_\+t \&}]{rows,  }\item[{size\+\_\+t \&}]{cols,  }\item[{\textbf{ Dataset\+Mapper}$<$ Map\+Policy $>$ \&}]{info }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



Peek at the file to determine the number of rows and columns in the matrix, assuming a transposed matrix. 

This will also take a first pass over the data for \doxyref{Dataset\+Mapper}{p.}{classmlpack_1_1data_1_1DatasetMapper}, if Map\+Policy\+::\+Needs\+First\+Pass is true. The info object will be re-\/initialized with the correct dimensionality.


\begin{DoxyParams}{Parameters}
{\em rows} & Variable to be filled with the number of rows. \\
\hline
{\em cols} & Variable to be filled with the number of columns. \\
\hline
{\em info} & \doxyref{Dataset\+Mapper}{p.}{classmlpack_1_1data_1_1DatasetMapper} object to use for first pass. \\
\hline
\end{DoxyParams}


Definition at line 151 of file load\+\_\+csv.\+hpp.



References Dataset\+Mapper$<$ Policy\+Type, Input\+Type $>$\+::\+Set\+Dimensionality().

\mbox{\label{classmlpack_1_1data_1_1LoadCSV_ac274f442f96c30aebefd561936c7afb4}} 
\index{mlpack\+::data\+::\+Load\+C\+SV@{mlpack\+::data\+::\+Load\+C\+SV}!Load@{Load}}
\index{Load@{Load}!mlpack\+::data\+::\+Load\+C\+SV@{mlpack\+::data\+::\+Load\+C\+SV}}
\subsubsection{Load()}
{\footnotesize\ttfamily void Load (\begin{DoxyParamCaption}\item[{arma\+::\+Mat$<$ T $>$ \&}]{inout,  }\item[{\textbf{ Dataset\+Mapper}$<$ Policy\+Type $>$ \&}]{info\+Set,  }\item[{const bool}]{transpose = {\ttfamily true} }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



Load the file into the given matrix with the given \doxyref{Dataset\+Mapper}{p.}{classmlpack_1_1data_1_1DatasetMapper} object. 

Throws exceptions on errors.


\begin{DoxyParams}{Parameters}
{\em inout} & Matrix to load into. \\
\hline
{\em info\+Set} & \doxyref{Dataset\+Mapper}{p.}{classmlpack_1_1data_1_1DatasetMapper} to use while loading. \\
\hline
{\em transpose} & If true, the matrix should be transposed on loading (default). \\
\hline
\end{DoxyParams}


Definition at line 55 of file load\+\_\+csv.\+hpp.



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/data/\textbf{ load\+\_\+csv.\+hpp}\end{DoxyCompactItemize}
