OpenNN::DataSet Class Reference

#include <data_set.h>

List of all members.

Public Types

enum  ScalingUnscalingMethod { MinimumMaximum, MeanStandardDeviation }

Public Member Functions

 DataSet (void)
 DataSet (const unsigned int &, const unsigned int &)
 DataSet (const unsigned int &, const unsigned int &, const unsigned int &)
 DataSet (TiXmlElement *)
 DataSet (const std::string &)
 DataSet (const DataSet &)
virtual ~DataSet (void)
DataSetoperator= (const DataSet &)
bool operator== (const DataSet &) const
const std::string & get_data_filename (void) const
unsigned int get_instances_number (void) const
unsigned int get_variables_number (void) const
const VariablesInformationget_variables_information (void) const
VariablesInformationget_variables_information_pointer (void)
const InstancesInformationget_instances_information (void) const
InstancesInformationget_instances_information_pointer (void)
const ScalingUnscalingMethodget_scaling_unscaling_method (void) const
std::string write_scaling_unscaling_method (void) const
const bool & get_display (void) const
const Matrix< double > & get_data (void) const
Matrix< double > arrange_training_data (void) const
Matrix< double > arrange_generalization_data (void) const
Matrix< double > arrange_testing_data (void) const
Matrix< double > arrange_input_data (void) const
Matrix< double > arrange_target_data (void) const
Matrix< double > arrange_training_input_data (void) const
Matrix< double > arrange_training_target_data (void) const
Matrix< double > get_generalization_input_data (void) const
Matrix< double > get_generalization_target_data (void) const
Matrix< double > arrange_testing_input_data (void) const
Matrix< double > arrange_testing_target_data (void) const
Vector< double > get_instance (const unsigned int &) const
Vector< double > get_training_instance (const unsigned int &) const
Vector< double > get_generalization_instance (const unsigned int &) const
Vector< double > get_testing_instance (const unsigned int &) const
Vector< double > get_input_instance (const unsigned int &) const
Vector< double > get_target_instance (const unsigned int &) const
Vector< double > get_training_input_instance (const unsigned int &) const
Vector< double > get_training_target_instance (const unsigned int &) const
Vector< double > get_generalization_input_instance (const unsigned int &) const
Vector< double > get_generalization_target_instance (const unsigned int &) const
Vector< double > get_testing_input_instance (const unsigned int &) const
Vector< double > get_testing_target_instance (const unsigned int &) const
Vector< double > get_variable (const unsigned int &) const
void set (void)
void set (const unsigned int &, const unsigned int &)
void set (const unsigned int &, const unsigned int &, const unsigned int &)
void set (const DataSet &)
void set (TiXmlElement *)
void set (const std::string &)
void set_data (const Matrix< double > &)
void set_instances_number (const unsigned int &)
void set_variables_number (const unsigned int &)
void set_data_filename (const std::string &)
void set_scaling_unscaling_method (const ScalingUnscalingMethod &)
void set_scaling_unscaling_method (const std::string &)
void set_display (const bool &)
void set_default (void)
void set_instance (const unsigned int &, const Vector< double > &)
void set_training_instance (const unsigned int &, const Vector< double > &)
void set_generalization_instance (const unsigned int &, const Vector< double > &)
void set_testing_instance (const unsigned int &, const Vector< double > &)
void set_input_instance (const unsigned int &, const Vector< double > &)
void set_target_instance (const unsigned int &, const Vector< double > &)
void set_training_input_instance (const unsigned int &, const Vector< double > &)
void set_training_target_instance (const unsigned int &, const Vector< double > &)
void set_generalization_input_instance (const unsigned int &, const Vector< double > &)
void set_generalization_target_instance (const unsigned int &, const Vector< double > &)
void set_testing_input_instance (const unsigned int &, const Vector< double > &)
void set_testing_target_instance (const unsigned int &, const Vector< double > &)
void add_instance (const Vector< double > &)
void subtract_instance (const unsigned int &)
void append_variable (const Vector< double > &)
void subtract_variable (const unsigned int &)
void subtract_constant_variables (void)
void subtract_repeated_instances (void)
void initialize_data (const double &)
void initialize_data_normal (void)
Vector< Vector< double > > calculate_data_statistics (void) const
Vector< Vector< double > > calculate_training_instances_statistics (void) const
Vector< Vector< double > > calculate_generalization_instances_statistics (void) const
Vector< Vector< double > > calculate_testing_instances_statistics (void) const
Vector< Vector< double > > calculate_instances_statistics (void) const
Vector< Vector< double > > calculate_inputs_statistics (void) const
Vector< Vector< double > > calculate_targets_statistics (void) const
Vector< Vector< double > > calculate_inputs_targets_minimum_maximum (void) const
Vector< Vector< double > > calculate_inputs_targets_mean_standard_deviation (void) const
Vector< Vector< double > > calculate_inputs_targets_statistics (void) const
Vector< double > calculate_training_target_data_mean (void) const
Vector< double > calculate_generalization_target_data_mean (void) const
Vector< double > calculate_testing_target_data_mean (void) const
Matrix< double > calculate_variables_correlation (void) const
Vector< Vector< Vector< double > > > calculate_data_histogram (const unsigned int &) const
Vector< Vector< Vector< double > > > calculate_data_histogram (void) const
void scale_data_minimum_maximum (const Vector< double > &, const Vector< double > &)
void scale_data_mean_standard_deviation (const Vector< double > &, const Vector< double > &)
void scale_data (const Vector< Vector< double > > &)
Vector< Vector< double > > scale_data (void)
void scale_inputs_minimum_maximum (const Vector< double > &, const Vector< double > &)
Vector< Vector< double > > scale_inputs_minimum_maximum (void)
void scale_inputs_mean_standard_deviation (const Vector< double > &, const Vector< double > &)
Vector< Vector< double > > scale_inputs_mean_standard_deviation (void)
Vector< Vector< double > > scale_inputs (void)
void scale_targets_minimum_maximum (const Vector< double > &, const Vector< double > &)
Vector< Vector< double > > scale_targets_minimum_maximum (void)
void scale_targets_mean_standard_deviation (const Vector< double > &, const Vector< double > &)
Vector< Vector< double > > scale_targets_mean_standard_deviation (void)
Vector< Vector< double > > scale_targets (void)
void scale_inputs_targets_minimum_maximum (const Vector< double > &, const Vector< double > &, const Vector< double > &, const Vector< double > &)
Vector< Vector< double > > scale_inputs_targets_minimum_maximum (void)
void scale_inputs_targets_mean_standard_deviation (const Vector< double > &, const Vector< double > &, const Vector< double > &, const Vector< double > &)
Vector< Vector< double > > scale_inputs_targets_mean_standard_deviation (void)
Vector< Vector< double > > scale_inputs_targets (void)
void unscale_data_minimum_maximum (const Vector< double > &, const Vector< double > &)
void unscale_data_mean_standard_deviation (const Vector< double > &, const Vector< double > &)
void unscale_inputs_minimum_maximum (const Vector< double > &, const Vector< double > &)
void unscale_inputs_mean_standard_deviation (const Vector< double > &, const Vector< double > &)
void unscale_targets_minimum_maximum (const Vector< double > &, const Vector< double > &)
void unscale_targets_mean_standard_deviation (const Vector< double > &, const Vector< double > &)
void unscale_inputs_targets_minimum_maximum (const Vector< Vector< double > > &)
void unscale_inputs_targets_mean_standard_deviation (const Vector< Vector< double > > &)
Vector< unsigned int > calculate_target_class_distribution (void) const
std::string to_string (void) const
void print (void) const
TiXmlElement * to_XML (void) const
void from_XML (TiXmlElement *)
void save (const std::string &) const
void load (const std::string &)
void print_data (void) const
void save_data (const std::string &) const
void load_data (const std::string &)


