caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Francois BERENGER <berenger@bioreg.kyushu-u.ac.jp>
To: caml-list <caml-list@inria.fr>
Subject: [Caml-list] [ANN] first release of orsvm-e1071 (SVM from R usable from OCaml)
Date: Mon, 26 Feb 2018 15:07:24 +0900	[thread overview]
Message-ID: <2db0a056-4049-da6a-c12c-b36d21301014@bioreg.kyushu-u.ac.jp> (raw)

Hello,

I created a thin OCaml wrapper to drive two famous SVM packages for R:
e1071 and svmpath.

The code is here:
https://github.com/UnixJunkie/orsvm-e1071

This package provides two modules:
- Svm: this one provides access to a Support Vector Machine
       with a Radial Basis Function (RBF) or a linear kernel.
       This is a binary classifier.
---
type gamma = float
type kernel = RBF of gamma
            | Linear
type filename = string

val train: ?debug:bool ->
  cost:float -> kernel -> filename -> filename -> Result.t
val predict: ?debug:bool -> Result.t -> filename -> Result.t
val read_predictions: Result.t -> float list
---

- Svmpath: this one provides only access to a SVM with a linear
           kernel, but it allows to quickly find all values
           that need to be tested to obtain the best classifier.
           This is also a binary classifier.
---
type filename = string

val train: ?debug:bool -> filename -> filename -> Result.t
val read_lambdas: ?debug:bool -> Result.t -> float list
val predict: ?debug:bool ->
  lambda:float -> Result.t -> filename -> Result.t
val read_predictions: Result.t -> float list
---

The file src/test.ml is a working example of all functionalities.

There are example data and label files under data/.

I don't claim the package is super efficient.
For example, data are exchanged via text files.
However, it is a proof of concept on how to quickly access
some functionality provided by an R package.

If you want the package to be more efficient or provide access to more
functionalities of the underlying R packages, your help is welcome.

Thanks to Ronan Lehy for help with understanding how to use the svmpath
package.

The corresponding package should appear soon in opam.

Regards,
F.

             reply	other threads:[~2018-02-26  6:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-26  6:07 Francois BERENGER [this message]
2018-03-19  1:33 ` [Caml-list] [ANN] first release of orxgboost (gradient-boosted trees from R usable in OCaml) Francois BERENGER

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2db0a056-4049-da6a-c12c-b36d21301014@bioreg.kyushu-u.ac.jp \
    --to=berenger@bioreg.kyushu-u.ac.jp \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).