3 ms·
Cool project. There are already a couple of Machine Learning libraries[1][2] written in Go and some of them are actually more mature than GoLearn. Also just c
by cnbuff410 12y ago
Cool project.
There are already a couple of Machine Learning libraries[1][2] written in Go and some of them are actually more mature than GoLearn.
Also just curious, I always thought Go is not really a good language for DM/ML stuff due to lack of good matrix library and generics. If someone here actually tried to write any ML library in Go, what's your genuine feeling about it?
[1] https://github.com/huichen/mlf https://github.com/huichen/mlf
[2] https://github.com/xlvector/hector https://github.com/xlvector/hector
- ajtulloch 12y agoI wrote a decision tree library (random forests, gradient boosting, etc) in Go while learning the language (https://github.com/ajtulloch/decisiontrees https://github.com/ajtulloch/decisiontrees). It's nice being able to trivially parallelise operations in Go - e.g. constructing the weak learners for a random forest, generating candidate splits, recursing down left and right branches, etc. // Recur down the left and right branches in parallel w := sync.WaitGroup{} recur := func(child **pb.TreeNode, e Examples) { w.Add(1) go func() { *child = c.generateTree(e, currentLevel+1) w.Done() }() } recur(&tree.Left, examples[bestSplit.index:]) recur(&tree.Right, examples[:bestSplit.index]) w.Wait() As you said, generics and a matrix library would be make the experience nicer. Just having sort :: Ord a => [a] -> [a] would strip a decent amount of mildly error-prone boilerplate, and there are other cases (splits for cross-validation, etc) where it would be nice to be able to abstract over the type of the slice, etc.
- micro_cam 12y agoI've got a decision tree/random forest implementation as well. [1] I originally hacked out go code to analyze forests from other programs but have ended up finishing it off and optimizing it to learn faster then other libraries I've tried for my use cases (wide data with lots of categorical and missing values). The language and tooling (pprof, go fmt, go doc) are great and make it quick to write and optimize stuff so it is well suited for my (largely experimental) purposes. I also really like slices for writing efficient code as they let you pre optimize and reuse arrays and not have to keep track of the ending position. Matrix libraries would be nice but you can call c ones via cgo. I am hopping for efficient pure go ones to be developed eventually so you can use them on app engine/nacl/exacycle or other untrusted code environments. [1] https://github.com/ryanbressler/CloudForest https://github.com/ryanbressler/CloudForest