Detailed Description

This class represents the concept of data set for data modelling problems, such as function regression, pattern recognition and time series prediction. It basically consists of a data matrix plus a variables and an instances information objects.

Definition at line 43 of file data_set.h.


Member Enumeration Documentation

Enumeration of available methods for scaling and unscaling the data.

Definition at line 88 of file data_set.h.


Constructor & Destructor Documentation

OpenNN::DataSet::DataSet ( void   )  [explicit]

Default constructor. It creates a data set object with zero instances and zero inputs and target variables. It also initializes the rest of class members to their default values.

Definition at line 46 of file data_set.cpp.

OpenNN::DataSet::DataSet ( const unsigned int &  new_instances_number,
const unsigned int &  new_variables_number 
) [explicit]

Instances and variables number constructor. It creates a data set object with given instances and variables numbers. All the variables are set as inputs. It also initializes the rest of class members to their default values.

Parameters:
new_instances_number Number of instances in the data set.
new_variables_number Number of variables.

Definition at line 63 of file data_set.cpp.

OpenNN::DataSet::DataSet ( const unsigned int &  new_instances_number,
const unsigned int &  new_inputs_number,
const unsigned int &  new_targets_number 
) [explicit]

Instances number, input variables number and target variables number constructor. It creates a data set object with given instances and inputs and target variables numbers. It also initializes the rest of class members to their default values.

Parameters:
new_instances_number Number of instances in the data set.
new_inputs_number Number of input variables.
new_targets_number Number of target variables.

Definition at line 80 of file data_set.cpp.

OpenNN::DataSet::DataSet ( TiXmlElement *  data_set_element  )  [explicit]

This method sets the data set members from a XML element.

Parameters:
data_set_element Pointer to a Tiny XML element containing the member data.

Definition at line 93 of file data_set.cpp.

OpenNN::DataSet::DataSet ( const std::string &  filename  )  [explicit]

File constructor. It creates a data set object by loading the object members from a XML-type file. Please mind about the file format. This is specified in the User's Guide.

Parameters:
filename Data set file name.

Definition at line 107 of file data_set.cpp.

OpenNN::DataSet::DataSet ( const DataSet other_data_set  ) 

Copy constructor. It creates a copy of an existing inputs targets data set object.

Parameters:
other_data_set Data set object to be copied.

Definition at line 123 of file data_set.cpp.

OpenNN::DataSet::~DataSet ( void   )  [virtual]

Destructor.

Definition at line 135 of file data_set.cpp.


Member Function Documentation

DataSet & OpenNN::DataSet::operator= ( const DataSet other_data_set  ) 

Assignment operator. It assigns to the current object the members of an existing data set object.

Parameters:
other_data_set Data set object to be assigned.

Definition at line 146 of file data_set.cpp.

bool OpenNN::DataSet::operator== ( const DataSet other_data_set  )  const

Equal to operator. It compares this object with another object of the same class. It returns true if the members of the two objects have the same values, and false otherwise. @ param other_data_set Data set object to be compared with.

Definition at line 182 of file data_set.cpp.

const std::string & OpenNN::DataSet::get_data_filename ( void   )  const

This method returns the name of the data file.

Definition at line 306 of file data_set.cpp.

unsigned int OpenNN::DataSet::get_instances_number ( void   )  const [inline]

This method returns the number of instances in the data set.

Definition at line 98 of file data_set.h.

unsigned int OpenNN::DataSet::get_variables_number ( void   )  const [inline]

This method returns the total number of variables in the data set.

Definition at line 105 of file data_set.h.

const VariablesInformation & OpenNN::DataSet::get_variables_information ( void   )  const

This method returns a constant reference to the variables information object composing this data set object.

Definition at line 206 of file data_set.cpp.

VariablesInformation * OpenNN::DataSet::get_variables_information_pointer ( void   ) 

This method returns a pointer to the variables information object composing this data set object.

Definition at line 216 of file data_set.cpp.

const InstancesInformation & OpenNN::DataSet::get_instances_information ( void   )  const

This method returns a constant reference to the instances information object composing this data set object.

Definition at line 226 of file data_set.cpp.

InstancesInformation * OpenNN::DataSet::get_instances_information_pointer ( void   ) 

This method returns a pointer to the variables information object composing this data set object.

Definition at line 236 of file data_set.cpp.

const DataSet::ScalingUnscalingMethod & OpenNN::DataSet::get_scaling_unscaling_method ( void   )  const

This method returns the method used for scaling and unscaling the data.

