OpenNN  2.2
Open Neural Networks Library
Classes | Public Member Functions | Private Attributes | List of all members
OpenNN::TestingAnalysis Class Reference

#include <testing_analysis.h>

Classes

struct  BinaryClassifcationRates
 
struct  KolmogorovSmirnovResults
 
struct  LinearRegressionResults
 
struct  RocAnalysisResults
 

Public Member Functions

 TestingAnalysis (void)
 
 TestingAnalysis (NeuralNetwork *)
 
 TestingAnalysis (MathematicalModel *)
 
 TestingAnalysis (DataSet *)
 
 TestingAnalysis (NeuralNetwork *, DataSet *)
 
 TestingAnalysis (NeuralNetwork *, MathematicalModel *)
 
 TestingAnalysis (NeuralNetwork *, DataSet *, MathematicalModel *)
 
 TestingAnalysis (const tinyxml2::XMLDocument &)
 
 TestingAnalysis (const std::string &)
 
virtual ~TestingAnalysis (void)
 
NeuralNetworkget_neural_network_pointer (void) const
 
DataSetget_data_set_pointer (void) const
 
MathematicalModelget_mathematical_model_pointer (void) const
 
const bool & get_display (void) const
 
void set_neural_network_pointer (NeuralNetwork *)
 
void set_data_set_pointer (DataSet *)
 
void set_mathematical_model_pointer (MathematicalModel *)
 
void set_display (const bool &)
 
void set_default (void)
 
void check (void) const
 
Vector< Matrix< double > > calculate_target_output_data (void) const
 
Vector< Matrix< double > > calculate_error_data (void) const
 
Vector< Vector< Statistics< double > > > calculate_error_data_statistics (void) const
 
Vector< Matrix< double > > calculate_error_data_statistics_matrices (void) const
 
Vector< Histogram< double > > calculate_error_data_histograms (const size_t &=10) const
 
Vector< Vector< size_t > > calculate_maximal_errors (const size_t &=10) const
 
Vector< double > calculate_testing_errors (void) const
 
Vector< double > calculate_classification_testing_errors (void) const
 
double calculate_testing_normalized_squared_error (const Matrix< double > &, const Matrix< double > &) const
 
double calculate_testing_cross_entropy_error (const Matrix< double > &, const Matrix< double > &) const
 
double calculate_testing_weighted_squared_error (const Matrix< double > &, const Matrix< double > &) const
 
Vector< LinearRegressionParameters< double > > calculate_linear_regression_parameters (void) const
 
LinearRegressionResults perform_linear_regression_analysis (void) const
 
Vector< double > calculate_binary_classification_tests (void) const
 
double calculate_logloss (void) const
 
Matrix< size_t > calculate_confusion_binary_classification (const Matrix< double > &, const Matrix< double > &, const double &) const
 
Matrix< size_t > calculate_confusion_multiple_classification (const Matrix< double > &, const Matrix< double > &) const
 
Vector< size_t > calculate_positives_negatives_rate (const Matrix< double > &, const Matrix< double > &) const
 
Matrix< size_t > calculate_confusion (void) const
 
RocAnalysisResults perform_roc_analysis (void) const
 
double calculate_Wilcoxon_parameter (const double &, const double &) const
 
Matrix< double > calculate_roc_curve (const Matrix< double > &, const Matrix< double > &) const
 
double calculate_area_under_curve (const Matrix< double > &, const Matrix< double > &) const
 
double calculate_optimal_threshold (const Matrix< double > &, const Matrix< double > &) const
 
double calculate_optimal_threshold (const Matrix< double > &, const Matrix< double > &, const Matrix< double > &) const
 
Matrix< double > perform_cumulative_gain_analysis (void) const
 
Matrix< double > calculate_cumulative_gain (const Matrix< double > &, const Matrix< double > &) const
 
Matrix< double > calculate_negative_cumulative_gain (const Matrix< double > &, const Matrix< double > &) const
 
