OpenNN::FunctionRegressionTesting Class Reference

#include <function_regression_testing.h>

List of all members.

Classes

struct  LinearRegressionAnalysisResults

Public Member Functions

 FunctionRegressionTesting (void)
 FunctionRegressionTesting (NeuralNetwork *)
 FunctionRegressionTesting (DataSet *)
 FunctionRegressionTesting (NeuralNetwork *, DataSet *)
 FunctionRegressionTesting (TiXmlElement *)
virtual ~FunctionRegressionTesting (void)
NeuralNetworkget_neural_network_pointer (void) const
DataSetget_data_set_pointer (void) const
const bool & get_display (void) const
void set_neural_network_pointer (NeuralNetwork *)
void set_data_set_pointer (DataSet *)
void set_display (const bool &)
void set_default (void)
void check (void) const
Vector< Matrix< double > > calculate_scaled_target_output_data (void) const
Vector< Vector< double > > calculate_linear_regression_parameters (void) const
LinearRegressionAnalysisResults perform_linear_regression_analysis (void) const
Vector< Matrix< double > > calculate_error_data (void) const
Vector< Vector< Vector< double > > > calculate_error_data_statistics (void) const
Vector< Vector< Vector< double > > > calculate_error_data_histogram (const unsigned int &) const
Vector< Vector< Vector< double > > > calculate_error_data_histogram (void) const
std::string to_string (void) const
virtual TiXmlElement * to_XML (void) const
virtual void from_XML (TiXmlElement *)


Detailed Description

This class contains methods for testing function regression problems. It includes linear regression analysis or error data analysis.

Definition at line 34 of file function_regression_testing.h.


Constructor & Destructor Documentation

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

Default constructor. It creates a function regression testing object neither associated to a neural network nor to a data set.

Definition at line 36 of file function_regression_testing.cpp.

OpenNN::FunctionRegressionTesting::FunctionRegressionTesting ( NeuralNetwork new_neural_network_pointer  )  [explicit]

Neural network constructor. It creates a function regression testing object associated to a neural network but not to a a data set.

Parameters:
new_neural_network_pointer Pointer to a neural network object.

Definition at line 50 of file function_regression_testing.cpp.

OpenNN::FunctionRegressionTesting::FunctionRegressionTesting ( DataSet new_data_set_pointer  )  [explicit]

Data set constructor. It creates a function regression testing object associated to a data set but not to a neural network.

Parameters:
new_data_set_pointer Pointer to a data set object.

Definition at line 64 of file function_regression_testing.cpp.

OpenNN::FunctionRegressionTesting::FunctionRegressionTesting ( NeuralNetwork new_neural_network_pointer,
DataSet new_data_set_pointer 
) [explicit]

General constructor. It creates a function regression testing object associated to a neural network and a data set objects.

Parameters:
new_neural_network_pointer Pointer to a neural network object.
new_data_set_pointer Pointer to a data set object.

Definition at line 79 of file function_regression_testing.cpp.

OpenNN::FunctionRegressionTesting::FunctionRegressionTesting ( TiXmlElement *  function_regression_testing_element  )  [explicit]

XML constructor. It creates a function regression testing object neither associated to a neural network nor to a data set objects. It also loads the members of this object from a TinyXML element.

Parameters:
function_regression_testing_element XML element which contains the member data.

Definition at line 94 of file function_regression_testing.cpp.

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

Destructor. It does not delete any pointer.

Definition at line 109 of file function_regression_testing.cpp.


Member Function Documentation

NeuralNetwork * OpenNN::FunctionRegressionTesting::get_neural_network_pointer ( void   )  const

This method returns a pointer to the neural network which is to be tested.

Definition at line 118 of file function_regression_testing.cpp.

DataSet * OpenNN::FunctionRegressionTesting::get_data_set_pointer ( void   )  const

This method returns a pointer to the data set object on which the neural network is tested.

Definition at line 128 of file function_regression_testing.cpp.

const bool & OpenNN::FunctionRegressionTesting::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 139 of file function_regression_testing.cpp.

void OpenNN::FunctionRegressionTesting::set_neural_network_pointer ( NeuralNetwork new_neural_network_pointer  ) 

This method sets a new neural network to be tested.

