skip to navigation
skip to content

weka 0.1.3

A Python wrapper for the Weka data mining library.

Provides a convenient wrapper for calling Weka classifiers from Python.


Install Weka. On Debian/Ubuntu this is simply:

sudo apt-get install weka

Install the Python package:

sudo pip install -U


Train and test a Weka classifier by instantiating the Classifier class, passing in the name of the classifier you want to use:

from weka.classifiers import Classifier
c = Classifier(name='weka.classifiers.lazy.IBk', ckargs={'-K':1})
predictions = c.predict('query.arff')

Alternatively, you can instantiate the classifier by calling its name directly:

from weka.classifiers import IBk
c = IBk(K=1)
predictions = c.predict('query.arff')

The instance contains Weka’s serialized model, so the classifier can be easily pickled and unpickled like any normal Python instance:'myclassifier.pkl')
c = Classifier.load('myclassifier.pkl')
predictions = c.predict('query.arff')
File Type Py Version Uploaded on Size
weka-0.1.3.tar.gz (md5) Source 2013-11-06 14KB
  • Downloads (All Versions):
  • 1 downloads in the last day
  • 46 downloads in the last week
  • 197 downloads in the last month