Matrix< double > perform_lift_chart_analysis (void) const
 
Matrix< double > calculate_lift_chart (const Matrix< double > &) const
 
KolmogorovSmirnovResults perform_Kolmogorov_Smirnov_analysis (void) const
 
Vector< double > calculate_maximum_gain (const Matrix< double > &, const Matrix< double > &) const
 
Matrix< double > perform_calibration_plot_analysis (void) const
 
Matrix< double > calculate_calibration_plot (const Matrix< double > &, const Matrix< double > &) const
 
Vector< Histogram< double > > calculate_output_histogram (const Matrix< double > &, const size_t &=10) const
 
BinaryClassifcationRates calculate_binary_classification_rates (void) const
 
Vector< size_t > calculate_true_positive_instances (const Matrix< double > &, const Matrix< double > &, const Vector< size_t > &, const double &) const
 
Vector< size_t > calculate_false_positive_instances (const Matrix< double > &, const Matrix< double > &, const Vector< size_t > &, const double &) const
 
Vector< size_t > calculate_false_negative_instances (const Matrix< double > &, const Matrix< double > &, const Vector< size_t > &, const double &) const
 
Vector< size_t > calculate_true_negative_instances (const Matrix< double > &, const Matrix< double > &, const Vector< size_t > &, const double &) const
 
Matrix< Vector< size_t > > calculate_multiple_classification_rates (void) const
 
Matrix< Vector< size_t > > calculate_multiple_classification_rates (const Matrix< double > &, const Matrix< double > &, const Vector< size_t > &) const
 
Vector< Vector< double > > calculate_error_autocorrelation (const size_t &=10) const
 
Vector< Vector< double > > calculate_input_error_cross_correlation (const size_t &=10) const
 
std::string to_string (void) const
 
void print (void) const
 
virtual tinyxml2::XMLDocument * to_XML (void) const
 
virtual void from_XML (const tinyxml2::XMLDocument &)
 
virtual void write_XML (tinyxml2::XMLPrinter &) const
 
void save (const std::string &) const
 
void load (const std::string &)
 

Private Attributes

NeuralNetworkneural_network_pointer
 
DataSetdata_set_pointer
 
MathematicalModelmathematical_model_pointer
 
bool display
 

Detailed Description

This class contains tools for testing neural networks in different learning tasks. In particular, it can be used for testing function regression, classification or time series prediction problems.

Definition at line 42 of file testing_analysis.h.

Constructor & Destructor Documentation

◆ TestingAnalysis() [1/9]

OpenNN::TestingAnalysis::TestingAnalysis ( void  )
explicit

Default constructor. It creates a testing analysis object neither associated to a neural network nor to a mathematical model or a data set. By default, it constructs the function regression testing object.

Definition at line 27 of file testing_analysis.cpp.

◆ TestingAnalysis() [2/9]

OpenNN::TestingAnalysis::TestingAnalysis ( NeuralNetwork new_neural_network_pointer)
explicit

Neural network constructor. It creates a testing analysis object associated to a neural network but not to a mathematical model or a data set. By default, it constructs the function regression testing object.

Parameters
new_neural_network_pointerPointer to a neural network object.

Definition at line 43 of file testing_analysis.cpp.

◆ TestingAnalysis() [3/9]

OpenNN::TestingAnalysis::TestingAnalysis ( MathematicalModel new_mathematical_model_pointer)
explicit

Mathematical mmodel constructor. It creates a testing analysis object not associated to a neural network, not associated to a data set, and associated to a mathematical model. By default, it constructs the inverse problem testing object.

Parameters
new_mathematical_model_pointerPointer to a mathematical model object.

Definition at line 59 of file testing_analysis.cpp.

◆ TestingAnalysis() [4/9]

OpenNN::TestingAnalysis::TestingAnalysis ( DataSet new_data_set_pointer)
explicit

