Skip to content

Commit 7d64895

Browse files
author
datastream
committed
go fmt
1 parent eafdea4 commit 7d64895

File tree

3 files changed

+35
-33
lines changed

3 files changed

+35
-33
lines changed

svm_model.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
package libsvm
22

33
type SVM_Model struct {
4-
param *SVM_Parameter // parameter
5-
nr_class int // number of classes, = 2 in regression/one class svm
6-
l int // total #SV
7-
SV [][]SVM_Node // SVs (SV[l])
8-
sv_coef [][]float64 // coefficients for SVs in decision functions (sv_coef[k-1][l])
9-
rho []float64 // constants in decision functions (rho[k*(k-1)/2])
10-
probA []float64 // pariwise probability information
11-
probB []float64
4+
param *SVM_Parameter // parameter
5+
nr_class int // number of classes, = 2 in regression/one class svm
6+
l int // total #SV
7+
SV [][]SVM_Node // SVs (SV[l])
8+
sv_coef [][]float64 // coefficients for SVs in decision functions (sv_coef[k-1][l])
9+
rho []float64 // constants in decision functions (rho[k*(k-1)/2])
10+
probA []float64 // pariwise probability information
11+
probB []float64
1212

13-
label []int // label of each class (label[k])
14-
nSV []int // number of SVs for each class (nSV[k]) nSV[0] + nSV[1] + ... + nSV[k-1] = l
13+
label []int // label of each class (label[k])
14+
nSV []int // number of SVs for each class (nSV[k]) nSV[0] + nSV[1] + ... + nSV[k-1] = l
1515
}

svm_node.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ type SVM_Node struct {
44
index int
55
value float64
66
}
7-
func (this *SVM_Node)clone() *SVM_Node {
7+
8+
func (this *SVM_Node) clone() *SVM_Node {
89
rst := new(SVM_Node)
910
*rst = *this
1011
return rst

svm_parameter.go

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,40 +2,41 @@ package libsvm
22

33
const (
44
/* svm_type */
5-
C_SVC = 0
6-
NU_SVC = 1
7-
ONE_CLASS = 2
5+
C_SVC = 0
6+
NU_SVC = 1
7+
ONE_CLASS = 2
88
EPSILON_SVR = 3
9-
NU_SVR = 4
9+
NU_SVR = 4
1010

1111
/* kernel_type */
12-
LINEAR = 0
13-
POLY = 1
14-
RBF = 2
15-
SIGMOID = 3
12+
LINEAR = 0
13+
POLY = 1
14+
RBF = 2
15+
SIGMOID = 3
1616
PRECOMPUTED = 4
1717
)
1818

1919
type SVM_Parameter struct {
20-
svm_type int
20+
svm_type int
2121
kernel_type int
22-
degree int// for poly
23-
gamma float64// for poly/rbf/sigmoid
24-
coef0 float64// for poly/sigmoid
22+
degree int // for poly
23+
gamma float64 // for poly/rbf/sigmoid
24+
coef0 float64 // for poly/sigmoid
2525

2626
// these are for training only
27-
cache_size float64 // in MB
28-
eps float64// stopping criteria
29-
C float64// for C_SVC, EPSILON_SVR and NU_SVR
30-
nr_weight int// for C_SVC
31-
weight_label []int// for C_SVC
32-
weight []float64// for C_SVC
33-
nu float64// for NU_SVC, ONE_CLASS, and NU_SVR
34-
p float64// for EPSILON_SVR
35-
shrinking int// use the shrinking heuristics
36-
probability int // do probability estimates
27+
cache_size float64 // in MB
28+
eps float64 // stopping criteria
29+
C float64 // for C_SVC, EPSILON_SVR and NU_SVR
30+
nr_weight int // for C_SVC
31+
weight_label []int // for C_SVC
32+
weight []float64 // for C_SVC
33+
nu float64 // for NU_SVC, ONE_CLASS, and NU_SVR
34+
p float64 // for EPSILON_SVR
35+
shrinking int // use the shrinking heuristics
36+
probability int // do probability estimates
3737

3838
}
39+
3940
func (this *SVM_Parameter) Clone() (rst *SVM_Parameter) {
4041
rst = new(SVM_Parameter)
4142
*rst = *this

0 commit comments

Comments
 (0)