Definition at line 246 of file data_set.cpp.

std::string OpenNN::DataSet::write_scaling_unscaling_method ( void   )  const

This method returns a string with the name of the method used for scaling and unscaling the data.

Definition at line 256 of file data_set.cpp.

const bool & OpenNN::DataSet::get_display ( void   )  const

This method returns true if messages from this class can be displayed on the screen, or false if messages from this class can't be displayed on the screen.

Definition at line 284 of file data_set.cpp.

const Matrix< double > & OpenNN::DataSet::get_data ( void   )  const

This method returns a reference to the data matrix in the data set. The number of rows is equal to the number of instances. The number of columns is equal to the number of variables.

Definition at line 296 of file data_set.cpp.

Matrix< double > OpenNN::DataSet::arrange_training_data ( void   )  const

This method returns a matrix with the training instances in the data set. The number of rows is the number of training instances. The number of columns is the number of variables.

Definition at line 318 of file data_set.cpp.

Matrix< double > OpenNN::DataSet::arrange_generalization_data ( void   )  const

This method returns a matrix with the generalization instances in the data set. The number of rows is the number of generalization instances. The number of columns is the number of variables.

Definition at line 336 of file data_set.cpp.

Matrix< double > OpenNN::DataSet::arrange_testing_data ( void   )  const

This method returns a matrix with the testing instances in the data set. The number of rows is the number of testing instances. The number of columns is the number of variables.

Definition at line 354 of file data_set.cpp.

Matrix< double > OpenNN::DataSet::arrange_input_data ( void   )  const

This method returns a matrix with the input variables in the data set. The number of rows is the number of instances. The number of columns is the number of input variables.

Definition at line 371 of file data_set.cpp.

Matrix< double > OpenNN::DataSet::arrange_target_data ( void   )  const

This method returns a matrix with the target variables in the data set. The number of rows is the number of instances. The number of columns is the number of target variables.

Definition at line 388 of file data_set.cpp.

Matrix< double > OpenNN::DataSet::arrange_training_input_data ( void   )  const

This method returns a matrix with training instances and input variables. The number of rows is the number of training instances. The number of columns is the number of input variables.

Definition at line 405 of file data_set.cpp.

Matrix< double > OpenNN::DataSet::arrange_training_target_data ( void   )  const

This method returns a matrix with training instances and target variables. The number of rows is the number of training instances. The number of columns is the number of target variables.

Definition at line 421 of file data_set.cpp.

Matrix< double > OpenNN::DataSet::get_generalization_input_data ( void   )  const

This method returns a matrix with generalization instances and input variables. The number of rows is the number of generalization instances. The number of columns is the number of input variables.

Definition at line 437 of file data_set.cpp.

Matrix< double > OpenNN::DataSet::get_generalization_target_data ( void   )  const

This method returns a matrix with generalization instances and target variables. The number of rows is the number of generalization instances. The number of columns is the number of target variables.

Definition at line 453 of file data_set.cpp.

Matrix< double > OpenNN::DataSet::arrange_testing_input_data ( void   )  const

This method returns a matrix with testing instances and input variables. The number of rows is the number of testing instances. The number of columns is the number of input variables.

Definition at line 469 of file data_set.cpp.

Matrix< double > OpenNN::DataSet::arrange_testing_target_data ( void   )  const

This method returns a matrix with testing instances and target variables. The number of rows is the number of testing instances. The number of columns is the number of target variables.

Definition at line 485 of file data_set.cpp.

Vector< double > OpenNN::DataSet::get_instance ( const unsigned int &  i  )  const

This method returns the inputs and target values of a single instance in the data set.

Parameters:
i Index of the instance.

Definition at line 500 of file data_set.cpp.

Vector< double > OpenNN::DataSet::get_training_instance ( const unsigned int &  training_instance_index  )  const

This method returns the inputs and target values of a single training instance in the data set.

Parameters:
training_instance_index Index of the training instance.

Definition at line 532 of file data_set.cpp.

Vector< double > OpenNN::DataSet::get_generalization_instance ( const unsigned int &  generalization_instance_index  )  const

This method returns the inputs and target values of a single generalization instance in the data set.

Parameters:
generalization_instance_index Index of the generalization instance.

Definition at line 564 of file data_set.cpp.

Vector< double > OpenNN::DataSet::get_testing_instance ( const unsigned int &  testing_instance_index  )  const

This method returns the inputs and target values of a single testing instance in the data set.

Parameters:
testing_instance_index Index of the testing instance.

Definition at line 596 of file data_set.cpp.

Vector< double > OpenNN::DataSet::get_input_instance ( const unsigned int &  instance_index  )  const

This method returns a vector with the input values of a single instance in the data set.

Parameters:
instance_index Index of the instance.

Definition at line 628 of file data_set.cpp.

Vector< double > OpenNN::DataSet::get_target_instance ( const unsigned int &  instance_index  )  const

This method returns a vector with the target values of a single instance in the data set.

Parameters:
instance_index Index of the instance.

Definition at line 660 of file data_set.cpp.

Vector< double > OpenNN::DataSet::get_training_input_instance ( const unsigned int &  training_instance_index  )  const

This method returns the input values of a given training instance.

Parameters:
training_instance_index Index of training instance.

Definition at line 693 of file data_set.cpp.

Vector< double > OpenNN::DataSet::get_training_target_instance ( const unsigned int &  training_instance_index  )  const

This method returns the target values of a given training instance.

Parameters:
training_instance_index Index of training instance.

Definition at line 795 of file data_set.cpp.

Vector< double > OpenNN::DataSet::get_generalization_input_instance ( const unsigned int &  generalization_instance_index  )  const

This method returns the input values of a given generalization instance.

Parameters:
generalization_instance_index Index of generalization instance.

Definition at line 727 of file data_set.cpp.

Vector< double > OpenNN::DataSet::get_generalization_target_instance ( const unsigned int &  generalization_instance_index  )  const

This method returns the target values of a given generalization instance.

Parameters:
generalization_instance_index Index of generalization instance.

Definition at line 829 of file data_set.cpp.

Vector< double > OpenNN::DataSet::get_testing_input_instance ( const unsigned int &  testing_instance_index  )  const