Data set constructor. It creates a testing analysis object not associated to a neural network, associated to a data set and not associated to a mathematical model. By default, it constructs the function regression testing object.

Parameters
new_data_set_pointerPointer to a data set object.

Definition at line 75 of file testing_analysis.cpp.

◆ TestingAnalysis() [5/9]

OpenNN::TestingAnalysis::TestingAnalysis ( NeuralNetwork new_neural_network_pointer,
DataSet new_data_set_pointer 
)
explicit

Neural network and data set constructor. It creates a testing analysis object associated to a neural network and to a data set. By default, it constructs the function regression testing object.

Parameters
new_neural_network_pointerPointer to a neural network object.
new_data_set_pointerPointer to a data set object.

Definition at line 109 of file testing_analysis.cpp.

◆ TestingAnalysis() [6/9]

OpenNN::TestingAnalysis::TestingAnalysis ( NeuralNetwork new_neural_network_pointer,
MathematicalModel new_mathematical_model_pointer 
)
explicit

Neural network and mathematical model constructor. It creates a testing analysis object associated to a neural network and to a mathematical model, but not to a data set. By default, it constructs the inverse problem testing object.

Parameters
new_neural_network_pointerPointer to a neural network object.
new_mathematical_model_pointerPointer to a mathematical model object.

Definition at line 92 of file testing_analysis.cpp.

◆ TestingAnalysis() [7/9]

OpenNN::TestingAnalysis::TestingAnalysis ( NeuralNetwork new_neural_network_pointer,
DataSet new_data_set_pointer,
MathematicalModel new_mathematical_model_pointer 
)
explicit

Neural network, mathematical model and data set constructor. It creates a testing analysis object associated to a neural network, a mathematical model and a data set. By default, it constructs the inverse problem testing object.

Parameters
new_neural_network_pointerPointer to a neural network object.
new_mathematical_model_pointerPointer to a mathematical model object.
new_data_set_pointerPointer to a data set object.

Definition at line 127 of file testing_analysis.cpp.

◆ TestingAnalysis() [8/9]

OpenNN::TestingAnalysis::TestingAnalysis ( const tinyxml2::XMLDocument &  testing_analysis_document)
explicit

XML constructor. It creates a testing analysis object neither associated to a neural network nor to a mathematical model or a data set. It also loads the members of this object from a TinyXML document.

Parameters
testing_analysis_documentXML document containing the member data.

Definition at line 143 of file testing_analysis.cpp.

◆ TestingAnalysis() [9/9]

OpenNN::TestingAnalysis::TestingAnalysis ( const std::string &  file_name)
explicit

File constructor. It creates a testing analysis object neither associated to a neural network nor to a mathematical model or a data set. It also loads the members of this object from XML file.

Parameters
file_nameName of testing analysis XML file.

Definition at line 161 of file testing_analysis.cpp.

◆ ~TestingAnalysis()

OpenNN::TestingAnalysis::~TestingAnalysis ( void  )
virtual

Destructor. It deletes the function regression testing, classification testing, time series prediction testing and inverse problem testing objects.

Definition at line 176 of file testing_analysis.cpp.

Member Function Documentation

◆ calculate_area_under_curve()

double OpenNN::TestingAnalysis::calculate_area_under_curve ( const Matrix< double > &  target_data,
const Matrix< double > &  output_data 
) const

Returns the area under a ROC curve.

Parameters
target_dataTesting target data.
output_dataTesting output data.

Definition at line 1467 of file testing_analysis.cpp.

◆ calculate_binary_classification_rates()

TestingAnalysis::BinaryClassifcationRates OpenNN::TestingAnalysis::calculate_binary_classification_rates ( void  ) const

Returns a structure with the binary classification rates, which has the indices of the true positive, false negative, false positive and true negative instances.

  • True positive instances
  • False positive instances
  • False negative instances
  • True negative instances

Definition at line 2297 of file testing_analysis.cpp.

◆ calculate_binary_classification_tests()

