SHOGUN
v3.0.0
Main Page
Related Pages
Modules
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
src
shogun
statistics
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
13
#include <
shogun/statistics/KernelTwoSampleTestStatistic.h
>
14
15
namespace
shogun
16
{
17
18
class
CFeatures;
19
class
CKernel;
20
class
CCustomKernel;
21
23
enum
EQuadraticMMDType
24
{
25
BIASED
,
UNBIASED
26
};
27
86
class
CQuadraticTimeMMD
:
public
CKernelTwoSampleTestStatistic
87
{
88
public
:
89
CQuadraticTimeMMD
();
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
177
virtual
EStatisticType
get_statistic_type
()
const
178
{
179
return
S_QUADRATIC_TIME_MMD
;
180
}
181
182
#ifdef HAVE_LAPACK
183
205
SGVector<float64_t>
sample_null_spectrum
(
index_t
num_samples,
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
248
SGVector<float64_t>
fit_null_gamma
();
249
250
protected
:
252
virtual
float64_t
compute_unbiased_statistic
();
253
255
virtual
float64_t
compute_biased_statistic
();
256
257
private
:
258
void
init();
259
260
protected
:
262
index_t
m_num_samples_spectrum
;
263
265
index_t
m_num_eigenvalues_spectrum
;
266
268
EQuadraticMMDType
m_statistic_type
;
269
};
270
271
}
272
273
#endif
/* __QUADRACTIMEMMD_H_ */
SHOGUN
Machine Learning Toolbox - Documentation