xlvector / hector Goto Github PK
View Code? Open in Web Editor NEWGolang machine learning lib
License: MIT License
Golang machine learning lib
License: MIT License
Hi Xiang Liang,
First thanks for sharing your code here.
Have you tried to use any of your algorithms for one-class classification problems?
Basically what I have is something like:
1 1:0.7 3:0.1 9:0.4
1 2:0.3 4:0.9 7:0.5
1 2:0.7 5:0.3
1 ...
I've tried most of the methods available but they always return AUC: 0.5
Thanks already for any tips.
Cheers,
Henrique
Using GP for regression and classification
Backward propagation for binary classification.
Only support single hidden layer. (Multiply layer will cause serious overfitting, and is also very time/space consuming)
I wrote my own command line program that calls the lr
package. When I run lr.LROWLQN.Train
without calling lr.LROWLQN.Init
, I got correct answer. But if I call lr.Init(map[string]string{"regularization": "1.0"})
before lr.LROWLQN.Train
, the program panics:
[~/Projects/risk-model/src/github.com/xlvector/hector]
wangyi@localhost:hector$/Users/wangyi/Projects/risk-model/bin/learn-hector && cat /tmp/a
&{[%!q(*core.Sample=&{[{1 1}] 1 0}) %!q(*core.Sample=&{[{2 1} {1 1}] 0 0})] '\x01'}panic: BackTracking: to the opposite direction of grad
goroutine 1 [running]:
runtime.panic(0x9c420, 0x210271310)
/Users/wangyi/go/src/pkg/runtime/panic.c:266 +0xb6
github.com/xlvector/hector/lr.(*QuasiNewtonHelper).BackTrackingLineSearch(0x2102ac0e0, 0x3ff62e42fefa39ef, 0x210267088, 0x2102670a0, 0x210267098, ...)
/Users/wangyi/Projects/risk-model/src/github.com/xlvector/hector/lr/quasinewton_helper.go:74 +0x231
github.com/xlvector/hector/lr.(*OWLQNMinimizer).Minimize(0x210285480, 0x238278, 0x2102853f0, 0x210267068, 0x40)
/Users/wangyi/Projects/risk-model/src/github.com/xlvector/hector/lr/owlqn_minimizer.go:59 +0x4d0
github.com/xlvector/hector/lr.(*LROWLQN).Train(0x2102853f0, 0x2102b1040)
/Users/wangyi/Projects/risk-model/src/github.com/xlvector/hector/lr/lr_owlqn.go:133 +0xf2
main.main()
/Users/wangyi/Projects/risk-model/src/github.com/wangkuiyi/learn-hector/main.go:82 +0x27c
heart fourclass两个数据集的链接有问题.
使用hector-run训练一个千万级别样本的数据集,文件大小约750M,当程序运行到内存占用约3.5%左右时(服务器可用内存足够大),会报如下错误。sample一个小的子集出来训练没有问题:
./hector-run --method lr --action train --train train_ins --model lr_model
train_ins
test.tsv
lr
map[lambda2:0.1 min-leaf-size:10 feature-count:1.0 factors:10 c:1 e:0.01 profile: beta:1 steps:1 sv:8 model:lr_model regularization:0.01 output: method:lr learning-rate:0.01 tree-count:10 action:train global:-1 alpha:0.1 lambda1:0.1 k:3 cv:7 radius:1.0 max-depth:10 gini:1.0 hidden:1 dt-sample-ratio:1.0]
runtime: memory allocated by OS (0x2aaf58e000) not in usable range [0x8600000,0x88600000)
fatal error: out of memory
goroutine 1 [running]:
[fp=0x2aa55d19d8] runtime.throw(0x59e400)
/home/work/lib/go/src/pkg/runtime/panic.c:473 +0x67
[fp=0x2aa55d1a18] runtime.MCache_Alloc(0x2aa5581000, 0x11, 0x100, 0x1)
/home/work/lib/go/src/pkg/runtime/mcache.c:27 +0xab
[fp=0x2aa55d1a70] runtime.mallocgc(0x100, 0x100000001, 0x1)
/home/work/lib/go/src/pkg/runtime/zmalloc_linux_amd64.c:47 +0xf5
[fp=0x2aa55d1ab0] cnew(0x4e65e0, 0x10, 0x1)
/home/work/lib/go/src/pkg/runtime/zmalloc_linux_amd64.c:655 +0xee
[fp=0x2aa55d1ad0] runtime.cnewarray(0x4e65e0, 0x10)
/home/work/lib/go/src/pkg/runtime/zmalloc_linux_amd64.c:673 +0x38
[fp=0x2aa55d1ae8] makeslice1(0x4b6820, 0x8, 0x10, 0x2aa55d1b88)
/home/work/lib/go/src/pkg/runtime/slice.c:53 +0x45
[fp=0x2aa55d1b18] growslice1(0x4b6820, 0x8853bb00, 0x8, 0x8, 0x9, ...)
/home/work/lib/go/src/pkg/runtime/slice.c:212 +0x56
[fp=0x2aa55d1b60] runtime.growslice(0x4b6820, 0x8853bb00, 0x8, 0x8, 0x1, ...)
/home/work/lib/go/src/pkg/runtime/slice.c:179 +0x9f
[fp=0x2aa55d1d40] hector.(*DataSet).Load(0x867b060, 0x7fbffff6f0, 0x9, 0xffffffffffffffff, 0x0, ...)
/home/work/test/lr/hector/src/hector/dataset.go:160 +0x71d
[fp=0x2aa55d1dd8] hector.AlgorithmTrain(0x8662140, 0x867b040, 0x7fbffff6f0, 0x9, 0x8667200, ...)
/home/work/test/lr/hector/src/hector/algo_runner.go:41 +0x141
[fp=0x2aa55d1f90] main.main()
/home/work/test/lr/hector/bin/hector-run.go:20 +0x376
[fp=0x2aa55d1fb8] runtime.main()
/home/work/lib/go/src/pkg/runtime/proc.c:182 +0x92
[fp=0x2aa55d1fc0] runtime.goexit()
/home/work/lib/go/src/pkg/runtime/proc.c:1223
goroutine 2 [runnable]:
其中Go的版本为:go version go1.1.2 linux/amd64
hi,
用训练集生成的model,想用 model 把测试集每一项结果输出,看参数代码,有一个 output 参数;
运行./hector-run --method ftrl --action test --test test.text --model model.ftrl --output result.ftrl
但是没有结果输出,是我参数配置不对还是别的原因?
Hi xlvector,
不知道能不能提供一下哪里可以下载到合适的实验数据吗,看batch里面有用到amazon的某些数据,不过搜索了一下没有找到哪里可以下载,非常感谢,:)
I wanted to use this library to build a prediction model, that would classify incoming data from other part of the app. The problem is that there is no documentation and not even a FAQ of some sort and I'm wondering if someone could add some. A few examples would drastically improve learning curve.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.