Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pveber/libsvm-ocaml
LIBSVM Bindings for OCaml
https://github.com/pveber/libsvm-ocaml
bindings machine-learning ocaml support-vector-machines svm
Last synced: 28 days ago
JSON representation
LIBSVM Bindings for OCaml
- Host: GitHub
- URL: https://github.com/pveber/libsvm-ocaml
- Owner: pveber
- License: other
- Created: 2019-08-15T21:33:24.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-09-05T20:38:32.000Z (over 5 years ago)
- Last Synced: 2024-11-09T00:12:23.484Z (3 months ago)
- Topics: bindings, machine-learning, ocaml, support-vector-machines, svm
- Language: C++
- Size: 190 KB
- Stars: 2
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGES.txt
- License: LICENSE.txt
Awesome Lists containing this project
README
LIBSVM-OCaml - LIBSVM Bindings for OCaml
========================================---------------------------------------------------------------------------
LIBSVM-OCaml is an [OCaml](http://www.ocaml.org) library with bindings to the
[LIBSVM](http://www.csie.ntu.edu.tw/~cjlin/libsvm/) library, which is a library
for Support Vector Machines. Support Vector Machines are used to create
supervised learning models for classification and regression problems in
machine learning.Installation
------------From [OPAM](http://opam.ocaml.org)
$ opam install libsvm
From Source
$ make
$ make installUsage
-----### Documentation
The API-documentation of this distribution can be built with `make doc`.
It can also be found [online](http://ogu.bitbucket.io/libsvm-ocaml/api/).### Examples
This simple program solves the famous XOR-problem:
:::ocaml
open Lacaml.D
open Libsvmlet () =
let x = Mat.of_array
[|
[| 0.; 0. |];
[| 0.; 1. |];
[| 1.; 0. |];
[| 1.; 1. |];
|]
in
let targets = Vec.of_array [| 0.; 1.; 1.; 0. |] in
let problem = Svm.Problem.create ~x ~y:targets in
let model = Svm.train ~kernel:`RBF problem in
let y = Svm.predict model ~x in
for i = 1 to 4 do
Printf.printf "(%1.0f, %1.0f) -> %1.0f\n" x.{i,1} x.{i,2} y.{i}
doneFor more examples please refer to the `examples`- or `test`-directory of this
distribution.Credits
-------* Dominik Brugger wrote the initial release (0.1) of this library.
Contact Information
-------------------In case of bugs, feature requests and similar, please contact:
* Oliver Gu