Vector< double > OpenNN::TestingAnalysis::calculate_binary_classification_tests ( void  ) const

Returns the results of a binary classification test in a single vector. The size of that vector is fifteen. The elements are:

  • Classification accuracy
  • Error rate
  • Sensitivity
  • Specificity
  • Precision
  • Positive likelihood
  • Negative likelihood
  • F1 score
  • False positive rate
  • False discovery rate
  • False negative rate
  • Negative predictive value
  • Matthews correlation coefficient
  • Informedness
  • Markedness

Definition at line 2796 of file testing_analysis.cpp.

◆ calculate_calibration_plot()

Matrix< double > OpenNN::TestingAnalysis::calculate_calibration_plot ( const Matrix< double > &  target_data,
const Matrix< double > &  output_data 
) const

Returns a matix with the values of a calibration plot. Number of columns is two. Number of rows varies depending on the distribution of positive targets.

Parameters
target_dataTesting target data.
output_dataTesting output data.

Definition at line 2182 of file testing_analysis.cpp.

◆ calculate_classification_testing_errors()

Vector< double > OpenNN::TestingAnalysis::calculate_classification_testing_errors ( void  ) const

Returns a vector containing the values of the errors between the outputs of the neural network and the targets for a classification problem. The vector consists of:

  • Sum squared error.
  • Mean squared error.
  • Root mean squared error.
  • Normalized squared error.
  • Cross-entropy error.

Definition at line 826 of file testing_analysis.cpp.

◆ calculate_confusion()

Matrix< size_t > OpenNN::TestingAnalysis::calculate_confusion ( void  ) const

Returns the confusion matrix of a neural network on the testing instances of a data set. If the number of outputs is one, the size of the confusion matrix is two. If the number of outputs is greater than one, the size of the confusion matrix is the number of outputs.

Definition at line 1149 of file testing_analysis.cpp.

◆ calculate_confusion_binary_classification()

Matrix< size_t > OpenNN::TestingAnalysis::calculate_confusion_binary_classification ( const Matrix< double > &  target_data,
const Matrix< double > &  output_data,
const double &  decision_threshold 
) const

Returns the confusion matrix for a binary classification problem.

Parameters
target_dataTesting target data.
output_dataTesting output data.
decision_thresholdDecision threshold.

Definition at line 1020 of file testing_analysis.cpp.

◆ calculate_confusion_multiple_classification()

Matrix< size_t > OpenNN::TestingAnalysis::calculate_confusion_multiple_classification ( const Matrix< double > &  target_data,
const Matrix< double > &  output_data 
) const

Returns the confusion matrix for a binary classification problem.

Parameters
target_dataTesting target data.
output_dataTesting output data.

Definition at line 1099 of file testing_analysis.cpp.

◆ calculate_cumulative_gain()

Matrix< double > OpenNN::TestingAnalysis::calculate_cumulative_gain ( const Matrix< double > &  target_data,
const Matrix< double > &  output_data 
) const

Returns a matrix with the values of a cumulative gain chart. The number of columns is two, the number of rows is 20.

Parameters
target_dataTesting target data.
output_dataTesting output data.

Definition at line 1733 of file testing_analysis.cpp.

◆ calculate_error_autocorrelation()

Vector< Vector< double > > OpenNN::TestingAnalysis::calculate_error_autocorrelation ( const size_t &  maximum_lags_number = 10) const

Calculates error autocorrelation across varying lags. Returns a vector of subvectors. The size of the vector is the number of targets. The size of the subvectors is the number of lags for which autocorrelation is calculated.

Parameters
maximum_lags_numberNumber of lags for which error autocorrelation is to be calculated.

Definition at line 2603 of file testing_analysis.cpp.

◆ calculate_error_data()

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

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 545 of file testing_analysis.cpp.

◆ calculate_error_data_histograms()

Vector< Histogram< double > > OpenNN::TestingAnalysis::calculate_error_data_histograms ( const size_t &  bins_number = 10) const

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

