https://github.com/tetsuok/go-pegasos
An implementation of the Pegasos algorithm for solving Support Vector Machines in Go
https://github.com/tetsuok/go-pegasos
Last synced: about 1 year ago
JSON representation
An implementation of the Pegasos algorithm for solving Support Vector Machines in Go
- Host: GitHub
- URL: https://github.com/tetsuok/go-pegasos
- Owner: tetsuok
- License: bsd-3-clause
- Created: 2012-05-25T15:59:31.000Z (about 14 years ago)
- Default Branch: master
- Last Pushed: 2015-01-18T09:14:31.000Z (over 11 years ago)
- Last Synced: 2025-04-13T13:06:48.868Z (about 1 year ago)
- Language: Go
- Homepage:
- Size: 198 KB
- Stars: 7
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
go-pegasos
==========
An implementation of the Pegasos algorithm [1] for solving Support Vector Machines in Go.
Build Instructions
------------------
### Software Requirements ###
* [Go](http://golang.org/)
### Get the code ###
$ go get github.com/tetsuok/go-pegasos
### Installation of commands ###
$ go install github.com/tetsuok/go-pegasos/pegasos_learn
$ go install github.com/tetsuok/go-pegasos/pegasos_test
### Testing ###
$ go test github.com/tetsuok/go-pegasos/pegasos
If you want to run testing including benchmarks, use `check.sh`
$ ./check.sh
Usage
-----
### Data format ###
go-pegasos accepts the same representation of training data as
[SVMlight](http://svmlight.joachims.org/) uses. This format has
potential to handle large sparse feature vectors.
### Training ###
$ ./pegasos_learn -m model_file train_file
Please note "-m" is required to save the trained model.
#### Options #####
* -k INT: number of block size.
* -lambda FLOAT: Regularization parameter
* -m STRING: model file
* -r INT: seed
* -t INT: number of iterations
* -test STRING: If you set a test file, you can do training and testing at a time.
### Testing with trained model ###
$ ./pegasos_test test_file model_file
### Reference ####
[1] Shalev-Shwartz, Shai and Singer, Yoram and Srebro,
Nathan. Pegasos: Primal Estimated sub-GrAdient SOlver for SVM.
In Proceedings of the 24th international conference on Machine learning
(ICML). 2007. pages 807-814.