#include <Data.hpp>
Public Member Functions | |
Data () | |
Default constructor. | |
Data (uint nbp, uint nbv) | |
Constructor. | |
~Data () | |
Destructor. | |
uint | Get_N () |
Get the number of observations. | |
uint | Get_D () |
Get the dimension. | |
void | Get (uint i, vector< double > &obs) |
Get the observation at a given site i. | |
double | Get (uint i, uint d) |
Get X_i[d]. | |
uint | GetLabel (uint i) |
Get the label of site i. | |
void | GetLabels (vector< uint > &labs) |
Get all the labels. | |
void | Set (uint i, vector< double > const &obs) |
Set the observation at the site i. | |
void | SetLabel (uint i, uint lab) |
Set the label of site i. | |
void | ReadFromFile (string filename) |
read data from a file, dimension = 1 | |
void | ReadFromFile (string filename, uint dim) |
read data in file , dimension = dim | |
void | WriteToFile (string filename) |
Write data in file. | |
void | Stats (vector< double > &mean, vector< double > &cov) |
Compute the (empirical) mean and covariance of the data. | |
void | K_means (uint K, vector< double > ¢ers, vector< uint > &labels) |
K-means algorithm. | |
void | Info () |
Display some (statistical) information about the dataset. |
The data may be labelled (TBD).
|
Default constructor for class Data Sets the number of observations to zero, and assumes working in dimension 1. |
|
Constructor for class Data
|
|
Destructor for class Data Frees the memory used by the observation and labels associated. |
|
Get X_i[d] |
|
Get the observation at the site i.
|
|
Get the dimension.
|
|
Get the number of observations.
|
|
Get the label at the site i.
|
|
Get the labels.
|
|
Display some info about the dataset. This method is here for verification purposes. It displays a set of (statistical ) descriptors about the data. Current descriptos are: the size, dimension, column means , standard deviations, maxima , minima |
|
draw centers at random |
|
Read data from a text file in a specific dimension.
The file must contain a sequence of dim*nbPts doubles. Dimension is set to dim. |
|
Read data from a text file.
The file must contain a sequence of dim*nbPts doubles. Dimension is assumed to be 1. |
|
Set the observation at the site i.
|
|
Set the label at the site i.
|
|
Compute simple statistics from the data (mean and covariance). Useful for estimating a gaussain distribution. |
|
Write data to a text file.
The file will contain a sequence of dim*nbPts double values. Each observation is written on a separated line. This format is compatible with the format required by ReadFromFile |