This method returns the input values of a given testing instance.

Parameters:
testing_instance_index Index of testing instance.

Definition at line 761 of file data_set.cpp.

Vector< double > OpenNN::DataSet::get_testing_target_instance ( const unsigned int &  testing_instance_index  )  const

This method returns the target values of a given testing instance.

Parameters:
testing_instance_index Index of testing instance.

Definition at line 863 of file data_set.cpp.

Vector< double > OpenNN::DataSet::get_variable ( const unsigned int &  i  )  const

This method returns all the instances of a single variable in the data set.

Parameters:
i Index of the variable.

Definition at line 897 of file data_set.cpp.

void OpenNN::DataSet::set ( void   ) 

This method sets zero instances and zero variables in the data set.

Definition at line 928 of file data_set.cpp.

void OpenNN::DataSet::set ( const unsigned int &  new_instances_number,
const unsigned int &  new_variables_number 
)

This method sets new numbers of instances and variables in the inputs targets data set. All the instances are set for training. All the variables are set as inputs.

Parameters:
new_instances_number Number of instances.
new_variables_number Number of variables.

Definition at line 949 of file data_set.cpp.

void OpenNN::DataSet::set ( const unsigned int &  new_instances_number,
const unsigned int &  new_inputs_number,
const unsigned int &  new_targets_number 
)

This method sets new numbers of instances and inputs and target variables in the data set. All the instances are set for training. The variables in the data set are the number of inputs plus the number of targets. The first variables in the data matrix correspond to the input variables. The last variables in the data matrix correspond to the target variables.

Parameters:
new_instances_number Number of instances.
new_inputs_number Number of input variables.
new_targets_number Number of target variables.

Definition at line 975 of file data_set.cpp.

void OpenNN::DataSet::set ( const DataSet other_data_set  ) 

This method sets the members of this data set object with those from another data set object.

Parameters:
other_data_set Data set object to be copied.

Definition at line 996 of file data_set.cpp.

void OpenNN::DataSet::set ( TiXmlElement *  data_set_element  ) 

This method sets the data set members from a XML element.

Parameters:
data_set_element Pointer to a Tiny XML element containing the member data.

Definition at line 1015 of file data_set.cpp.

void OpenNN::DataSet::set ( const std::string &  filename  ) 

This method sets the data set members by loading them from a XML file.

Parameters:
filename Data set XML filename.

Definition at line 1026 of file data_set.cpp.

void OpenNN::DataSet::set_data ( const Matrix< double > &  new_data  ) 

This method sets a new data matrix. The number of rows must be equal to the number of instances. The number of columns must be equal to the number of variables. Indices of all training, generalization and testing instances and inputs and target variables do not change.

Parameters:
new_data Data matrix.

Definition at line 1108 of file data_set.cpp.

void OpenNN::DataSet::set_instances_number ( const unsigned int &  new_instances_number  ) 

This method sets a new number of instances in the data set. All instances are also set for training. The indices of the inputs and target variables do not change.

Parameters:
new_instances_number Number of instances.

Definition at line 1186 of file data_set.cpp.

void OpenNN::DataSet::set_variables_number ( const unsigned int &  new_variables_number  ) 

This method sets a new number of input variables in the data set. The indices of the training, generalization and testing instances do not change. All variables are set as inputs.

Parameters:
new_variables_number Number of variables.

Definition at line 1203 of file data_set.cpp.

void OpenNN::DataSet::set_data_filename ( const std::string &  new_data_filename  ) 

This method sets the name of the data file. It also loads the data from that file. Moreover, it sets the variables and instances information objects.

Parameters:
new_data_filename Name of the file containing the data.

Definition at line 1157 of file data_set.cpp.

void OpenNN::DataSet::set_scaling_unscaling_method ( const ScalingUnscalingMethod new_scaling_unscaling_method  ) 

This method sets the method for scaling and uscaling the data.

Parameters:
new_scaling_unscaling_method Scaling and unscaling method.

Definition at line 1037 of file data_set.cpp.

void OpenNN::DataSet::set_scaling_unscaling_method ( const std::string &  new_scaling_unscaling_method  ) 

This method sets the method for scaling and uscaling the data from a string containing the name of the method.

Parameters:
new_scaling_unscaling_method Scaling and unscaling method.

Definition at line 1048 of file data_set.cpp.

void OpenNN::DataSet::set_display ( const bool &  new_display  ) 

This method sets a new display value. If it is set to true messages from this class are to be displayed on the screen; if it is set to false messages from this class are not to be displayed on the screen.

Parameters:
new_display Display value.

Definition at line 1078 of file data_set.cpp.

void OpenNN::DataSet::set_default ( void   ) 

This method sets the default member values:

  • Scaling and uscaling method: Minimum and maximum.
  • Display: True.

Definition at line 1092 of file data_set.cpp.

void OpenNN::DataSet::set_instance ( const unsigned int &  instance_index,
const Vector< double > &  instance 
)

This method sets new inputs and target values of a single instance in the data set.

Parameters:
instance_index Index of the instance.
instance New inputs and target values of the instance.

Definition at line 1219 of file data_set.cpp.

void OpenNN::DataSet::set_training_instance ( const unsigned int &  i,
const Vector< double > &  new_training_instance 
)

This method sets new inputs and target values of a single training instance in the data set.

Parameters:
i Index of the training instance.
new_training_instance New inputs and target values of the training instance.

Definition at line 1266 of file data_set.cpp.

void OpenNN::DataSet::set_generalization_instance ( const unsigned int &  i,
const Vector< double > &  new_generalization_instance 
)

This method sets new inputs and target values of a single generalization instance in the data set.

Parameters:
i Index of the generalization instance.
new_generalization_instance New inputs and target values of the generalization instance.

Definition at line 1301 of file data_set.cpp.

void OpenNN::DataSet::set_testing_instance ( const unsigned int &  i,
const Vector< double > &  new_testing_instance 
)

This method sets new inputs and target values of a single testing instance in the data set.

Parameters:
i Index of the testing instance.
new_testing_instance New inputs and target values of the testing instance.

Definition at line 1336 of file data_set.cpp.

