Golang 的机器学习文库。目前,
它可以用来解决二元分类问题。
###
运行:
hector-cv.go
通过
交叉验证
将帮助你在一些数据测试一个
算法
, 请进行如下操作:
<pre box-sizing:="" font-family:="" liberation="" font-size:="" margin-top:="" margin-bottom:="" font-stretch:="" line-height:="" word-wrap:="" padding:="" overflow:="" background-color:="" border-radius:="" color:="">go get github.com/xlvector/hector
go install github.com/xlvector/hector/hectorcv
hectorcv --method [Method] --train [Data Path] --cv 10</pre>
方式:
1.
lr : logistic regression with SGD and L2 regularization.
2.
ftrl : FTRL-proximal logistic regreesion with L1 regularization. Please review this paper for more details "Ad Click Prediction: a View from the Trenches".
3.
ep : bayesian logistic regression with expectation propagation. Please review this paper for more details "Web-Scale Bayesian Click-Through Rate Prediction for Sponsored Search Advertising in Microsoft’s Bing Search Engine"
4.
fm : factorization machine
5.
cart : classifiaction tree
6.
cart-regression : regression tree
7.
rf : random forest
8.
rdt : random decision trees
9.
gbdt : gradient boosting decisio tree
10.
linear-svm : linear svm with L1 regularization
11.
svm : svm optimizaed by SMO (current, its linear svm)
12.
l1vm : vector machine with L1 regularization by RBF kernel
13.
knn : k-nearest neighbor classification
hector-run.go
将帮助你测试一组算法集,并测试它的测试数据集,
请进行如下操作:
<pre box-sizing:="" font-family:="" liberation="" font-size:="" margin-top:="" margin-bottom:="" font-stretch:="" line-height:="" word-wrap:="" padding:="" overflow:="" background-color:="" border-radius:="" color:="">cd src
go build hector-run.go
./hector-run --method [Method] --train [Data Path] --test [Data Path]</pre>
上面的方法
将直接对算法集测试,然后对测试数据集
进行测试
。
如果你想训练算法,并得到模型文件
,
请进行如下操作:
<pre box-sizing:="" font-family:="" liberation="" font-size:="" margin-top:="" margin-bottom:="" font-stretch:="" line-height:="" word-wrap:="" padding:="" overflow:="" background-color:="" border-radius:="" color:="">./hector-run --method [Method] --action train --train [Data Path] --model [Model Path]</pre>
Then, you can use model file to test any test dataset:
<pre box-sizing:="" font-family:="" liberation="" font-size:="" margin-top:="" margin-bottom:="" font-stretch:="" line-height:="" word-wrap:="" padding:="" overflow:="" background-color:="" border-radius:="" color:="">./hector-run --method [Method] --action test --test [Data Path] --model [Model Path]</pre>