Parameters:
new_neural_network_pointer Pointer to the neural network object to be tested.

Definition at line 150 of file function_regression_testing.cpp.

void OpenNN::FunctionRegressionTesting::set_data_set_pointer ( DataSet new_data_set_pointer  ) 

This method sets a new data set on which the neural network is to be tested.

Parameters:
new_data_set_pointer Pointer to the data set object used for testing.

Definition at line 161 of file function_regression_testing.cpp.

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

This method sets a new display flag.

Parameters:
new_display Flag for displaying messages from this class or not.

Definition at line 172 of file function_regression_testing.cpp.

void OpenNN::FunctionRegressionTesting::set_default ( void   ) 

This method sets the default values from the function regression testing class:

  • Display: True.

Definition at line 185 of file function_regression_testing.cpp.

void OpenNN::FunctionRegressionTesting::check ( void   )  const

This method checks that:

  • The multilayer perceptron pointer is not NULL.
  • The data set pointer is not NULL.

Definition at line 260 of file function_regression_testing.cpp.

Vector< Matrix< double > > OpenNN::FunctionRegressionTesting::calculate_scaled_target_output_data ( void   )  const

This method returns a vector of matrices with number of rows equal to number of testing instances and number of columns equal to two (the targets value and the outputs value).

Definition at line 196 of file function_regression_testing.cpp.

Vector< Vector< double > > OpenNN::FunctionRegressionTesting::calculate_linear_regression_parameters ( void   )  const

This method performs a linear regression analysis between the testing instances in the data set and the corresponding neural network outputs. It returns all the provided parameters in a vector of vectors. The number of elements in the vector is equal to the number of output variables. The size of each element is equal to the number of regression parameters (2). In this way, each subvector contains the regression parameters intercept and slope of an output variable.

Definition at line 293 of file function_regression_testing.cpp.

FunctionRegressionTesting::LinearRegressionAnalysisResults OpenNN::FunctionRegressionTesting::perform_linear_regression_analysis ( void   )  const

This method performs a linear regression analysis of a neural network on the testing indices of a data set. It returns a linear regression analysis results structure, which consists on:

  • Linear regression parameters.
  • Scaled target and output data.

Definition at line 384 of file function_regression_testing.cpp.

Vector< Matrix< double > > OpenNN::FunctionRegressionTesting::calculate_error_data ( void   )  const

This method calculates the errors between the outputs from a neural network and the testing instances in a data set. It returns a vector of tree matrices:

  • Absolute error.
  • Relative error.
  • Percentage error.
The number of rows in each matrix is the number of testing instances in the data set. The number of columns is the number of outputs in the neural network.

Definition at line 425 of file function_regression_testing.cpp.

Vector< Vector< Vector< double > > > OpenNN::FunctionRegressionTesting::calculate_error_data_statistics ( void   )  const

This method calculates the basic statistics on the error data (to do).

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

Definition at line 491 of file function_regression_testing.cpp.

Vector< Vector< Vector< double > > > OpenNN::FunctionRegressionTesting::calculate_error_data_histogram ( const unsigned int &  bins_number  )  const

This method calculates histograms for the relative errors of all the output variables. The number of bins is set by the user.

Parameters:
bins_number Number of bins in the histograms.

Definition at line 505 of file function_regression_testing.cpp.

Vector< Vector< Vector< double > > > OpenNN::FunctionRegressionTesting::calculate_error_data_histogram ( void   )  const

This method calculates histograms for the relative errors of all the output variables. The number of bins is the default (10).

Definition at line 518 of file function_regression_testing.cpp.

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

This method returns a string representation of this function regression testing object.

Definition at line 530 of file function_regression_testing.cpp.

TiXmlElement * OpenNN::FunctionRegressionTesting::to_XML ( void   )  const [virtual]

This method serializes this function regression testing object into a TinyXML element. Please read the OpenNN manual for more information about this.

Todo:

Definition at line 547 of file function_regression_testing.cpp.

void OpenNN::FunctionRegressionTesting::from_XML ( TiXmlElement *   )  [virtual]

This method deserializes a TinyXML element into this function regression testing object.

Todo:

Definition at line 559 of file function_regression_testing.cpp.


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

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