00001 /* --------------------------------------------------------------------------- 00002 Phission : 00003 Realtime Vision Processing System 00004 00005 Copyright (C) 2003-2005 Philip D.S. Thoren (pthoren@cs.uml.edu) 00006 University of Massachusetts at Lowell, 00007 Laboratory for Artificial Intelligence and Robotics 00008 00009 This file is part of Phission. 00010 00011 Phission is free software; you can redistribute it and/or modify 00012 it under the terms of the GNU General Public License as published by 00013 the Free Software Foundation; either version 2 of the License, or 00014 (at your option) any later version. 00015 00016 Phission is distributed in the hope that it will be useful, 00017 but WITHOUT ANY WARRANTY; without even the implied warranty of 00018 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00019 GNU General Public License for more details. 00020 00021 You should have received a copy of the GNU General Public License 00022 along with Phission; if not, write to the Free Software 00023 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00024 00025 ---------------------------------------------------------------------------*/ 00026 #ifndef ML_CLASS_STATS_H 00027 #define ML_CLASS_STATS_H 00028 00029 #include <stdint.h> 00030 #if USE_FILETYPE 00031 #else 00032 #include <sys/file.h> 00033 #include <sys/types.h> 00034 #include <sys/stat.h> 00035 #include <fcntl.h> 00036 #include <unistd.h> 00037 #endif 00038 #include <fann.h> 00039 00040 #ifdef __cplusplus 00041 extern "C" { 00042 #endif 00043 00044 /* ------------------------------------------------------------------------ */ 00045 typedef struct ml_class_stats_t 00046 { 00047 uint32_t num_outputs; 00048 fann_type *output_node_values; 00049 00050 uint32_t output_matches_active; 00051 uint32_t output_matches_inactive; 00052 00053 /* if an output ~ 1.0 when it should be ~ 1.0 and 00054 * ~ 0.0 when it should be 0.0 */ 00055 uint32_t correctly_classified; 00056 /* if an output ~ 1.0 when it should be ~ 0 */ 00057 uint32_t incorrectly_classified; 00058 00059 uint32_t output_nodes_active; 00060 uint32_t output_nodes_inactive; 00061 00062 /* per-epoch statistics on classifications */ 00063 uint32_t nclassifications; 00064 uint32_t *node_correctly_classified; 00065 uint32_t *node_incorrectly_classified; 00066 00067 float mse; 00068 00069 int print_output_nodes; 00070 int print_aggregate; 00071 00072 } ml_class_stats; 00073 00074 int ml_class_stats_new( uint32_t num_outputs, 00075 ml_class_stats **pstats ); 00076 00077 int ml_class_stats_free( ml_class_stats **pstats ); 00078 00079 int ml_class_stats_reset( ml_class_stats *stats ); 00080 00081 int ml_class_stats_classify( ml_class_stats *stats, 00082 fann_type *expected_output, 00083 fann_type *actual_output ); 00084 00085 int ml_class_stats_set_mse( ml_class_stats *stats, 00086 float mse ); 00087 00088 int ml_class_stats_set_options( ml_class_stats *stats, 00089 int print_output_nodes, 00090 int print_aggregate ); 00091 00092 int ml_class_stats_headers_print( FILE *log_fp, 00093 ml_class_stats *stats, 00094 char **tags, 00095 uint32_t ntags ); 00096 00097 int ml_class_stats_info_print( FILE *fp, 00098 ml_class_stats *stats ); 00099 00100 int ml_class_stats_row_print( FILE *fp, 00101 int epoch, 00102 float train_mse, 00103 ml_class_stats *train_stats, 00104 ml_class_stats *test_stats ); 00105 #ifdef __cplusplus 00106 } 00107 #endif 00108 00109 #endif /* define ML_CLASS_STATS_H */
Copyright (C) 2002 - 2007 |
Philip D.S. Thoren ( pthoren@users.sourceforge.net ) University Of Massachusetts at Lowell Robotics Lab |