00001 /****************************************************************************************************************/ 00002 /* */ 00003 /* Flood: An Open Source Neural Networks C++ Library */ 00004 /* www.cimne.com/flood */ 00005 /* */ 00006 /* F U N C T I O N R E G R E S S I O N U T I L I T I E S C L A S S H E A D E R */ 00007 /* */ 00008 /* Roberto Lopez */ 00009 /* International Center for Numerical Methods in Engineering (CIMNE) */ 00010 /* Technical University of Catalonia (UPC) */ 00011 /* Barcelona, Spain */ 00012 /* E-mail: rlopez@cimne.upc.edu */ 00013 /* */ 00014 /****************************************************************************************************************/ 00015 00016 #ifndef __FUNCTIONREGRESSIONUTILITIES_H__ 00017 #define __FUNCTIONREGRESSIONUTILITIES_H__ 00018 00019 // Flood includes 00020 00021 #include "../Utilities/Vector.h" 00022 #include "../Utilities/Matrix.h" 00023 #include "../Utilities/InputTargetDataSet.h" 00024 #include "../MultilayerPerceptron/MultilayerPerceptron.h" 00025 00026 namespace Flood 00027 { 00028 00031 00032 class FunctionRegressionUtilities 00033 { 00034 00035 public: 00036 00037 // DEFAULT CONSTRUCTOR 00038 00039 explicit FunctionRegressionUtilities(void); 00040 00041 // MULTILAYER PERCEPTRON CONSTRUCTOR 00042 00043 explicit FunctionRegressionUtilities(MultilayerPerceptron*); 00044 00045 // INPUT-TARGET DATA SEET CONSTRUCTOR 00046 00047 explicit FunctionRegressionUtilities(InputTargetDataSet*); 00048 00049 // GENERAL CONSTRUCTOR 00050 00051 explicit FunctionRegressionUtilities(MultilayerPerceptron*, InputTargetDataSet*); 00052 00053 // DESTRUCTOR 00054 00055 virtual ~FunctionRegressionUtilities(); 00056 00057 // METHODS 00058 00059 // Get methods 00060 00061 MultilayerPerceptron* get_multilayer_perceptron_pointer(void); 00062 InputTargetDataSet* get_input_target_data_set_pointer(void); 00063 00064 bool get_display(void); 00065 00066 // Set methods 00067 00068 void set_multilayer_perceptron_pointer(MultilayerPerceptron*); 00069 void set_input_target_data_set_pointer(InputTargetDataSet*); 00070 00071 void set_display(bool); 00072 00073 // Arfificial data generators 00074 00075 void generate_artificial_data(const Vector<double>&, const Vector<double>&, const Vector<std::string>&); 00076 00077 // Testing target output data methods 00078 00079 Vector< Matrix<double> > calculate_testing_target_output_data(void); 00080 std::string get_testing_target_output_data(bool); 00081 void print_testing_target_output_data(void); 00082 void save_testing_target_output_data(const char*); 00083 00084 // Linear regression parameters methods 00085 00086 Vector< Vector<double> > calculate_linear_regression_parameters(void); 00087 std::string get_linear_regression_parameters(bool); 00088 void print_linear_regression_parameters(void); 00089 void save_linear_regression_parameters(const char*); 00090 00091 // Linear regression analysis methods 00092 00093 std::string get_linear_regression_analysis(bool); 00094 void print_linear_regression_analysis(void); 00095 void save_linear_regression_analysis(const char*); 00096 00097 private: 00098 00099 // MEMBERS 00100 00102 00103 MultilayerPerceptron* multilayer_perceptron_pointer; 00104 00106 00107 InputTargetDataSet* input_target_data_set_pointer; 00108 00110 00111 bool display; 00112 00113 // METHODS 00114 00115 // Artificial data generator methods 00116 00117 double calculate_De_Jong_function_evaluation(const Vector<double>&); 00118 double calculate_Rosenbrock_function_evaluation(const Vector<double>&); 00119 double calculate_Rastrigin_function_evaluation(const Vector<double>&); 00120 00121 }; 00122 00123 } 00124 00125 #endif 00126 00127 // Flood: An Open Source Neural Networks C++ Library. 00128 // Copyright (C) 2005-2010 Roberto Lopez 00129 // 00130 // This library is free software; you can redistribute it and/or 00131 // modify it under the s of the GNU Lesser General Public 00132 // License as published by the Free Software Foundation; either 00133 // version 2.1 of the License, or any later version. 00134 // 00135 // This library is distributed in the hope that it will be useful, 00136 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00137 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00138 // Lesser General Public License for more details. 00139 00140 // You should have received a copy of the GNU Lesser General Public 00141 // License along with this library; if not, write to the Free Software 00142 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA