SHOGUN  4.1.0
 全部  命名空间 文件 函数 变量 类型定义 枚举 枚举值 友元 宏定义  
CrossValidationOutput.h
浏览该文件的文档.
1 /*
2  * This program is free software; you can redistribute it and/or modify
3  * it under the terms of the GNU General Public License as published by
4  * the Free Software Foundation; either version 3 of the License, or
5  * (at your option) any later version.
6  *
7  * Written (W) 2012 Sergey Lisitsyn
8  * Written (W) 2012 Heiko Strathmann
9  *
10  */
11 
12 #ifndef __CROSSVALIDATIONOUTPUT_H_
13 #define __CROSSVALIDATIONOUTPUT_H_
14 
15 #include <shogun/lib/config.h>
16 
17 #include <shogun/base/SGObject.h>
18 #include <shogun/lib/SGVector.h>
19 
20 namespace shogun
21 {
22 
23 class CMachine;
24 class CLabels;
25 class CEvaluation;
26 
44 {
45 public:
46 
49  {
52  m_num_runs=0;
53  m_num_folds=0;
54  }
55 
58 
60  virtual const char* get_name() const=0;
61 
67  virtual void init_num_runs(index_t num_runs, const char* prefix="")
68  {
69  m_num_runs=num_runs;
70  }
71 
76  virtual void init_num_folds(index_t num_folds, const char* prefix="")
77  {
78  m_num_folds=num_folds;
79  }
80 
84  virtual void init_expose_labels(CLabels* labels) { }
85 
87  virtual void post_init() { }
88 
94  virtual void update_run_index(index_t run_index,
95  const char* prefix="")
96  {
97  m_current_run_index=run_index;
98  }
99 
105  virtual void update_fold_index(index_t fold_index,
106  const char* prefix="")
107  {
108  m_current_fold_index=fold_index;
109  }
110 
117  const char* prefix="") {}
118 
125  const char* prefix="") {}
126 
132  virtual void update_trained_machine(CMachine* machine,
133  const char* prefix="") {}
134 
140  virtual void update_test_result(CLabels* results,
141  const char* prefix="") {}
142 
148  virtual void update_test_true_result(CLabels* results,
149  const char* prefix="") {}
150 
153  virtual void post_update_results() {}
154 
160  virtual void update_evaluation_result(float64_t result,
161  const char* prefix="") {}
162 
163 protected:
166 
169 
172 
175 };
176 
177 }
178 
179 #endif /* __CROSSVALIDATIONOUTPUT_H_ */
virtual void update_fold_index(index_t fold_index, const char *prefix="")
virtual void update_train_indices(SGVector< index_t > indices, const char *prefix="")
virtual const char * get_name() const =0
int32_t index_t
Definition: common.h:62
The class Labels models labels, i.e. class assignments of objects.
Definition: Labels.h:43
virtual void update_test_true_result(CLabels *results, const char *prefix="")
virtual void init_num_runs(index_t num_runs, const char *prefix="")
virtual void update_test_indices(SGVector< index_t > indices, const char *prefix="")
A generic learning machine interface.
Definition: Machine.h:143
virtual void update_trained_machine(CMachine *machine, const char *prefix="")
Class for managing individual folds in cross-validation.
Class SGObject is the base class of all shogun objects.
Definition: SGObject.h:112
double float64_t
Definition: common.h:50
virtual void update_test_result(CLabels *results, const char *prefix="")
all of classes and functions are contained in the shogun namespace
Definition: class_list.h:18
virtual void update_evaluation_result(float64_t result, const char *prefix="")
virtual void init_expose_labels(CLabels *labels)
virtual void init_num_folds(index_t num_folds, const char *prefix="")
virtual void update_run_index(index_t run_index, const char *prefix="")

SHOGUN 机器学习工具包 - 项目文档