SHOGUN  v3.2.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
QuadraticTimeMMD.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 __QUADRACTIMEMMD_H_
11 #define __QUADRACTIMEMMD_H_
12 
14 
15 namespace shogun
16 {
17 
18 class CFeatures;
19 class CKernel;
20 class CCustomKernel;
21 
24 {
26 };
27 
87 {
88  public:
90 
101  CQuadraticTimeMMD(CKernel* kernel, CFeatures* p_and_q, index_t m);
102 
114  CQuadraticTimeMMD(CKernel* kernel, CFeatures* p, CFeatures* q);
115 
125  CQuadraticTimeMMD(CCustomKernel* custom_kernel, index_t m);
126 
127  virtual ~CQuadraticTimeMMD();
128 
135  virtual float64_t compute_statistic();
136 
144  virtual SGVector<float64_t> compute_statistic(bool multiple_kernels);
145 
157  virtual float64_t compute_p_value(float64_t statistic);
158 
169  virtual float64_t compute_threshold(float64_t alpha);
170 
171  virtual const char* get_name() const
172  {
173  return "QuadraticTimeMMD";
174  };
175 
178  {
179  return S_QUADRATIC_TIME_MMD;
180  }
181 
182 #ifdef HAVE_LAPACK
183 
206  index_t num_eigenvalues);
207 #endif // HAVE_LAPACK
208 
215  void set_num_samples_sepctrum(index_t num_samples_spectrum);
216 
223  void set_num_eigenvalues_spectrum(index_t num_eigenvalues_spectrum);
224 
226  void set_statistic_type(EQuadraticMMDType statistic_type);
227 
249 
250  protected:
253 
256 
257  private:
258  void init();
259 
260  protected:
263 
266 
269 };
270 
271 }
272 
273 #endif /* __QUADRACTIMEMMD_H_ */
EQuadraticMMDType m_statistic_type
virtual const char * get_name() const
int32_t index_t
Definition: common.h:60
The Custom Kernel allows for custom user provided kernel matrices.
Definition: CustomKernel.h:33
virtual float64_t compute_statistic()
void set_statistic_type(EQuadraticMMDType statistic_type)
SGVector< float64_t > fit_null_gamma()
virtual EStatisticType get_statistic_type() const
SGVector< float64_t > sample_null_spectrum(index_t num_samples, index_t num_eigenvalues)
This class implements the quadratic time Maximum Mean Statistic as described in [1]. The MMD is the distance of two probability distributions and in a RKHS .
void set_num_eigenvalues_spectrum(index_t num_eigenvalues_spectrum)
double float64_t
Definition: common.h:48
virtual float64_t compute_unbiased_statistic()
void set_num_samples_sepctrum(index_t num_samples_spectrum)
virtual float64_t compute_p_value(float64_t statistic)
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
virtual float64_t compute_biased_statistic()
The Kernel base class.
Definition: Kernel.h:150
virtual float64_t compute_threshold(float64_t alpha)

SHOGUN Machine Learning Toolbox - Documentation