Skip main navigation

Do it yourself!

Peter Reutemann explains how to set up Python with Weka.

To set up Python with Weka you first need to install Python, and then install the python-weka-wrapper library for Python. You will probably need admin access to your computer for this.

You must ensure that your Python and Java versions have the same bitness, i.e. either 32 or 64 bits.

Java underwent dramatic changes under the hood, starting with Java 9. If you experience any issues, use Java 8 with python-weka-wrapper – it’s known to work on all platforms.

  • Download and install Python 3.x (installation is easy on Linux, but can be challenging on Windows and OSX)
  • Download and install the python-weka-wrapper3 library
  • Here are instructions for all this

Data files:

Evaluate a classifier and output summary statistics and a confusion matrix:

Plot the errors made by LinearRegression:

Display multiple ROC curves, one for each class:

This article is from the free online

Advanced Data Mining with Weka

Created by
FutureLearn - Learning For Life

Our purpose is to transform access to education.

We offer a diverse selection of courses from leading universities and cultural institutions from around the world. These are delivered one step at a time, and are accessible on mobile, tablet and desktop, so you can fit learning around your life.

We believe learning should be an enjoyable, social experience, so our courses offer the opportunity to discuss what you’re learning with others as you go, helping you make fresh discoveries and form new ideas.
You can unlock new opportunities with unlimited access to hundreds of online short courses for a year by subscribing to our Unlimited package. Build your knowledge with top universities and organisations.

Learn more about how FutureLearn is transforming access to education