SHOGUN
3.2.1
首页
相关页面
模块
类
文件
文件列表
文件成员
全部
类
命名空间
文件
函数
变量
类型定义
枚举
枚举值
友元
宏定义
组
页
src
shogun
features
Features.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) 1999-2009 Soeren Sonnenburg
8
* Written (W) 1999-2008 Gunnar Raetsch
9
* Written (W) 2011-2012 Heiko Strathmann
10
* Copyright (C) 1999-2009 Fraunhofer Institute FIRST and Max-Planck-Society
11
*/
12
13
#ifndef _CFEATURES__H__
14
#define _CFEATURES__H__
15
16
#include <
shogun/lib/common.h
>
17
#include <
shogun/io/File.h
>
18
#include <
shogun/base/SGObject.h
>
19
#include <
shogun/preprocessor/Preprocessor.h
>
20
#include <
shogun/features/FeatureTypes.h
>
21
#include <
shogun/features/SubsetStack.h
>
22
#include <
shogun/lib/List.h
>
23
#include <
shogun/lib/DynamicObjectArray.h
>
24
#include <
shogun/lib/DynamicArray.h
>
25
26
namespace
shogun
27
{
28
class
CFile;
29
class
CPreprocessor;
30
class
CKernel;
31
}
32
33
namespace
shogun
34
{
35
62
class
CFeatures
:
public
CSGObject
63
{
64
public
:
69
CFeatures
(int32_t size=0);
70
72
CFeatures
(
const
CFeatures
& orig);
73
78
CFeatures
(
CFile
* loader);
79
86
virtual
CFeatures
*
duplicate
()
const
=0;
87
88
virtual
~CFeatures
();
89
96
virtual
EFeatureType
get_feature_type
()
const
=0;
97
104
virtual
EFeatureClass
get_feature_class
()
const
=0;
105
110
virtual
void
add_preprocessor
(
CPreprocessor
* p);
111
116
virtual
void
del_preprocessor
(int32_t num);
117
122
CPreprocessor
*
get_preprocessor
(int32_t num)
const
;
123
128
void
set_preprocessed
(int32_t num);
129
134
bool
is_preprocessed
(int32_t num)
const
;
135
140
int32_t
get_num_preprocessed
()
const
;
141
146
int32_t
get_num_preprocessors
()
const
;
147
149
void
clean_preprocessors
();
150
152
void
list_preprocessors
();
153
158
int32_t
get_cache_size
()
const
;
159
166
virtual
int32_t
get_num_vectors
()
const
=0;
167
176
virtual
bool
reshape
(int32_t num_features, int32_t num_vectors);
177
179
void
list_feature_obj
()
const
;
180
185
virtual
void
load
(
CFile
* loader);
186
191
virtual
void
save
(
CFile
* writer);
192
198
bool
check_feature_compatibility
(
CFeatures
* f)
const
;
199
205
bool
has_property
(
EFeatureProperty
p)
const
;
206
211
void
set_property
(
EFeatureProperty
p);
212
217
void
unset_property
(
EFeatureProperty
p);
218
229
virtual
CFeatures
*
create_merged_copy
(
CList
* others)
230
{
231
SG_ERROR
(
"%s::create_merged_copy() is not yet implemented!\n"
)
232
return
NULL;
233
}
234
243
virtual
CFeatures
*
create_merged_copy
(
CFeatures
* other)
244
{
245
SG_ERROR
(
"%s::create_merged_copy() is not yet implemented!\n"
)
246
return
NULL;
247
}
248
254
virtual
void
add_subset
(
SGVector<index_t>
subset);
255
258
virtual
void
remove_subset
();
259
262
virtual
void
remove_all_subsets
();
263
268
virtual
CSubsetStack
*
get_subset_stack
();
269
271
virtual
void
subset_changed_post
() {}
272
282
virtual
CFeatures
*
copy_subset
(
SGVector<index_t>
indices);
283
284
private
:
285
void
init();
286
287
private
:
289
uint64_t properties;
290
292
int32_t cache_size;
293
295
CDynamicObjectArray
* preproc;
296
298
CDynamicArray<bool>
* preprocessed;
299
300
protected
:
302
CSubsetStack
*
m_subset_stack
;
303
};
304
}
305
#endif
SHOGUN
机器学习工具包 - 项目文档