A New Parallel Framework for Machine Learning


Java and Jython/Python interface

We provide a simple API to GraphLab for Java, using Java Native Interface (JNI). On top of this, we also provide a Python -interface using Jython. It is straightforward to write your own wrappers to other Java-enabled scripting languages.


If you do not want to install the whole GraphLab C++ installation, you can simply download the Java interface from here: graphlab_java_20101210.tar.gz. We currently provide 64-bit Linux and Mac binary versions of the native library. For other platforms, you need to build your own (see README.txt for instructions).

Consult README.txt for instructions on how to build the Java API and how to run the example applications.

(Java interface is also located as part of the main source distribution under directory extapis).

Java API for GraphLab

Java API for GraphLab is a 100% POJO (Plain Old Java Object) interface, and requires minimum of boilerplate code to get started. You can use any Java libraries and you are not required to write any "wrapper" code in C/C++. Here are the steps required for writing a full GraphLab application in Java:


GraphLab Java API Documentation.


Package demo includes a couple of simple examples that demonstrate basic GraphLab functionality such as prioritized scheduling and multiple update functions. In the package, directory examples includes scripts to run these demos.

Python/Jython API

We have built on top of the GraphLab Java API a Python/Jython interface. While the performance is not excellent (compared to native code), it provides a very easy way to start writing GraphLab programs. Python programs are typically much more concise than Java or C++ applications, and allow for quick experimenting. Note: Python API is in an early stage, but is almost fully functional (multiple update functions are not supported).


To use the Jython interface, you only need to install the Java Graphlab API (instructions above). Full GraphLab Java API is available for the Python scripts.

GraphLab python program consists of four separate script-files: To run your Python program, you need to run following java command line (example from Pagerank demo):

java -Xmx500m -Djava.library.path=../native/ graphlab.wrapper.PythonGraphlab testdata/stoch30x.csv


Directory examples/ contains two Python demo scripts. Actual scripts are under directory python/.

Tutorial: Lasso Linear Regression using Python GraphLab

Tutorial for GraphLab Python API: Lasso Shooting Algorithm (PDF).