SHOGUN
3.2.1
首页
相关页面
模块
类
文件
文件列表
文件成员
全部
类
命名空间
文件
函数
变量
类型定义
枚举
枚举值
友元
宏定义
组
页
src
shogun
preprocessor
KernelPCA.h
浏览该文件的文档.
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
const
char
*
get_name
()
const
{
return
"KernelPCA"
; }
86
88
virtual
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
机器学习工具包 - 项目文档