void OpenNN::DataSet::set_input_instance ( const unsigned int &  instance_index,
const Vector< double > &  input_instance 
)

This method sets new input values of a single instance in the data set.

Parameters:
instance_index Index of the instance.
input_instance New input values of the instance.

Definition at line 1371 of file data_set.cpp.

void OpenNN::DataSet::set_target_instance ( const unsigned int &  instance_index,
const Vector< double > &  target_instance 
)

This method sets new target values of a single instance in the data set.

Parameters:
instance_index Index of the instance.
target_instance New target values of the instance.

Definition at line 1430 of file data_set.cpp.

void OpenNN::DataSet::set_training_input_instance ( const unsigned int &  i,
const Vector< double > &  new_training_input_instance 
)

This method sets new input values of a single training instance in the data set.

Parameters:
i Index of the training instance.
new_training_input_instance New input values of that instance.

Definition at line 1489 of file data_set.cpp.

void OpenNN::DataSet::set_training_target_instance ( const unsigned int &  i,
const Vector< double > &  new_training_target_instance 
)

This method sets new target values of a single training instance in the data set.

Parameters:
i Index of the training instance.
new_training_target_instance New target values of that instance.

Definition at line 1594 of file data_set.cpp.

void OpenNN::DataSet::set_generalization_input_instance ( const unsigned int &  i,
const Vector< double > &  new_generalization_input_instance 
)

This method sets new input values of a single generalization instance in the data set.

Parameters:
i Index of the generalization instance.
new_generalization_input_instance New input values of that instance.

Definition at line 1524 of file data_set.cpp.

void OpenNN::DataSet::set_generalization_target_instance ( const unsigned int &  i,
const Vector< double > &  new_generalization_target_instance 
)

This method sets new target values of a single generalization instance in the data set.

Parameters:
i Index of the generalization instance.
new_generalization_target_instance New target values of that instance.

Definition at line 1629 of file data_set.cpp.

void OpenNN::DataSet::set_testing_input_instance ( const unsigned int &  i,
const Vector< double > &  new_testing_input_instance 
)

This method sets new input values of a single testing instance in the data set.

Parameters:
i Index of the testing instance.
new_testing_input_instance New input values of that instance.

Definition at line 1559 of file data_set.cpp.

void OpenNN::DataSet::set_testing_target_instance ( const unsigned int &  i,
const Vector< double > &  new_testing_target_instance 
)

This method sets new target values of a single testing instance in the data set.

Parameters:
i Index of the testing instance.
new_testing_target_instance New target values of that instance.

Definition at line 1664 of file data_set.cpp.

void OpenNN::DataSet::add_instance ( const Vector< double > &  instance  ) 

This method adds a new instance to the data matrix from a vector of real numbers. The size of that vector must be equal to the number of variables. Note that resizing is here necessary and therefore computationally expensive. All instances are also set for training.

Parameters:
instance Input and target values of the instance to be added.

Definition at line 1701 of file data_set.cpp.

void OpenNN::DataSet::subtract_instance ( const unsigned int &  instance_index  ) 

This method substract the inputs-targets instance with a given index from the data set. All instances are also set for training. Note that resizing is here necessary and therefore computationally expensive.

Parameters:
instance_index Index of instance to be removed.

Definition at line 1736 of file data_set.cpp.

void OpenNN::DataSet::append_variable ( const Vector< double > &  variable  ) 

This method appends a variable with given values to the data matrix.

Parameters:
variable Vector of values. The size must be equal to the number of instances.

Definition at line 1768 of file data_set.cpp.

void OpenNN::DataSet::subtract_variable ( const unsigned int &  variable_index  ) 

This method removes a variable with given index from the data matrix.

Parameters:
variable_index Index of variable to be subtracted.

Definition at line 1809 of file data_set.cpp.

void OpenNN::DataSet::subtract_constant_variables ( void   ) 

Todo:

Definition at line 1846 of file data_set.cpp.

void OpenNN::DataSet::subtract_repeated_instances ( void   ) 

Todo:

Definition at line 1855 of file data_set.cpp.

void OpenNN::DataSet::initialize_data ( const double &  new_value  ) 

This methods initializes the data matrix with a given value.

Parameters:
new_value Initialization value.

Definition at line 3264 of file data_set.cpp.

void OpenNN::DataSet::initialize_data_normal ( void   ) 

This methods initializes the data matrix with random given values chosen from a normal distribution with mean 0 and standard deviation 1.

Definition at line 3275 of file data_set.cpp.

Vector< Vector< double > > OpenNN::DataSet::calculate_data_statistics ( void   )  const

This method returns a vector of vectors containing some basic statistics of all the variables in the data set. The size of this vector is four. The subvectors are:

  • Minimum.
  • Maximum.
  • Mean.
  • Standard deviation.

Definition at line 1897 of file data_set.cpp.

Vector< Vector< double > > OpenNN::DataSet::calculate_training_instances_statistics ( void   )  const

This method returns a vector of vectors containing some basic statistics of all variables on the training instances. The size of this vector is four. The subvectors are:

  • Training data mean.
  • Training data standard deviation.
  • Training data minimum.
  • Training data maximum.

Definition at line 1925 of file data_set.cpp.

Vector< Vector< double > > OpenNN::DataSet::calculate_generalization_instances_statistics ( void   )  const

This method returns a vector of vectors containing some basic statistics of all variables on the generalization instances. The size of this vector is four. The subvectors are:

  • Generalization data mean.
  • Generalization data standard deviation.
  • Generalization data minimum.
  • Generalization data maximum.

Definition at line 1958 of file data_set.cpp.

Vector< Vector< double > > OpenNN::DataSet::calculate_testing_instances_statistics ( void   )  const

This method returns a vector of vectors containing some basic statistics of all variables on the testing instances. The size of this vector is four. The subvectors are:

  • Testing data mean.
  • Testing data standard deviation.
  • Testing data minimum.
  • Testing data maximum.

Definition at line 1991 of file data_set.cpp.

Vector< Vector< double > > OpenNN::DataSet::calculate_instances_statistics ( void   )  const

