SHOGUN  v3.2.0
TestStatistic.cpp
浏览该文件的文档.
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-2013 Heiko Strathmann
8  */
9 
11 #include <shogun/base/Parameter.h>
12 
13 using namespace shogun;
14 
16 {
17  init();
18 }
19 
21 {
22 
23 }
24 
25 void CTestStatistic::init()
26 {
27  SG_ADD(&m_bootstrap_iterations, "bootstrap_iterations",
28  "Number of iterations for bootstrapping", MS_NOT_AVAILABLE);
30  "null_approximation_method",
31  "Method for approximating null distribution",
33 
35  m_null_approximation_method=BOOTSTRAP;
36 }
37 
39  ENullApproximationMethod null_approximation_method)
40 {
41  m_null_approximation_method=null_approximation_method;
42 }
43 
45  bootstrap_iterations)
46 {
47  m_bootstrap_iterations=bootstrap_iterations;
48 }
49 
51 {
52  /* baseline method here is simply to compute statistic and p-value
53  * separately */
54  float64_t statistic=compute_statistic();
55  return compute_p_value(statistic);
56 }
57 
59 {
60  float64_t p_value=perform_test();
61  return p_value<alpha;
62 }
virtual float64_t compute_statistic()=0
int32_t index_t
Definition: common.h:60
virtual float64_t compute_p_value(float64_t statistic)=0
virtual float64_t perform_test()
virtual void set_bootstrap_iterations(index_t bootstrap_iterations)
Class SGObject is the base class of all shogun objects.
Definition: SGObject.h:102
double float64_t
Definition: common.h:48
all of classes and functions are contained in the shogun namespace
Definition: class_list.h:16
int machine_int_t
Definition: common.h:57
#define SG_ADD(...)
Definition: SGObject.h:71
ENullApproximationMethod m_null_approximation_method
virtual void set_null_approximation_method(ENullApproximationMethod null_approximation_method)
ENullApproximationMethod
Definition: TestStatistic.h:25

SHOGUN Machine Learning Toolbox - Documentation