Parameters
bins_numberNumber of bins in the histograms.

Definition at line 702 of file testing_analysis.cpp.

◆ calculate_error_data_statistics()

Vector< Vector< Statistics< double > > > OpenNN::TestingAnalysis::calculate_error_data_statistics ( void  ) const

Calculates the basic statistics on the error data.

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

Definition at line 646 of file testing_analysis.cpp.

◆ calculate_error_data_statistics_matrices()

Vector< Matrix< double > > OpenNN::TestingAnalysis::calculate_error_data_statistics_matrices ( void  ) const

Returns a vector of matrices with the statistics of the errors between the neural network outputs and the testing targets in the data set. The size of the vector is the number of output variables. The number of rows in each submatrix is three (absolute, relative and percentage errors). The number of columns in each submatrix is four (minimum, maximum, mean and standard deviation).

Definition at line 676 of file testing_analysis.cpp.

◆ calculate_false_negative_instances()

Vector< size_t > OpenNN::TestingAnalysis::calculate_false_negative_instances ( const Matrix< double > &  target_data,
const Matrix< double > &  output_data,
const Vector< size_t > &  testing_indices,
const double &  decision_threshold 
) const

Returns a vector with the indices of the false negative instances. The size of the vector is the number of false negative instances.

Parameters
target_dataTesting target data.
output_dataTesting output data.
testing_indicesIndices of the testing data
decision_thresholdDecision threshold.

Definition at line 2448 of file testing_analysis.cpp.

◆ calculate_false_positive_instances()

Vector< size_t > OpenNN::TestingAnalysis::calculate_false_positive_instances ( const Matrix< double > &  target_data,
const Matrix< double > &  output_data,
const Vector< size_t > &  testing_indices,
const double &  decision_threshold 
) const

Returns a vector with the indices of the false positive instances. The size of the vector is the number of false positive instances.

Parameters
target_dataTesting target data.
output_dataTesting output data.
testing_indicesIndices of the testing data
decision_thresholdDecision threshold.

Definition at line 2421 of file testing_analysis.cpp.

◆ calculate_input_error_cross_correlation()

Vector< Vector< double > > OpenNN::TestingAnalysis::calculate_input_error_cross_correlation ( const size_t &  maximum_lags_number = 10) const

Calculates the correlation between input and error. Returns a vector of subvectors. The size of the vector is the number of targets. The size of the subvectors is the number of lags for which cross-correlation is calculated.

Parameters
maximum_lags_numberNumber of lags for which cross-correlation is calculated.

Definition at line 2690 of file testing_analysis.cpp.

◆ calculate_lift_chart()

Matrix< double > OpenNN::TestingAnalysis::calculate_lift_chart ( const Matrix< double > &  cumulative_gain) const

Returns a matrix with the values of lift chart for a given cumulative gain chart. Size is the same as the cumulative lift chart one.

Parameters
cumulative_gainA cumulative gain chart.

Definition at line 1946 of file testing_analysis.cpp.

◆ calculate_linear_regression_parameters()

Vector< LinearRegressionParameters< double > > OpenNN::TestingAnalysis::calculate_linear_regression_parameters ( void  ) const

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 419 of file testing_analysis.cpp.

◆ calculate_maximal_errors()

Vector< Vector< size_t > > OpenNN::TestingAnalysis::calculate_maximal_errors ( const size_t &  instances_number = 10) const

Returns a vector with the indices of the instances which have the greatest error.

Parameters
instances_numberSize of the vector to be returned.
Todo:
Finish the method.

Definition at line 725 of file testing_analysis.cpp.

◆ calculate_maximum_gain()

Vector< double > OpenNN::TestingAnalysis::calculate_maximum_gain ( const Matrix< double > &  positive_cumulative_gain,
const Matrix< double > &  negative_cumulative_gain 
) const

