SHOGUN
v3.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
MulticlassLogisticRegression.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) 2012 Sergey Lisitsyn
8
* Copyright (C) 2012 Sergey Lisitsyn
9
*/
10
11
#ifndef MULTICLASSLOGISTICREGRESSION_H_
12
#define MULTICLASSLOGISTICREGRESSION_H_
13
#include <
shogun/lib/config.h
>
14
#ifdef HAVE_EIGEN3
15
#include <
shogun/lib/common.h
>
16
#include <
shogun/features/DotFeatures.h
>
17
#include <
shogun/machine/LinearMulticlassMachine.h
>
18
19
namespace
shogun
20
{
21
25
class
CMulticlassLogisticRegression
:
public
CLinearMulticlassMachine
26
{
27
public
:
28
MACHINE_PROBLEM_TYPE
(
PT_MULTICLASS
)
29
30
31
CMulticlassLogisticRegression
();
32
38
CMulticlassLogisticRegression
(
float64_t
z,
CDotFeatures
* feats,
CLabels
* labs);
39
41
virtual
~CMulticlassLogisticRegression
();
42
44
virtual
const
char
*
get_name
()
const
45
{
46
return
"MulticlassLogisticRegression"
;
47
}
48
52
inline
void
set_z
(
float64_t
z)
53
{
54
ASSERT
(z>0)
55
m_z
= z;
56
}
60
inline
float64_t
get_z
()
const
{
return
m_z
; }
61
65
inline
void
set_epsilon
(
float64_t
epsilon
)
66
{
67
ASSERT
(epsilon>0)
68
m_epsilon
=
epsilon
;
69
}
73
inline
float64_t
get_epsilon
()
const
{
return
m_epsilon
; }
74
78
inline
void
set_max_iter
(int32_t max_iter)
79
{
80
ASSERT
(max_iter>0)
81
m_max_iter
= max_iter;
82
}
86
inline
int32_t
get_max_iter
()
const
{
return
m_max_iter
; }
87
88
protected
:
89
91
virtual
bool
train_machine
(
CFeatures
* data = NULL);
92
93
private
:
94
96
void
init_defaults();
97
99
void
register_parameters();
100
101
protected
:
102
104
float64_t
m_z
;
105
107
float64_t
m_epsilon
;
108
110
int32_t
m_max_iter
;
111
112
};
113
}
114
#endif
/* HAVE_EIGEN3 */
115
#endif
SHOGUN
Machine Learning Toolbox - Documentation