This method returns a vector of vectors containing some basic statistics of all variables on all data, training, generalization and testing instances. The size of this vector is twelve. The subvectors are:

  • Data mean.
  • Data standard deviation.
  • Data minimum.
  • Data maximum.
  • Training instances mean.
  • Training instances standard deviation.
  • Training instances minimum.
  • Training instances maximum.
  • Generalization instances mean.
  • Generalization instances standard deviation.
  • Generalization instances minimum.
  • Generalization instances maximum.
  • Testing instances mean.
  • Testing instances standard deviation.
  • Testing instances minimum.
  • Testing instances maximum.

Definition at line 2037 of file data_set.cpp.

Vector< Vector< double > > OpenNN::DataSet::calculate_inputs_statistics ( void   )  const

This method returns a vector of vectors with some basic statistics of the input variables on all instances. The size of this vector is four. The subvectors are:

  • Input variables mean.
  • Input variables standard deviation.
  • Input variables minimum.
  • Input variables maximum.

Definition at line 2059 of file data_set.cpp.

Vector< Vector< double > > OpenNN::DataSet::calculate_targets_statistics ( void   )  const

This method returns a vector of vectors with some basic statistics of the target variables on all instances. The size of this vector is four. The subvectors are:

  • Target variables mean.
  • Target variables standard deviation.
  • Target variables minimum.
  • Target variables maximum.

Definition at line 2088 of file data_set.cpp.

Vector< Vector< double > > OpenNN::DataSet::calculate_inputs_targets_minimum_maximum ( void   )  const

This method returns a vector of vectors with some the minimum and maximum values of the inputs and target variables on all instances. The size of this vector is four. The subvectors are:

  • Input variables minimum.
  • Input variables maximum.
  • Target variables minimum.
  • Target variables maximum.

Definition at line 2118 of file data_set.cpp.

Vector< Vector< double > > OpenNN::DataSet::calculate_inputs_targets_mean_standard_deviation ( void   )  const

This method returns a vector of vectors with the mean and standard deviation values of the inputs and target variables on all instances. The size of this vector is four. The subvectors are:

  • Input variables mean.
  • Input variables standard deviation.
  • Target variables mean.
  • Target variables standard deviation.

Definition at line 2141 of file data_set.cpp.

Vector< Vector< double > > OpenNN::DataSet::calculate_inputs_targets_statistics ( void   )  const

This method returns a vector of vectors with some basic statistics of the inputs and target variables on all instances. The size of this vector is eight. The subvectors are:

  • Input variables mean.
  • Input variables standard deviation.
  • Input variables minimum.
  • Input variables maximum.
  • Target variables mean.
  • Target variables standard deviation.
  • Target variables minimum.
  • Target variables maximum.

Definition at line 2168 of file data_set.cpp.

Vector< double > OpenNN::DataSet::calculate_training_target_data_mean ( void   )  const

This method returns the mean values of the target variables on the training instances.

Definition at line 2203 of file data_set.cpp.

Vector< double > OpenNN::DataSet::calculate_generalization_target_data_mean ( void   )  const

This method returns the mean values of the target variables on the generalization instances.

Definition at line 2217 of file data_set.cpp.

Vector< double > OpenNN::DataSet::calculate_testing_target_data_mean ( void   )  const

This method returns the mean values of the target variables on the testing instances.

Definition at line 2231 of file data_set.cpp.

Matrix< double > OpenNN::DataSet::calculate_variables_correlation ( void   )  const

Todo:

Definition at line 2245 of file data_set.cpp.

Vector< Vector< Vector< double > > > OpenNN::DataSet::calculate_data_histogram ( const unsigned int &  bins_number  )  const

This method returns a histogram for each variable with a given number of bins. The format is a vector of subvectors of subsubvectors. The size of the vector is the number of variables.

Parameters:
bins_number Number of bins.

Definition at line 1868 of file data_set.cpp.

Vector< Vector< Vector< double > > > OpenNN::DataSet::calculate_data_histogram ( void   )  const

This method returns a histogram for each variable with a default number of bins. The format is a vector of subvectors of subsubvectors. The size of the vector is the number of variables.

Definition at line 1880 of file data_set.cpp.

void OpenNN::DataSet::scale_data_minimum_maximum ( const Vector< double > &  minimums,
const Vector< double > &  maximums 
)

This method scales the data matrix with given minimum and maximum values. It updates the data matrix.

Parameters:
minimums Minimum values for all variables.
maximums Maximum values for all variables.

Definition at line 2304 of file data_set.cpp.

void OpenNN::DataSet::scale_data_mean_standard_deviation ( const Vector< double > &  means,
const Vector< double > &  standard_deviations 
)

This method scales the data matrix with given mean and standard deviation values. It updates the data matrix.

Parameters:
means Mean of columns.
standard_deviations Standard deviation of columns.

Definition at line 2260 of file data_set.cpp.

void OpenNN::DataSet::scale_data ( const Vector< Vector< double > > &  statistics  ) 

This method scales the data matrix. The method to be used is that in the scaling and unscaling method variable.

Parameters:
statistics Vector of vectors with the basic statistics.

Definition at line 2349 of file data_set.cpp.

Vector< Vector< double > > OpenNN::DataSet::scale_data ( void   ) 

This method calculates the data statistics, scales the data with that values and returns the statistics. The method to be used is that in the scaling and unscaling method variable.

Definition at line 2391 of file data_set.cpp.

void OpenNN::DataSet::scale_inputs_minimum_maximum ( const Vector< double > &  inputs_minimum,
const Vector< double > &  inputs_maximum 
)

This method scales the input variables with given minimum and maximum values. It updates the input variables of the data matrix.

Parameters:
inputs_minimum Minimum values for the input variables to be used for scaling.
inputs_maximum Maximum values for the input variables to be used for scaling.

Definition at line 2539 of file data_set.cpp.

Vector< Vector< double > > OpenNN::DataSet::scale_inputs_minimum_maximum ( void   ) 

This method scales the input variables with the calculated minimum and maximum values from the data matrix. It updates the input variables of the data matrix. It also returns a vector of vectors with the minimum and maximum values of the input variables.

Definition at line 2581 of file data_set.cpp.