Returns the score of the the maximum gain, which is the point of major separation between the positive and the negative cumulative gain charts, and the instances ratio for which it occurs.

Parameters
positive_cumulative_gainCumulative gain fo the positive instances.
negative_cumulative_gainCumulative gain fo the negative instances.

Definition at line 2060 of file testing_analysis.cpp.

◆ calculate_multiple_classification_rates()

Matrix< Vector< size_t > > OpenNN::TestingAnalysis::calculate_multiple_classification_rates ( const Matrix< double > &  target_data,
const Matrix< double > &  output_data,
const Vector< size_t > &  testing_indices 
) const

Returns a matrix of subvectors which have the rates for a multiple classification problem. The number of rows of the matrix is the number targets. The number of columns of the matrix is the number of columns of the target data.

Definition at line 2573 of file testing_analysis.cpp.

◆ calculate_negative_cumulative_gain()

Matrix< double > OpenNN::TestingAnalysis::calculate_negative_cumulative_gain ( const Matrix< double > &  target_data,
const Matrix< double > &  output_data 
) const

Returns a matrix with the values of a cumulative gain chart for the negative instances. The number of columns is two, the number of rows is 20.

Parameters
target_dataTesting target data.
output_dataTesting output data.

Definition at line 1803 of file testing_analysis.cpp.

◆ calculate_optimal_threshold() [1/2]

double OpenNN::TestingAnalysis::calculate_optimal_threshold ( const Matrix< double > &  target_data,
const Matrix< double > &  output_data 
) const

Returns the point of optimal classification accuracy, which is the nearest ROC curve point to the upper left corner (0,1).

Parameters
target_dataTesting target data.
output_dataTesting output data.

Definition at line 1532 of file testing_analysis.cpp.

◆ calculate_optimal_threshold() [2/2]

double OpenNN::TestingAnalysis::calculate_optimal_threshold ( const Matrix< double > &  target_data,
const Matrix< double > &  output_data,
const Matrix< double > &  roc_curve 
) const

Returns the point of optimal classification accuracy, which is the nearest ROC curve point to the upper left corner (0,1).

Parameters
target_dataTesting target data.
output_dataTesting output data.
roc_curveROC curve.

Definition at line 1599 of file testing_analysis.cpp.

◆ calculate_output_histogram()

Vector< Histogram< double > > OpenNN::TestingAnalysis::calculate_output_histogram ( const Matrix< double > &  output_data,
const size_t &  bins_number = 10 
) const

Returns the histogram of the outputs.

Parameters
output_dataTesting output data.
bins_numberNumber of bins of the histogram.

Definition at line 2277 of file testing_analysis.cpp.

◆ calculate_positives_negatives_rate()

Vector< size_t > OpenNN::TestingAnalysis::calculate_positives_negatives_rate ( const Matrix< double > &  target_data,
const Matrix< double > &  output_data 
) const

Returns a vector containing the number of total positives and the number of total negatives instances of a data set. The size of the vector is two and consists of:

  • Total positives
  • Total negatives

Definition at line 1131 of file testing_analysis.cpp.

◆ calculate_roc_curve()

Matrix< double > OpenNN::TestingAnalysis::calculate_roc_curve ( const Matrix< double > &  target_data,
const Matrix< double > &  output_data 
) const

Returns a matrix with the values of a ROC curve for a binary classification problem. The number of columns is three. The third column contains the decision threshold. The number of rows is one more than the number of outputs if the number of outputs is lower than 100 or 50 in other case.

Parameters
target_dataTesting target data.
output_dataTesting output data.

Definition at line 1354 of file testing_analysis.cpp.

◆ calculate_target_output_data()

Vector< Matrix< double > > OpenNN::TestingAnalysis::calculate_target_output_data ( void  ) const

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 365 of file testing_analysis.cpp.

◆ calculate_testing_cross_entropy_error()

