SHOGUN  v3.2.0
LinearTimeMMD.h
Go to the documentation of this file.
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 
10 #ifndef __LINEARTIMEMMD_H_
11 #define __LINEARTIMEMMD_H_
12 
14 #include <shogun/kernel/Kernel.h>
15 #include <shogun/lib/external/libqp.h>
16 
17 namespace shogun
18 {
19 
20 class CStreamingFeatures;
21 class CFeatures;
22 
76 {
77 public:
79 
91  CStreamingFeatures* q, index_t m, index_t blocksize=10000);
92 
93  virtual ~CLinearTimeMMD();
94 
103  virtual float64_t compute_statistic();
104 
112  virtual SGVector<float64_t> compute_statistic(bool multiple_kernels);
113 
127  virtual float64_t compute_p_value(float64_t statistic);
128 
144  virtual float64_t perform_test();
145 
158  virtual float64_t compute_threshold(float64_t alpha);
159 
168 
187  virtual void compute_statistic_and_variance(
188  SGVector<float64_t>& statistic, SGVector<float64_t>& variance,
189  bool multiple_kernels=false);
190 
195  virtual void compute_statistic_and_Q(
197 
208 
212  void set_blocksize(index_t blocksize) { m_blocksize=blocksize; }
213 
215  virtual void set_p_and_q(CFeatures* p_and_q);
216 
218  virtual CFeatures* get_p_and_q();
219 
224 
229 
232  {
233  return S_LINEAR_TIME_MMD;
234  }
235 
239  inline void set_simulate_h0(bool simulate_h0) { m_simulate_h0=simulate_h0; }
240 
241 
242  virtual const char* get_name() const
243  {
244  return "LinearTimeMMD";
245  }
246 
247 private:
248  void init();
249 
250 protected:
253 
256 
259 
263 };
264 
265 }
266 
267 #endif /* __LINEARTIMEMMD_H_ */
268 
void set_blocksize(index_t blocksize)
CStreamingFeatures * m_streaming_p
virtual const char * get_name() const
int32_t index_t
Definition: common.h:60
virtual void compute_statistic_and_Q(SGVector< float64_t > &statistic, SGMatrix< float64_t > &Q)
virtual CFeatures * get_p_and_q()
void set_simulate_h0(bool simulate_h0)
virtual void compute_statistic_and_variance(SGVector< float64_t > &statistic, SGVector< float64_t > &variance, bool multiple_kernels=false)
virtual float64_t compute_threshold(float64_t alpha)
double float64_t
Definition: common.h:48
virtual EStatisticType get_statistic_type() const
CStreamingFeatures * m_streaming_q
virtual float64_t perform_test()
virtual void set_p_and_q(CFeatures *p_and_q)
all of classes and functions are contained in the shogun namespace
Definition: class_list.h:16
virtual float64_t compute_variance_estimate()
Two sample test base class. Provides an interface for performing a two-sample test, i.e. Given samples from two distributions and , the null-hypothesis is: , the alternative hypothesis: .
The class Features is the base class of all feature objects.
Definition: Features.h:62
Streaming features are features which are used for online algorithms.
This class implements the linear time Maximum Mean Statistic as described in [1]. This statistic is i...
Definition: LinearTimeMMD.h:75
virtual CStreamingFeatures * get_streaming_q()
The Kernel base class.
Definition: Kernel.h:150
virtual CStreamingFeatures * get_streaming_p()
virtual SGVector< float64_t > bootstrap_null()
virtual float64_t compute_p_value(float64_t statistic)
virtual float64_t compute_statistic()

SHOGUN Machine Learning Toolbox - Documentation