Commits

Oliver Gu  committed b6f7142

Updated README file.

  • Participants
  • Parent commits 783f6da

Comments (0)

Files changed (1)

 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.
+[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
 ------------
 
-The easiest way to install the LIBSVM development files is by using APT:
-
-    $ apt-get install libsvm-dev
+From [OPAM](http://opam.ocamlpro.com)
 
-If you want to build and install LIBSVM from source, download the package
-[here](http://www.csie.ntu.edu.tw/~cjlin/libsvm/#download) and type in the
-package directory:
+    $ opam install libsvm-ocaml
 
-    $ make lib
-    $ mkdir /usr/include/libsvm
-    $ cp svm.h /usr/include/libsvm
-    $ cp libsvm.so.2 /usr/lib
-    $ ln -s /usr/lib/libsvm.so.2 /usr/lib/libsvm.so
-
-To build and install libsvm-ocaml:
+From Source
 
     $ make
     $ make install
 
-### Tests _(optional)_
 
-To build and execute tests:
+Usage
+-----
+
+### Documentation
 
-    $ ./configure --enable-tests
-    $ make test
+The API-documentation of this distribution can be built with `make doc`.
+It can also be found [here](http://ogu.bitbucket.org/libsvm-ocaml/api/).
 
-### Documentation _(optional)_
+### Examples
 
-To build the documentation:
+This simple program solves the famous XOR-problem:
 
-    $ make doc
+    :::ocaml
+    open Lacaml.D
+    open Libsvm
 
-It will then be installed by `make install`.
+    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 for LIBSVM 2.8.
+  * 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>