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
multiclass
ConjugateIndex.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 Sergey Lisitsyn
8
* Copyright (C) 2011 Sergey Lisitsyn
9
*/
10
11
#ifndef CONJUGATEINDEX_H_
12
#define CONJUGATEINDEX_H_
13
#ifdef HAVE_LAPACK
14
#include <
shogun/machine/Machine.h
>
15
#include <
shogun/mathematics/Math.h
>
16
#include <
shogun/features/DenseFeatures.h
>
17
18
namespace
shogun
19
{
20
21
class
CLabels;
22
class
CDotFeatures;
23
class
CFeatures;
24
34
class
CConjugateIndex
:
public
CMachine
35
{
36
37
public
:
38
MACHINE_PROBLEM_TYPE
(
PT_MULTICLASS
)
39
40
43
CConjugateIndex
();
44
49
CConjugateIndex
(
CFeatures
* train_features,
CLabels
* train_labels);
50
54
virtual
~CConjugateIndex
();
55
59
virtual
void
set_features
(
CFeatures
* features);
60
64
virtual
CDenseFeatures<float64_t>
*
get_features
();
65
70
virtual
CMulticlassLabels
*
apply_multiclass
(
CFeatures
* data=NULL);
71
76
virtual
float64_t
apply_one
(int32_t idx);
77
81
virtual
const
char
*
get_name
()
const
{
return
"ConjugateIndex"
; };
82
86
virtual
EMachineType
get_classifier_type
() {
return
CT_CONJUGATEINDEX
; };
87
88
protected
:
89
94
virtual
bool
train_machine
(
CFeatures
* data=NULL);
95
97
void
clean_classes
();
98
105
float64_t
conjugate_index
(
SGVector<float64_t>
feature_vector, int32_t label);
106
107
protected
:
108
110
int32_t
m_num_classes
;
111
113
SGVector<float64_t>
m_feature_vector
;
114
116
SGMatrix<float64_t>
*
m_classes
;
117
119
CDenseFeatures<float64_t>
*
m_features
;
120
121
};
122
123
}
124
#endif
/* HAVE_LAPACK */
125
#endif
/* CONJUGATEINDEX_H_ */
SHOGUN
Machine Learning Toolbox - Documentation