\hypertarget{classDataset}{
\section{Dataset Class Reference}
\label{classDataset}\index{Dataset@{Dataset}}
}


Reads a full dataset; limited to those that fit in memory.  


{\ttfamily \#include $<$Dataset.hpp$>$}\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classDataset_a2ef0a4a688a218d55ef061c6df659a4a}{
\hyperlink{classDataset_a2ef0a4a688a218d55ef061c6df659a4a}{Dataset} ()}
\label{classDataset_a2ef0a4a688a218d55ef061c6df659a4a}

\begin{DoxyCompactList}\small\item\em count of rows in each class 1,2... ninc\mbox{[}0\mbox{]} unused \item\end{DoxyCompactList}\item 
\hyperlink{classDataset_aa1944f94eeab85c33080268f6b2af9ba}{Dataset} (string fname, double enc0, double enc1)
\begin{DoxyCompactList}\small\item\em Read from a file. \item\end{DoxyCompactList}\item 
const vector$<$ double $>$ \& \hyperlink{classDataset_ab07e5e06fbbf3fe0328d815832d2d802}{row} (size\_\-t i) const 
\begin{DoxyCompactList}\small\item\em Look at an indexed row of data. \item\end{DoxyCompactList}\item 
size\_\-t \hyperlink{classDataset_a137c9df0b9f1549683bf5f7989a6a27a}{getNClasses} () const 
\begin{DoxyCompactList}\small\item\em Return number of classes. \item\end{DoxyCompactList}\item 
\hypertarget{classDataset_a06a11803a8123591de3eb88866707418}{
size\_\-t \hyperlink{classDataset_a06a11803a8123591de3eb88866707418}{getNRows} () const }
\label{classDataset_a06a11803a8123591de3eb88866707418}

\begin{DoxyCompactList}\small\item\em Return number of rows / instances. \item\end{DoxyCompactList}\item 
size\_\-t \hyperlink{classDataset_ad5d7748e09b2c08941cd04b209493c81}{getTargetClass} (size\_\-t ind) const 
\begin{DoxyCompactList}\small\item\em Return target class 1..N. \item\end{DoxyCompactList}\item 
\hypertarget{classDataset_aaf8355838cecf31530ea5c6000ed2afe}{
size\_\-t \hyperlink{classDataset_aaf8355838cecf31530ea5c6000ed2afe}{getNRowsInClass} (size\_\-t c) const }
\label{classDataset_aaf8355838cecf31530ea5c6000ed2afe}

\begin{DoxyCompactList}\small\item\em Return the number of rows that belong to a given class. \item\end{DoxyCompactList}\item 
\hypertarget{classDataset_aa3747169b3dd42e6a99c42696b18f303}{
const vector$<$ double $>$ \& \hyperlink{classDataset_aa3747169b3dd42e6a99c42696b18f303}{prototype} (size\_\-t row)}
\label{classDataset_aa3747169b3dd42e6a99c42696b18f303}

\begin{DoxyCompactList}\small\item\em Return a binary vector encoding the target class; the real values for the encoding must be given as a constructor parameter; default is -\/1 for non-\/class elements and +1 for class elements. \item\end{DoxyCompactList}\item 
void \hyperlink{classDataset_a9ed827161b414c19ece697f3e5fcfeeb}{toStream} (ostream \&ost) const 
\begin{DoxyCompactList}\small\item\em Dump data to a stream. \item\end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Protected Attributes}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classDataset_a50cc4ee46c70bb1439ffb10771e51712}{
vector$<$ vector$<$ double $>$ $>$ {\bfseries invec}}
\label{classDataset_a50cc4ee46c70bb1439ffb10771e51712}

\item 
\hypertarget{classDataset_aa600fd942a452f2b91e60dbe3f2deed6}{
vector$<$ size\_\-t $>$ \hyperlink{classDataset_aa600fd942a452f2b91e60dbe3f2deed6}{targetc}}
\label{classDataset_aa600fd942a452f2b91e60dbe3f2deed6}

\begin{DoxyCompactList}\small\item\em input vectors \item\end{DoxyCompactList}\item 
\hypertarget{classDataset_aeaf5e8ff6f3ba57027afd682264423db}{
vector$<$ vector$<$ double $>$ $>$ \hyperlink{classDataset_aeaf5e8ff6f3ba57027afd682264423db}{prototypes}}
\label{classDataset_aeaf5e8ff6f3ba57027afd682264423db}

