The source can be obtained from git at http://git.optunity.net (recommended), releases can be obtained from http://releases.optunity.net. Optunity is compatible with Python 2.7 and 3.x. Note that you must have Python installed before Optunity can be used (all Linux distributions have this, but Windows requires explicit installation).
Obtaining the latest version of Optunity using git can be done as follows:
git clone https://github.com/claesenm/optunity.git
Installation instructions per environment:
- Installing Optunity for Python
- Installing Optunity for MATLAB
- Installing Optunity for Octave
- Installing Optunity for R
- Installing Optunity for Java
If you encounter any difficulties during installation, please open an issue at https://github.com/claesenm/optunity/issues.
|[DEAP2012]||Fortin, Félix-Antoine, et al. “DEAP: Evolutionary algorithms made easy.” Journal of Machine Learning Research 13.1 (2012): 2171-2175.|
Installing Optunity for Python¶
If you want to use Optunity in another environment, this is not required. Optunity can be installed as a typical Python package, for example:
Add Optunity’s root directory (the one you cloned/extracted) to your
PYTHONPATHenvironment variable. Note that this will only affect your current shell. To make it permanent, add this line to your .bashrc (Linux) or adjust the PYTHONPATH variable manually (Windows).
PYTHONPATHin Linux (not permanent):
PYTHONPATHin Windows (not permanent):
Install using Optunity’ setup script:
python optunity/setup.py install [--home=/desired/installation/directory/]
Install using pip:
pip install optunity [-t /desired/installation/directory/]
After these steps, you should be able to import
python -c 'import optunity'
Installing Optunity for MATLAB¶
To install Optunity for MATLAB, you must add <optunity>/wrappers/matlab/ and its subdirectories to your MATLAB path. You can set the path in Preferences -> Path or using the following commands:
After these steps, you should be able to run the examples in <optunity>/wrappers/matlab/optunity_example.m:
The MATLAB wrapper requires the entire directory structure of Optunity to remain as is. If you only copy the <optunity>/wrappers/matlab subdirectory it will not work.
Installing Optunity for Octave¶
Optunity requires sockets for communication. In Octave, please install the sockets package first (available at Octave-Forge) and at http://octave.sourceforge.net/sockets/.
To install Optunity for Octave, you must add <optunity>/wrappers/octave/ and its subdirectories to your Octave path:
After these steps, you should be able to run the examples in <optunity>/wrappers/octave/optunity/example/optunity_example.m:
The Octave wrapper requires the entire directory structure of Optunity to remain as is. If you only copy the <optunity>/wrappers/octave subdirectory it will not work.
Installing Optunity for R¶
First install all dependencies. In R, issue the following command:
install.packages(c("rjson", "ROCR", "enrichvs", "plyr"))
Subsequently, clone the git repository and then issue the following commands:
cd optunity/wrappers R CMD build R/ R CMD INSTALL optunity_<version number>.tar.gz
Installing Optunity for Java¶
Optunity is available for Java through Jython (v2.7+). To use Optunity via Jython the Python package must be installed first (see above).