void OpenNN::DataSet::scale_inputs_mean_standard_deviation ( const Vector< double > &  inputs_mean,
const Vector< double > &  inputs_standard_deviation 
)

This method scales the input variables with given mean and standard deviation values. It updates the input variables of the data matrix.

Parameters:
inputs_mean Mean values for the input variables to be used for scaling.
inputs_standard_deviation Standard deviation values for the input variables to be used for scaling.

Definition at line 2439 of file data_set.cpp.

Vector< Vector< double > > OpenNN::DataSet::scale_inputs_mean_standard_deviation ( void   ) 

This method scales the input variables with the calculated mean and standard deviation values from the data matrix. It updates the input variables of the data matrix. It also returns a vector of vectors with the variables statistics.

Definition at line 2519 of file data_set.cpp.

Vector< Vector< double > > OpenNN::DataSet::scale_inputs ( void   ) 

This method calculates the input and target variables statistics. Then it scales the input variables with that values. The method to be used is that in the scaling and unscaling method variable. Finally, it returns the statistics.

Definition at line 2601 of file data_set.cpp.

void OpenNN::DataSet::scale_targets_minimum_maximum ( const Vector< double > &  targets_minimum,
const Vector< double > &  targets_maximum 
)

This method scales the target variables with given minimum and maximum values. It updates the target variables of the data matrix.

Parameters:
targets_minimum Minimum values for the target variables to be used for scaling.
targets_maximum Maximum values for the target variables to be used for scaling.

Definition at line 2747 of file data_set.cpp.

Vector< Vector< double > > OpenNN::DataSet::scale_targets_minimum_maximum ( void   ) 

This method scales the target variables with the calculated minimum and maximum values from the data matrix. It updates the target variables of the data matrix. It also returns a vector of vectors with the statistics of the input target variables.

Definition at line 2794 of file data_set.cpp.

void OpenNN::DataSet::scale_targets_mean_standard_deviation ( const Vector< double > &  targets_mean,
const Vector< double > &  targets_standard_deviation 
)

This method scales the target variables with given mean and standard deviation values. It updates the target variables of the data matrix.

Parameters:
targets_mean Mean values for the target variables to be used for scaling.
targets_standard_deviation Standard deviation values for the target variables to be used for scaling.

Definition at line 2640 of file data_set.cpp.

Vector< Vector< double > > OpenNN::DataSet::scale_targets_mean_standard_deviation ( void   ) 

This method scales the target variables with the calculated mean and standard deviation values from the data matrix. It updates the target variables of the data matrix. It also returns a vector of vectors with the basic statistics of the inputs and target variables.

  • Input data mean.
  • Input data standard deviation.
  • Input data minimum.
  • Input data maximum.
  • Target data mean.
  • Target data standard deviation.
  • Target data minimum.
  • Target data maximum.

Definition at line 2726 of file data_set.cpp.

Vector< Vector< double > > OpenNN::DataSet::scale_targets ( void   ) 

This method calculates the input and target variables statistics. Then it scales the target variables with that values. The method to be used is that in the scaling and unscaling method variable. Finally, it returns the statistics.

Definition at line 2814 of file data_set.cpp.

void OpenNN::DataSet::scale_inputs_targets_minimum_maximum ( const Vector< double > &  inputs_minimums,
const Vector< double > &  inputs_maximums,
const Vector< double > &  targets_minimums,
const Vector< double > &  targets_maximums 
)

This method scales the inputs and the target variables with given minimum and maximum values. Please note that it takes as argument a vector of vectors of all basic statistics, with size eight. It updates the inputs and the target variables of the data matrix.

Parameters:
inputs_minimums Minimum values used for scaling the input variables.
inputs_maximums Maximums values used for scaling the input variables.
targets_minimums Minimum values used for scaling the target variables.
targets_maximums Maximum values used for scaling the target variables.

Definition at line 2906 of file data_set.cpp.

Vector< Vector< double > > OpenNN::DataSet::scale_inputs_targets_minimum_maximum ( void   ) 

This method scales the input and the target variables with the minumum and maximum values calculated from the data matrix. It updates the inputs and target variables of the data. It also returns the vector of vectors containing the computed statistics of the data set:

  • Input variables mean.
  • Input variables standard deviation.
  • Input variables minimum.
  • Input variables maximum.
  • Target variables mean.
  • Target variables standard deviation.
  • Target variables minimum.
  • Target variables maximum.

Definition at line 2929 of file data_set.cpp.

void OpenNN::DataSet::scale_inputs_targets_mean_standard_deviation ( const Vector< double > &  inputs_means,
const Vector< double > &  inputs_standard_deviations,
const Vector< double > &  targets_means,
const Vector< double > &  targets_standard_deviations 
)

This method scales the inputs and the target variables with given mean and standard deviation values. Please note that it takes as argument a vector of vectors of all basic statistics, with size eight. It updates the inputs and the target variables of the data matrix.

Parameters:
inputs_means Mean values used for scaling the input variables.
inputs_standard_deviations Standard deviation values used for scaling the input variables.
targets_means Mean values used for scaling the target variables.
targets_standard_deviations Standard deviation values used for scaling the target variables.

Definition at line 2855 of file data_set.cpp.

Vector< Vector< double > > OpenNN::DataSet::scale_inputs_targets_mean_standard_deviation ( void   ) 

This method scales the inputs and the target variables with the mean and standard deviation values calculated from the data matrix. It updates the inputs and target variables of the data. It also returns the vector of vectors containing the computed statistics of the data set:

  • Input variables mean.
  • Input variables standard deviation.
  • Input variables minimum.
  • Input variables maximum.
  • Target variables mean.
  • Target variables standard deviation.
  • Target variables minimum.
  • Target variables maximum.

Definition at line 2880 of file data_set.cpp.

Vector< Vector< double > > OpenNN::DataSet::scale_inputs_targets ( void   ) 

This method calculates the input and target variables statistics. Then it scales the data with that values. The method to be used is that in the scaling and unscaling method variable. Finally, it returns the statistics.

Definition at line 2952 of file data_set.cpp.

void OpenNN::DataSet::unscale_data_minimum_maximum ( const Vector< double > &  minimum,
const Vector< double > &  maximum 
)