double OpenNN::TestingAnalysis::calculate_testing_cross_entropy_error ( const Matrix< double > &  target_data,
const Matrix< double > &  output_data 
) const

Returns the cross-entropy error between the targets and the outputs of the neural network. It can only be computed for classification problems.

Parameters
target_dataTesting target data.
output_dataTesting output data.

Definition at line 908 of file testing_analysis.cpp.

◆ calculate_testing_errors()

Vector< double > OpenNN::TestingAnalysis::calculate_testing_errors ( void  ) const

Returns a vector containing the values of the errors between the outputs of the neural network and the targets. The vector consists of:

  • Sum squared error.
  • Mean squared error.
  • Root mean squared error.
  • Normalized squared error.

Definition at line 753 of file testing_analysis.cpp.

◆ calculate_testing_normalized_squared_error()

double OpenNN::TestingAnalysis::calculate_testing_normalized_squared_error ( const Matrix< double > &  target_data,
const Matrix< double > &  output_data 
) const

Returns the normalized squared error between the targets and the outputs of the neural network.

Parameters
target_dataTesting target data.
output_dataTesting output data.

Definition at line 881 of file testing_analysis.cpp.

◆ calculate_testing_weighted_squared_error()

double OpenNN::TestingAnalysis::calculate_testing_weighted_squared_error ( const Matrix< double > &  target_data,
const Matrix< double > &  output_data 
) const

Returns the weighted squared error between the targets and the outputs of the neural network. It can only be computed for binary classification problems.

Parameters
target_dataTesting target data.
output_dataTesting output data.

Definition at line 949 of file testing_analysis.cpp.

◆ calculate_true_negative_instances()

Vector< size_t > OpenNN::TestingAnalysis::calculate_true_negative_instances ( const Matrix< double > &  target_data,
const Matrix< double > &  output_data,
const Vector< size_t > &  testing_indices,
const double &  decision_threshold 
) const

Returns a vector with the indices of the true negative instances. The size of the vector is the number of true negative instances.

Parameters
target_dataTesting target data.
output_dataTestinga output data.
testing_indicesIndices of the testing data
decision_thresholdDecision threshold.

Definition at line 2475 of file testing_analysis.cpp.

◆ calculate_true_positive_instances()

Vector< size_t > OpenNN::TestingAnalysis::calculate_true_positive_instances ( const Matrix< double > &  target_data,
const Matrix< double > &  output_data,
const Vector< size_t > &  testing_indices,
const double &  decision_threshold 
) const

Returns a vector with the indices of the true positive instances. The size of the vector is the number of true positive instances.

Parameters
target_dataTesting target data.
output_dataTesting output_data.
testing_indicesIndices of testing data.
decision_thresholdDecision threshold.

Definition at line 2394 of file testing_analysis.cpp.

◆ calculate_Wilcoxon_parameter()

double OpenNN::TestingAnalysis::calculate_Wilcoxon_parameter ( const double &  x,
const double &  y 
) const

Calculates the Wilcoxon parameter, which is used for calculating the area under a ROC curve. Returns 1 if first value is greater than second one, 0 if second value is greater than first one or 0.5 in other case.

Parameters
xTarget data value.
yTarget data value.

Definition at line 1328 of file testing_analysis.cpp.

◆ check()

void OpenNN::TestingAnalysis::check ( void  ) const

Checks that:

  • The neural network pointer is not NULL.
  • The data set pointer is not NULL.

Definition at line 336 of file testing_analysis.cpp.

◆ from_XML()

void OpenNN::TestingAnalysis::from_XML ( const tinyxml2::XMLDocument &  document)
virtual

Deserializes a TinyXML document into this testing analysis object.

Parameters
documentXML document containing the member data.

Definition at line 3254 of file testing_analysis.cpp.

◆ get_display()

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

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 263 of file testing_analysis.cpp.

◆ load()

void OpenNN::TestingAnalysis::load ( const std::string &  file_name)

Loads from a XML file the members for this testing analysis object.

