Find file
c7fded3 Oct 2, 2015
executable file 160 lines (103 sloc) 4.07 KB

Optunity Documentation Status

Optunity is a library containing various optimizers for hyperparameter tuning. Hyperparameter tuning is a recurrent problem in many machine learning tasks, both supervised and unsupervised.This package provides several distinct approaches to solve such problems including some helpful facilities such as cross-validation and a plethora of score functions.

Getting started

Obtaining Optunity

From an optimization point of view, the tuning problem can be considered as follows: the objective function is non-convex, non-smooth and typically expensive to evaluate. Tuning examples include optimizing regularization or kernel parameters.

The figure below shows an example response surface, in which we optimized the hyperparameters of an SVM with RBF kernel. This specific example is available at :doc:`/notebooks/notebooks/local-optima`.

SVM hyperparameter response surface

The Optunity library is implemented in Python and allows straightforward integration in other machine learning environments. Optunity is currently also supported in |wrapper-r|, |wrapper-matlab|, |wrapper-octave| and Java through Jython.

If you have any problems, comments or suggestions you can get in touch with us at gitter:

Join the chat at

Optunity is free software, using a BSD-style license.


As a simple example of Optunity's features, the code below demonstrates how to tune an SVM with RBF kernel using Optunity and scikit-learn. This involves optimizing the hyperparameters gamma and C:

.. literalinclude:: /examples/python/sklearn/
    :language: python
    :emphasize-lines: 6,13

For more examples, please see our |examples|.

Quick setup

Issue the following commands to get started on Linux:

git clone
export PYTHONPATH=$PYTHONPATH:$(pwd)/optunity/

Afterwards, importing optunity should work in Python:

python -c 'import optunity'

For a proper installation, run the following:

python optunity/ install

or, if you have pip:

pip install optunity

Installation may require superuser priviliges.

Developer Guide



Optunity is developed at the STADIUS lab of the dept. of electrical engineering at KU Leuven (ESAT). The main contributors to Optunity are:

Marc Claesen

  • Python package
  • framework design & implementation
  • solver implementation
  • communication protocol design & implementation
  • MATLAB wrapper
  • Octave wrapper
  • Python, MATLAB and Octave examples

Jaak Simm

  • communication protocol design
  • R wrapper
  • R examples

Vilen Jumutc

  • Julia wrapper

Indices and tables

.. toctree::
    :maxdepth: 2