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
preprocessor
KernelPCA.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) 2011 Soeren Sonnenburg
8
* Copyright (C) 2011 Berlin Institute of Technology
9
*/
10
11
#ifndef KERNELPCA_H__
12
#define KERNELPCA_H__
13
#include <
shogun/lib/config.h
>
14
#ifdef HAVE_LAPACK
15
16
#include <
shogun/preprocessor/DimensionReductionPreprocessor.h
>
17
#include <
shogun/features/Features.h
>
18
#include <
shogun/kernel/Kernel.h
>
19
#include <
shogun/lib/common.h
>
20
21
namespace
shogun
22
{
23
24
class
CFeatures;
25
class
CKernel;
26
35
class
CKernelPCA
:
public
CDimensionReductionPreprocessor
36
{
37
public
:
40
CKernelPCA
();
41
45
CKernelPCA
(
CKernel
* k);
46
47
virtual
~CKernelPCA
();
48
50
virtual
bool
init
(
CFeatures
* features);
52
virtual
void
cleanup
();
53
57
virtual
SGMatrix<float64_t>
apply_to_feature_matrix
(
CFeatures
* features);
58
61
virtual
SGVector<float64_t>
apply_to_feature_vector
(
SGVector<float64_t>
vector);
62
66
virtual
CDenseFeatures<float64_t>
*
apply_to_string_features
(
CFeatures
* features);
67
71
SGMatrix<float64_t>
get_transformation_matrix
()
const
72
{
73
return
m_transformation_matrix
;
74
}
75
79
SGVector<float64_t>
get_bias_vector
()
const
80
{
81
return
m_bias_vector
;
82
}
83
85
virtual
inline
const
char
*
get_name
()
const
{
return
"KernelPCA"
; }
86
88
virtual
inline
EPreprocessorType
get_type
()
const
{
return
P_KERNELPCA
; }
89
90
protected
:
91
93
void
init
();
94
95
protected
:
96
98
CFeatures
*
m_init_features
;
99
101
SGMatrix<float64_t>
m_transformation_matrix
;
102
104
SGVector<float64_t>
m_bias_vector
;
105
107
bool
m_initialized
;
108
109
};
110
}
111
#endif
112
#endif
SHOGUN
Machine Learning Toolbox - Documentation