SHOGUN
v2.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
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 Heiko Strathmann
8
*/
9
10
#ifndef __LINEARTIMEMMD_H_
11
#define __LINEARTIMEMMD_H_
12
13
#include <
shogun/statistics/KernelTwoSampleTestStatistic.h
>
14
#include <
shogun/kernel/Kernel.h
>
15
#include <
shogun/lib/external/libqp.h
>
16
17
namespace
shogun
18
{
19
20
class
CFeatures;
21
74
class
CLinearTimeMMD
:
public
CKernelTwoSampleTestStatistic
75
{
76
public
:
77
CLinearTimeMMD
();
78
89
CLinearTimeMMD
(
CKernel
* kernel,
CFeatures
* p_and_q,
index_t
q_start);
90
102
CLinearTimeMMD
(
CKernel
* kernel,
CFeatures
* p,
CFeatures
* q);
103
104
virtual
~CLinearTimeMMD
();
105
111
virtual
float64_t
compute_statistic
();
112
126
virtual
float64_t
compute_p_value
(
float64_t
statistic);
127
140
virtual
float64_t
compute_threshold
(
float64_t
alpha);
141
149
virtual
float64_t
compute_variance_estimate
();
150
151
#ifdef HAVE_LAPACK
152
168
virtual
void
optimize_kernel_weights
();
169
171
void
set_opt_max_iterations
(
index_t
opt_max_iterations)
172
{
173
m_opt_max_iterations
=opt_max_iterations;
174
}
175
177
void
set_opt_epsilon
(
float64_t
opt_epsilon) {
178
m_opt_epsilon
=opt_epsilon;
179
}
180
183
void
set_opt_low_cut
(
float64_t
opt_low_cut)
184
{
185
m_opt_low_cut
=opt_low_cut;
186
}
187
190
void
set_opt_regularization_eps
(
float64_t
opt_regularization_eps)
191
{
192
m_opt_regularization_eps
=opt_regularization_eps;
193
}
194
195
#endif //HAVE_LAPACK
196
197
inline
virtual
const
char
*
get_name
()
const
198
{
199
return
"LinearTimeMMD"
;
200
}
201
202
private
:
203
void
init();
204
205
public
:
206
#ifdef HAVE_LAPACK
207
208
static
const
float64_t
*
get_Q_col
(uint32_t i);
209
211
static
void
print_state
(libqp_state_T state);
212
#endif //HAVE_LAPACK
213
214
protected
:
216
index_t
m_opt_max_iterations
;
217
219
float64_t
m_opt_epsilon
;
220
222
float64_t
m_opt_low_cut
;
223
225
float64_t
m_opt_regularization_eps
;
226
228
static
SGMatrix<float64_t>
m_Q
;
229
};
230
231
}
232
233
#endif
/* __LINEARTIMEMMD_H_ */
234
SHOGUN
Machine Learning Toolbox - Documentation