README.rst 3.83 KB
Newer Older
André Anjos's avatar
André Anjos committed
1 2 3 4
.. vim: set fileencoding=utf-8 :
.. Andre Anjos <andre.anjos@idiap.ch>
.. Fri 13 Dec 2013 12:35:22 CET

André Anjos's avatar
André Anjos committed
5 6
.. image:: https://travis-ci.org/bioidiap/bob.learn.libsvm.svg?branch=master
   :target: https://travis-ci.org/bioidiap/bob.learn.libsvm
7 8
.. image:: http://img.shields.io/badge/docs-latest-orange.png
   :target: https://www.idiap.ch/software/bob/docs/latest/bioidiap/bob.learn.libsvm/master/index.html
André Anjos's avatar
André Anjos committed
9 10 11 12 13 14 15 16
.. image:: https://coveralls.io/repos/bioidiap/bob.learn.libsvm/badge.png
   :target: https://coveralls.io/r/bioidiap/bob.learn.libsvm
.. image:: http://img.shields.io/github/tag/bioidiap/bob.learn.libsvm.png
   :target: https://github.com/bioidiap/bob.learn.libsvm
.. image:: http://img.shields.io/pypi/v/bob.learn.libsvm.png
   :target: https://pypi.python.org/pypi/bob.learn.libsvm
.. image:: http://img.shields.io/pypi/dm/bob.learn.libsvm.png
   :target: https://pypi.python.org/pypi/bob.learn.libsvm
André Anjos's avatar
André Anjos committed
17

André Anjos's avatar
André Anjos committed
18 19 20
================================
 Bob-Python bindings for LIBSVM
================================
André Anjos's avatar
André Anjos committed
21

André Anjos's avatar
André Anjos committed
22
This package contains a set of Pythonic bindings for LIBSVM.
André Anjos's avatar
André Anjos committed
23

24 25 26 27 28 29 30 31 32
External Software Requirements
------------------------------

This package requires you have ``LIBSVM`` installed on your system. If
``LIBSVM`` is installed on a standard location, this package will find it
automatically. You can just skip to the installation instructions.

In case you have installed ``LIBSVM`` on a non-standard location (e.g. your
home directory), then you can specify the path to the root of that installation
André Anjos's avatar
André Anjos committed
33 34
using the environment variable ``BOB_PREFIX_PATH``, **before** building and
installing the package. For example, if ``BOB_PREFIX_PATH`` is set to
35 36 37 38 39 40 41
``/home/user/libsvm-3.12``, then we will search for the header file ``svm.h``
in ``/home/user/libsvm-3.12/include`` and expect that the library file file is
found under ``/home/user/libsvm-3.12/lib``.

If you are installing this package via ``pip`` for example, just set the
environment variable like this::

André Anjos's avatar
André Anjos committed
42
  $ BOB_PREFIX_PATH=/home/user/libsvm-3.12 pip install bob.learn.libsvm
43 44

If you are installing this package via ``zc.buildout``, we recommend you use
André Anjos's avatar
André Anjos committed
45 46
our `bob.buildout <http://pypi.python.org/pypi/bob.buildout>`_ extension and
set the ``[environ]`` section to define ``BOB_PREFIX_PATH``.
47

André Anjos's avatar
André Anjos committed
48 49 50
Installation
------------

51 52
Install it through normal means, via ``pip`` or use ``zc.buildout`` to
bootstrap the package itself and run test units.
André Anjos's avatar
André Anjos committed
53 54 55 56

Documentation
-------------

57 58 59
The latest version of the documentation can be found `here <https://www.idiap.ch/software/bob/docs/latest/bioidiap/bob.learn.libsvm/master/index.html>`_.

Otherwise, you can generate the documentation for this package yourself, after installation, using Sphinx::
André Anjos's avatar
André Anjos committed
60 61 62 63 64 65 66 67 68 69 70

  $ sphinx-build -b html doc sphinx

This shall place in the directory ``sphinx``, the current version for the
documentation of the package.

Testing
-------

You can run a set of tests using the nose test runner::

71
  $ nosetests -sv
André Anjos's avatar
André Anjos committed
72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87

.. warning::

   If Bob <= 1.2.1 is installed on your python path, nose will automatically
   load the old version of the insulate plugin available in Bob, which will
   trigger the loading of incompatible shared libraries (from Bob itself), in
   to your working binary. This will cause a stack corruption. Either remove
   the centrally installed version of Bob, or build your own version of Python
   in which Bob <= 1.2.1 is not installed.

You can run our documentation tests using sphinx itself::

  $ sphinx-build -b doctest doc sphinx

You can test overall test coverage with::

André Anjos's avatar
André Anjos committed
88
  $ nosetests --with-coverage --cover-package=bob.learn.libsvm
André Anjos's avatar
André Anjos committed
89 90 91 92 93 94 95 96 97 98 99 100 101 102 103

The ``coverage`` egg must be installed for this to work properly.

Development
-----------

To develop this package, install using ``zc.buildout``, using the buildout
configuration found on the root of the package::

  $ python bootstrap.py
  ...
  $ ./bin/buildout

Tweak the options in ``buildout.cfg`` to disable/enable verbosity and debug
builds.