SHOGUN
3.2.1
首页
相关页面
模块
类
文件
文件列表
文件成员
全部
类
命名空间
文件
函数
变量
类型定义
枚举
枚举值
友元
宏定义
组
页
src
shogun
converter
LocalityPreservingProjections.cpp
浏览该文件的文档.
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-2013 Sergey Lisitsyn
8
* Copyright (C) 2011-2013 Berlin Institute of Technology and Max-Planck-Society
9
*/
10
11
#include <
shogun/converter/LocalityPreservingProjections.h
>
12
#ifdef HAVE_EIGEN3
13
#include <
shogun/io/SGIO.h
>
14
#include <
shogun/kernel/LinearKernel.h
>
15
#include <shogun/lib/tapkee/tapkee_shogun.hpp>
16
17
using namespace
shogun;
18
19
CLocalityPreservingProjections::CLocalityPreservingProjections
() :
20
CLaplacianEigenmaps
()
21
{
22
}
23
24
CLocalityPreservingProjections::~CLocalityPreservingProjections
()
25
{
26
}
27
28
const
char
*
CLocalityPreservingProjections::get_name
()
const
29
{
30
return
"LocalityPreservingProjections"
;
31
};
32
33
CFeatures
*
CLocalityPreservingProjections::apply
(
CFeatures
* features)
34
{
35
TAPKEE_PARAMETERS_FOR_SHOGUN parameters;
36
m_distance
->
init
(features,features);
37
parameters.n_neighbors =
m_k
;
38
parameters.gaussian_kernel_width =
m_tau
;
39
parameters.method = SHOGUN_LOCALITY_PRESERVING_PROJECTIONS;
40
parameters.target_dimension =
m_target_dim
;
41
parameters.distance =
m_distance
;
42
parameters.features = (
CDotFeatures
*)features;
43
CDenseFeatures<float64_t>
* embedding = tapkee_embed(parameters);
44
return
embedding;
45
}
46
47
#endif
/* HAVE_EIGEN3 */
SHOGUN
机器学习工具包 - 项目文档