This method unscales the data matrix with given minimum and maximum values. It updates the data matrix.

Parameters:
minimum Minimum of variables.
maximum Maximum of variables.

Definition at line 3004 of file data_set.cpp.

void OpenNN::DataSet::unscale_data_mean_standard_deviation ( const Vector< double > &  mean,
const Vector< double > &  standard_deviation 
)

This method unscales the data matrix with given mean and standard deviation values. It updates the data matrix.

Parameters:
mean Mean of variables.
standard_deviation Standard deviation of variables.

Definition at line 2990 of file data_set.cpp.

void OpenNN::DataSet::unscale_inputs_minimum_maximum ( const Vector< double > &  inputs_minimum,
const Vector< double > &  inputs_maximum 
)

This method unscales the input variables with given minimum and maximum values. It updates the input variables of the data matrix.

Parameters:
inputs_minimum Minimum values for the input variables to be used for unscaling.
inputs_maximum Maximum values for the input variables to be used for unscaling.

Definition at line 3058 of file data_set.cpp.

void OpenNN::DataSet::unscale_inputs_mean_standard_deviation ( const Vector< double > &  inputs_mean,
const Vector< double > &  inputs_standard_deviation 
)

This method unscales the input variables with given mean and standard deviation values. It updates the input variables of the data matrix.

Parameters:
inputs_mean Mean values for the input variables to be used for unscaling.
inputs_standard_deviation Standard deviation values for the input variables to be used for unscaling.

Definition at line 3017 of file data_set.cpp.

void OpenNN::DataSet::unscale_targets_minimum_maximum ( const Vector< double > &  targets_minimum,
const Vector< double > &  targets_maximum 
)

This method unscales the target variables with given minimum and maximum values. It updates the target variables of the data matrix.

Parameters:
targets_minimum Minimum values for the target variables to be used for unscaling.
targets_maximum Maximum values for the target variables to be used for unscaling.

Definition at line 3139 of file data_set.cpp.

void OpenNN::DataSet::unscale_targets_mean_standard_deviation ( const Vector< double > &  targets_mean,
const Vector< double > &  targets_standard_deviation 
)

This method unscales the target variables with given mean and standard deviation values. It updates the target variables of the data matrix.

Parameters:
targets_mean Mean values for the target variables to be used for unscaling.
targets_standard_deviation Standard deviation values for the target variables to be used for unscaling.

Definition at line 3098 of file data_set.cpp.

void OpenNN::DataSet::unscale_inputs_targets_minimum_maximum ( const Vector< Vector< double > > &  variables_statistics  ) 

This method unscales the inputs and the target variables with given minimum and maximum values. Please note that it takes as argument a vector of vectors of all basic statistics, with size eight. It updates the inputs and the target variables of the data matrix.

Parameters:
variables_statistics Statistics for the inputs and target variables to be used for unscaling.

Definition at line 3232 of file data_set.cpp.

void OpenNN::DataSet::unscale_inputs_targets_mean_standard_deviation ( const Vector< Vector< double > > &  variables_statistics  ) 

This method unscales the inputs and the target variables with given mean and standard deviation values. Please note that it takes as argument a vector of vectors of all basic statistics, with size eight. It updates the inputs and the target variables of the data matrix.

Parameters:
variables_statistics Statistics for the inputs and target variables to be used for unscaling.

Definition at line 3181 of file data_set.cpp.

Vector< unsigned int > OpenNN::DataSet::calculate_target_class_distribution ( void   )  const

This method returns a vector containing the number of instances of each class in the data set. If the number of target variables is one then the number of classes is two. If the number of target variables is greater than one then the number of classes is equal to the number of target variables.

Definition at line 3552 of file data_set.cpp.

std::string OpenNN::DataSet::to_string ( void   )  const

This method returns a string representation of the current data set object.

Definition at line 3375 of file data_set.cpp.

void OpenNN::DataSet::print ( void   )  const

This method prints to the screen in a XML-type format the members of the data set object.

Definition at line 3392 of file data_set.cpp.

TiXmlElement * OpenNN::DataSet::to_XML ( void   )  const

This method serializes the data set object into a XML element of the TinyXML library.

Definition at line 3285 of file data_set.cpp.

void OpenNN::DataSet::from_XML ( TiXmlElement *  data_set_element  ) 

This method deserializes a TinyXML element into this data set object.

Parameters:
data_set_element Pointer to a XML element containing the member data.

Definition at line 3324 of file data_set.cpp.

void OpenNN::DataSet::save ( const std::string &  filename  )  const

This method saves the members of a data set object to a XML-type file in an XML-type format.

Parameters:
filename Name of data set XML-type file.

Definition at line 3406 of file data_set.cpp.

void OpenNN::DataSet::load ( const std::string &  filename  ) 

This method loads the members of a data set object from a XML-type file:

  • Instances number.
  • Training instances number.
  • Training instances indices.
  • Generalization instances number.
  • Generalization instances indices.
  • Testing instances number.
  • Testing instances indices.
  • Input variables number.
  • Input variables indices.
  • Target variables number.
  • Target variables indices.
  • Input variables name.
  • Target variables name.
  • Input variables description.
  • Target variables description.
  • Display.
  • Data.
Please mind about the file format. This is specified in the User's Guide.
Parameters:
filename Name of data set XML-type file.

Definition at line 3446 of file data_set.cpp.

void OpenNN::DataSet::print_data ( void   )  const

This method prints to the sceen the values of the data matrix.

Definition at line 3484 of file data_set.cpp.

void OpenNN::DataSet::save_data ( const std::string &  filename  )  const

This method saves to a file the values of the data matrix.

Parameters:
filename Name of data file.

Definition at line 3498 of file data_set.cpp.

void OpenNN::DataSet::load_data ( const std::string &  new_data_filename  ) 

This method loads from a file the values of the data matrix. The number of rows must be equal to the number of instances. The number of columns must be equal to the number of variables.

Definition at line 3529 of file data_set.cpp.


The documentation for this class was generated from the following files:

Generated on Sun Aug 26 11:58:16 2012 for OpenNN by  doxygen 1.5.9