Parameters
file_nameName of testing analysis XML file.

Definition at line 3309 of file testing_analysis.cpp.

◆ perform_cumulative_gain_analysis()

Matrix< double > OpenNN::TestingAnalysis::perform_cumulative_gain_analysis ( void  ) const

Performs a cumulative gain analysis. Returns a matrix with the values of a cumulative gain chart.

Definition at line 1656 of file testing_analysis.cpp.

◆ perform_Kolmogorov_Smirnov_analysis()

TestingAnalysis::KolmogorovSmirnovResults OpenNN::TestingAnalysis::perform_Kolmogorov_Smirnov_analysis ( void  ) const

Performs a Kolmogorov-Smirnov analysis, which consists of the cumulative gain for the positive instances and the cumulative gain for the negative instances. It returns a Kolmogorov-Smirnov results structure, which consists of:

  • Positive cumulative gain
  • Negative cumulative gain
  • Maximum gain

Definition at line 1978 of file testing_analysis.cpp.

◆ perform_lift_chart_analysis()

Matrix< double > OpenNN::TestingAnalysis::perform_lift_chart_analysis ( void  ) const

Performs a lift chart analysis. Returns a matrix with the values of a lift chart.

Definition at line 1869 of file testing_analysis.cpp.

◆ perform_linear_regression_analysis()

TestingAnalysis::LinearRegressionResults OpenNN::TestingAnalysis::perform_linear_regression_analysis ( void  ) const

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 of:

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

Definition at line 488 of file testing_analysis.cpp.

◆ perform_roc_analysis()

TestingAnalysis::RocAnalysisResults OpenNN::TestingAnalysis::perform_roc_analysis ( void  ) const

Performs a ROC curve analysis. It returns a ROC curve analysis results structure, which consists of:

  • ROC curve
  • Area under the ROC curve
  • Optimal threshold

Definition at line 1247 of file testing_analysis.cpp.

◆ save()

void OpenNN::TestingAnalysis::save ( const std::string &  file_name) const

Saves to a XML file the members of this testing analysis object.

Parameters
file_nameName of testing analysis XML file.

Definition at line 3294 of file testing_analysis.cpp.

◆ set_data_set_pointer()

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

Sets a new data set to be used for validating the quality of a trained neural network.

Parameters
new_data_set_pointerPointer to a data set object.

Definition at line 309 of file testing_analysis.cpp.

◆ set_default()

void OpenNN::TestingAnalysis::set_default ( void  )

Sets some default values to the testing analysis object:

  • Display: True.

Definition at line 276 of file testing_analysis.cpp.

◆ set_display()

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

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_displayDisplay value.

Definition at line 322 of file testing_analysis.cpp.

◆ set_mathematical_model_pointer()

void OpenNN::TestingAnalysis::set_mathematical_model_pointer ( MathematicalModel new_mathematical_model_pointer)

Sets a mathematical model to be used for validating the quality of a trained neural network.

Parameters
new_mathematical_model_pointerPointer to a mathematical model object.

Definition at line 298 of file testing_analysis.cpp.

◆ set_neural_network_pointer()

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

Sets a new neural network object to be tested.

Parameters
new_neural_network_pointerPointer to a neural network object.

Definition at line 287 of file testing_analysis.cpp.

◆ to_XML()

tinyxml2::XMLDocument * OpenNN::TestingAnalysis::to_XML ( void  ) const
virtual

Serializes the testing analysis object into a XML document of the TinyXML library. See the OpenNN manual for more information about the format of this element.

Definition at line 3196 of file testing_analysis.cpp.

◆ write_XML()

void OpenNN::TestingAnalysis::write_XML ( tinyxml2::XMLPrinter &  file_stream) const
virtual

Serializes the testing analysis object into a XML document of the TinyXML library without keep the DOM tree in memory. See the OpenNN manual for more information about the format of this document.

Definition at line 3228 of file testing_analysis.cpp.


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