OpenNN  2.2
Open Neural Networks Library
testing_analysis.h
1 /****************************************************************************************************************/
2 /* */
3 /* OpenNN: Open Neural Networks Library */
4 /* www.artelnics.com/opennn */
5 /* */
6 /* T E S T I N G A N A L Y S I S C L A S S H E A D E R */
7 /* */
8 /* Roberto Lopez */
9 /* Artelnics - Making intelligent use of data */
11 /* */
12 /****************************************************************************************************************/
13 
14 #ifndef __TESTINGANALYSIS_H__
15 #define __TESTINGANALYSIS_H__
16 
17 // System includes
18 
19 #include <iostream>
20 #include <fstream>
21 #include <string>
22 #include <sstream>
23 #include <cmath>
24 
25 // OpenNN includes
26 
27 #include "vector.h"
28 #include "matrix.h"
29 
30 #include "data_set.h"
31 #include "mathematical_model.h"
32 
33 #include "neural_network.h"
34 
35 namespace OpenNN
36 {
37 
41 
43 {
44 
45 public:
46 
47  // DEFAULT CONSTRUCTOR
48 
49  explicit TestingAnalysis(void);
50 
51  // NEURAL NETWORK CONSTRUCTOR
52 
53  explicit TestingAnalysis(NeuralNetwork*);
54 
55  // MATHEMATICAL MODEL CONSTRUCTOR
56 
58 
59  // DATA SET CONSTRUCTOR
60 
61  explicit TestingAnalysis(DataSet*);
62 
63  // NEURAL NETWORK AND DATA SET CONSTRUCTOR
64 
66 
67  // NEURAL NETWORK AND MATHEMATICAL MODEL CONSTRUCTOR
68 
70 
71  // NEURAL NETWORK, DATA SET AND MATHEMATICAL MODEL CONSTRUCTOR
72 
74 
75  // XML CONSTRUCTOR
76 
77  explicit TestingAnalysis(const tinyxml2::XMLDocument&);
78 
79  // FILE CONSTRUCTOR
80 
81  explicit TestingAnalysis(const std::string&);
82 
83 
84  // DESTRUCTOR
85 
86  virtual ~TestingAnalysis(void);
87 
88  // STRUCTURES
89 
93 
95  {
97 
99 
101 
103 
104  void save(const std::string&) const;
105  };
106 
107  // METHODS
108 
109  // Get methods
110 
112  DataSet* get_data_set_pointer(void) const;
114 
115  const bool& get_display(void) const;
116 
117  // Set methods
118 
122 
123  void set_display(const bool&);
124 
125  void set_default(void);
126 
127  // Checking methods
128 
129  void check(void) const;
130 
131  // Target and output data methods
132 
134 
135  // Error data methods
136 
138 
141 
143 
144  Vector< Vector<size_t> > calculate_maximal_errors(const size_t& = 10) const;
145 
146  // Linear regression analysis methods
147 
149 
151 
152  // Binary classifcation methods
153 
155 
156  // Confusion methods
157 
160 
162 
163  // Serialization methods
164 
165  std::string to_string(void) const;
166 
167  void print(void) const;
168 
169  virtual tinyxml2::XMLDocument* to_XML(void) const;
170  virtual void from_XML(const tinyxml2::XMLDocument&);
171 
172  void save(const std::string&) const;
173  void load(const std::string&);
174 
175 
176 private:
177 
178  // MEMBERS
179 
181 
183 
185 
187 
189 
191 
193 
194  bool display;
195 };
196 
197 }
198 
199 #endif
200 
201 // OpenNN: Open Neural Networks Library.
202 // Copyright (c) 2005-2015 Roberto Lopez.
203 //
204 // This library is free software; you can redistribute it and/or
205 // modify it under the terms of the GNU Lesser General Public
206 // License as published by the Free Software Foundation; either
207 // version 2.1 of the License, or any later version.
208 //
209 // This library is distributed in the hope that it will be useful,
210 // but WITHOUT ANY WARRANTY; without even the implied warranty of
211 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
212 // Lesser General Public License for more details.
213 
214 // You should have received a copy of the GNU Lesser General Public
215 // License along with this library; if not, write to the Free Software
216 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
DataSet * get_data_set_pointer(void) const
Returns a pointer to the data set object on which the neural network is tested.
void print(void) const
Prints to the standard output the string representation of this testing analysis object.
bool display
Display messages to screen.
NeuralNetwork * get_neural_network_pointer(void) const
Returns a pointer to the neural network object which is to be tested.
void set_mathematical_model_pointer(MathematicalModel *)
void set_display(const bool &)
std::string to_string(void) const
Returns a string representation of the testing analysis object.
Vector< LinearRegressionParameters< double > > linear_regression_parameters
Intercept, slope and correlation coefficient for each output variable.
Vector< LinearRegressionParameters< double > > calculate_linear_regression_parameters(void) const
void set_data_set_pointer(DataSet *)
Matrix< size_t > calculate_confusion_multiple_classification(const Matrix< double > &, const Matrix< double > &) const
MathematicalModel * get_mathematical_model_pointer(void) const
Returns a pointer to the mathematical model object on which the neural network is tested...
Vector< Matrix< double > > calculate_error_data(void) const
Vector< Matrix< double > > calculate_error_data_statistics_matrices(void) const
LinearRegressionResults perform_linear_regression_analysis(void) const
virtual tinyxml2::XMLDocument * to_XML(void) const
Vector< Vector< size_t > > calculate_maximal_errors(const size_t &=10) const
void save(const std::string &) const
NeuralNetwork * neural_network_pointer
Pointer to the neural network object to be tested.
Matrix< size_t > calculate_confusion(void) const
Matrix< size_t > calculate_confusion_binary_classification(const Matrix< double > &, const Matrix< double > &) const
void set_neural_network_pointer(NeuralNetwork *)
Vector< Vector< Statistics< double > > > calculate_error_data_statistics(void) const
void load(const std::string &)
Vector< Matrix< double > > target_output_data
Target data from data set and output data from neural network.
Vector< double > calculate_binary_classification_tests(void) const
DataSet * data_set_pointer
Pointer to a data set object.
virtual void from_XML(const tinyxml2::XMLDocument &)
Vector< Matrix< double > > calculate_target_output_data(void) const
const bool & get_display(void) const
MathematicalModel * mathematical_model_pointer
Pointer to a mathematical model object.
Vector< Histogram< double > > calculate_error_data_histograms(const size_t &=10) const