- November 9, 2014
- Eleftherios Bampaletakis
- . 2 Feedback
On this information we’re going to focus on the way to set up and use the Datumbox Machine Studying framework in your Java initiatives. Since nearly the entire code is written in Java, utilizing it is so simple as together with it as dependency in your Java undertaking. Nonetheless a few lessons (DataEnvelopmentAnalysis and LPSolver) use an exterior C library referred to as lpsolve (Linear Programming Solver). Be aware that in the event you don’t plan to make use of these 2 lessons you aren’t required to put in any binary libraries in your system. Nonetheless if you wish to discover all of the supported algorithms it is strongly recommended to do the total set up as described beneath. This information covers the installations on Linux and Home windows methods and we offer references for putting in it on Mac OSX.
Earlier than utilizing the framework you have to to make it possible for Maven 3 is put in in your system. To validate this open up a console/terminal and kind the next:
mvn --version
Output:
Apache Maven 3.2.1 (ea8b2b07643dbb1b84b6d16e1f08391b666bc1e9; 2014-02-14T17:37:52+00:00) Maven residence: /usr/share/maven3 Java model: 1.8.0_25, vendor: Oracle Company Java residence: /usr/lib/jvm/java-8-oracle/jre Default locale: en_GB, platform encoding: UTF-8 OS identify: "linux", model: "3.13.0-34-generic", arch: "amd64", household: "unix"
If Maven 3 isn’t put in in your system observe this information. If you wish to find out how Maven works try this information. Lastly to see the way to use Maven in your favorite IDE checkout the next Eclipse and Netbeans tutorials.
The framework makes use of lpsolve 5.5.2.0 to unravel linear programming issues. Be aware that it is rather essential to put in the right model of the library to keep away from issues. Thus don’t use the bundle supervisor of your working system as a result of generally you’ll not discover the most recent variations.
To make use of the library you’ll want to set up 2 binary recordsdata: the liblpsolve55 dev library which solves linear packages and the liblpsolve55j which is a Java wrapper. Despite the fact that you’ll be able to obtain the recordsdata from the official web site and observe their set up information, on this tutorial we attempt to preserve issues so simple as attainable and supply our personal set up information.
The very first thing you have to to do is go to our Github LpSolve repository and obtain the undertaking. When you unzip it, go to the lib folder. There one can find 5 subfolders that comprise the binary libraries for the preferred working methods in 32bit and 64bit flavours. When you work on Home windows click on on win32 or win64 folders, if you’re on Unix/Linux click on on the ux32 or ux64 folder, whereas in the event you use Mac OSX click on on the mac folder. To put in the library all it’s important to do is copy these recordsdata to the suitable folders of your working system.
Lpsolve on Home windows
On Home windows all it’s important to do is copy the lpsolve55.dll and lpsolve55j.dll recordsdata and paste them within the C:WindowsSystem32 folder (the situation is identical each for the 32bit and 64bit variations of the library).
Lpsolve on Unix/Linux
On Unix/Linux you’ll want to copy the lpsolve55.so and lpsolve55j.so recordsdata within the lib listing of your working system. The placement would possibly differ relying on the distribution that you simply use. For instance in the event you use the 64bit flavour of Ubuntu 14.04 it’s best to copy the recordsdata to /usr/lib/ folder. Different variations or distributions would possibly require you to repeat them on barely completely different location (for instance on CentOS 6 makes use of the /usr/lib64/ folder as a substitute).
Be sure to keep away from putting in lpsolve through the use of bundle managers akin to yum or apt-get as a result of it’s extremely possible you’ll find yourself having the mistaken model of the library.
Lpsolve on Mac OSX
In case you are a Mac person try this tutorial on the way to compile and set up the lpsolve libraries.
Final however not least add the Datumbox Framework as a dependency in your Maven Challenge. To do that open the pom.xml of your undertaking along with your favorite IDE or editor and add it contained in the dependencies tag the next entry:
... ... com.datumbox datumbox-framework RELEASE
That’s it! Now you can use the framework in your undertaking!