\begin{DoxyCompactList}\small\item\em target classes 1,2,... \item\end{DoxyCompactList}\item 
\hypertarget{classDataset_ab9e6364695fe2623bf0056032d6b8c82}{
size\_\-t \hyperlink{classDataset_ab9e6364695fe2623bf0056032d6b8c82}{nclasses}}
\label{classDataset_ab9e6364695fe2623bf0056032d6b8c82}

\begin{DoxyCompactList}\small\item\em target prototypes \item\end{DoxyCompactList}\item 
\hypertarget{classDataset_a7855bf761688d899f2ec708c296314a3}{
vector$<$ size\_\-t $>$ \hyperlink{classDataset_a7855bf761688d899f2ec708c296314a3}{ninc}}
\label{classDataset_a7855bf761688d899f2ec708c296314a3}

\begin{DoxyCompactList}\small\item\em number of classes; discovered upon load \item\end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
Reads a full dataset; limited to those that fit in memory. A pointer to this must be shared among all users. As of yet, works only for classification datasets, where the last value on each row is the integral class label and all other values are real-\/valued features. 

\subsection{Constructor \& Destructor Documentation}
\hypertarget{classDataset_aa1944f94eeab85c33080268f6b2af9ba}{
\index{Dataset@{Dataset}!Dataset@{Dataset}}
\index{Dataset@{Dataset}!Dataset@{Dataset}}
\subsubsection[{Dataset}]{\setlength{\rightskip}{0pt plus 5cm}Dataset::Dataset (string {\em fname}, \/  double {\em enc0}, \/  double {\em enc1})}}
\label{classDataset_aa1944f94eeab85c33080268f6b2af9ba}


Read from a file. TODO: differentiate classification / approx? 

\subsection{Member Function Documentation}
\hypertarget{classDataset_a137c9df0b9f1549683bf5f7989a6a27a}{
\index{Dataset@{Dataset}!getNClasses@{getNClasses}}
\index{getNClasses@{getNClasses}!Dataset@{Dataset}}
\subsubsection[{getNClasses}]{\setlength{\rightskip}{0pt plus 5cm}size\_\-t Dataset::getNClasses () const}}
\label{classDataset_a137c9df0b9f1549683bf5f7989a6a27a}


Return number of classes. TODO: classification vs. approx? \hypertarget{classDataset_ad5d7748e09b2c08941cd04b209493c81}{
\index{Dataset@{Dataset}!getTargetClass@{getTargetClass}}
\index{getTargetClass@{getTargetClass}!Dataset@{Dataset}}
\subsubsection[{getTargetClass}]{\setlength{\rightskip}{0pt plus 5cm}size\_\-t Dataset::getTargetClass (size\_\-t {\em ind}) const}}
\label{classDataset_ad5d7748e09b2c08941cd04b209493c81}


Return target class 1..N. NOTE: class indices are base 1 while data indices are base 0! \hypertarget{classDataset_ab07e5e06fbbf3fe0328d815832d2d802}{
\index{Dataset@{Dataset}!row@{row}}
\index{row@{row}!Dataset@{Dataset}}
\subsubsection[{row}]{\setlength{\rightskip}{0pt plus 5cm}const vector$<$ double $>$ \& Dataset::row (size\_\-t {\em i}) const}}
\label{classDataset_ab07e5e06fbbf3fe0328d815832d2d802}


Look at an indexed row of data. TODO: Likely to replace this with iterators that can be generated for splits. Or, rather, objects of type DataSplit. \hypertarget{classDataset_a9ed827161b414c19ece697f3e5fcfeeb}{
\index{Dataset@{Dataset}!toStream@{toStream}}
\index{toStream@{toStream}!Dataset@{Dataset}}
\subsubsection[{toStream}]{\setlength{\rightskip}{0pt plus 5cm}void Dataset::toStream (ostream \& {\em ost}) const}}
\label{classDataset_a9ed827161b414c19ece697f3e5fcfeeb}


Dump data to a stream. 

The documentation for this class was generated from the following files:\begin{DoxyCompactItemize}
\item 
src/Dataset.hpp\item 
src/Dataset.cpp\end{DoxyCompactItemize}
