Month: May 2015

Calling Python’s scikit-learn machine learning library from Julia

It turns out to be very easy.

Here’s a python code for SVM classification

import sklearn.svm as sv
clf = sv.SVC(), y)
y_pred = clf.predict(X_test)

And here’s Julia code – utilizing PyCall module

using PyCall
@pyimport sklearn.svm as sv
clf = sv.SVC()
clf[:fit](X, y)
y_pred = clf[:predict](X_test)