SHOGUN
3.2.1
首页
相关页面
模块
类
文件
文件列表
文件成员
全部
类
命名空间
文件
函数
变量
类型定义
枚举
枚举值
友元
宏定义
组
页
src
shogun
multiclass
MulticlassTreeGuidedLogisticRegression.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) 2012 Sergey Lisitsyn
8
* Copyright (C) 2012 Sergey Lisitsyn
9
*/
10
11
#ifndef MULTICLASSTREEGUIDEDLOGISTICREGRESSION_H_
12
#define MULTICLASSTREEGUIDEDLOGISTICREGRESSION_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
#include <
shogun/lib/IndexBlockTree.h
>
19
20
namespace
shogun
21
{
22
25
class
CMulticlassTreeGuidedLogisticRegression
:
public
CLinearMulticlassMachine
26
{
27
public
:
28
MACHINE_PROBLEM_TYPE
(
PT_MULTICLASS
)
29
30
31
CMulticlassTreeGuidedLogisticRegression
();
32
39
CMulticlassTreeGuidedLogisticRegression
(
float64_t
z,
CDotFeatures
* feats,
CLabels
* labs,
CIndexBlockTree
* tree);
40
42
virtual
~CMulticlassTreeGuidedLogisticRegression
();
43
45
virtual
const
char
*
get_name
()
const
46
{
47
return
"MulticlassTreeGuidedLogisticRegression"
;
48
}
49
53
inline
void
set_z
(
float64_t
z)
54
{
55
ASSERT
(z>0)
56
m_z
= z;
57
}
61
inline
float64_t
get_z
()
const
{
return
m_z
; }
62
66
inline
void
set_epsilon
(
float64_t
epsilon
)
67
{
68
ASSERT
(epsilon>0)
69
m_epsilon
=
epsilon
;
70
}
74
inline
float64_t
get_epsilon
()
const
{
return
m_epsilon
; }
75
79
inline
void
set_max_iter
(int32_t max_iter)
80
{
81
ASSERT
(max_iter>0)
82
m_max_iter
= max_iter;
83
}
87
inline
int32_t
get_max_iter
()
const
{
return
m_max_iter
; }
88
92
inline
void
set_index_tree
(
CIndexBlockTree
* index_tree)
93
{
94
SG_REF
(index_tree);
95
SG_UNREF
(
m_index_tree
);
96
m_index_tree
= index_tree;
97
}
101
inline
CIndexBlockTree
*
get_index_tree
()
const
102
{
103
SG_REF
(
m_index_tree
);
104
return
m_index_tree
;
105
}
106
107
protected
:
108
110
virtual
bool
train_machine
(
CFeatures
* data = NULL);
111
112
private
:
113
115
void
init_defaults();
116
118
void
register_parameters();
119
120
protected
:
121
123
CIndexBlockTree
*
m_index_tree
;
124
126
float64_t
m_z
;
127
129
float64_t
m_epsilon
;
130
132
int32_t
m_max_iter
;
133
134
};
135
}
136
#endif
/* HAVE_EIGEN3 */
137
#endif
SHOGUN
机器学习工具包 - 项目文档