package libsvm
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=891ec109a25c2bc28b6e35faa039b8e022242ef2075df9b25c11d8d88a59203d
md5=481ed4d3e65418bfd533bd13cf0a623b
Description
LIBSVM-OCaml is an OCaml library with bindings to the 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.
README
LIBSVM-OCaml - LIBSVM Bindings for OCaml
LIBSVM-OCaml is an OCaml library with bindings to the 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
$ opam install libsvm
From Source
$ make
$ make install
Usage
Documentation
The API-documentation of this distribution can be built with make doc
. It can also be found online.
Examples
This simple program solves the famous XOR-problem:
:::ocaml
open Lacaml.D
open Libsvm
let () =
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}
done
For 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 gu.oliver@yahoo.com