Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

AutoWeka for python

Project Description



pyautoweka is a python wrapper for [Auto-WEKA](, a Java application for algorithm selection and hyperparameter optimizations, that is build on [WEKA](


Download, go to the project sources and install:
git clone
cd pyautoweka
python install

Running an experiment

AutoWeka for python.

import pyautoweka

#Create an experiment
experiment = pyautoweka.Experiment(tuner_timeout=9000)
`tuner_timeout` is the time the optimization will run in seconds. So e.g. 9000 seconds = 2.5 hours. The longer you run the optimization, the better of course. (Note that the `experiment` object has an interface similar to sklearn classifiers.)

First we need to load some data. Let's for example the the famous [Iris dataset]( Download it using [this link](

Let's load it into python:

#load the data:
import numpy as np
import random

X = np.loadtxt("", delimiter=",", usecols=range(4))
y = np.loadtxt("", delimiter=",", usecols=[4], dtype="object")

#shuffle the data:
indices = range(len(X))
X = X[indices]
y = y[indices]

#split into train and test set:
X_train = X[0:100]
y_train = y[0:100]

X_test = X[100:]
y_test = y[100:]

#now we can fit a model:, y_train)

#and predict the labels of the held out data:
y_predict = experiment.predict(X_test)

#Let's check what accuracy we get:
num_correct = sum([1 for predicted, correct in zip(y_predict, y_test) if predicted == correct])
print "Accuracy: %f" % float(num_correct) / len(y_test)

This should give you an accuracy in the high 90%s.

Advanced: Selecting specific classifiers

When you don't set a specific classifier all available classifiers will be tried. You have the option to limit the search to certain classifiers as follows:

First of all let's see what classifiers are available:

import pyautoweka

Now let's say we want to just use the Simple Logistic classifier:

Advanced: files created

When you create a new experiment theres a bunch of files that will be generated before and during the run of AutoWeka. For each experiment there will be a new folder within in the `experiments` folder. The folder will have the name of the experiment, if it was specified in the constructor. Each time you fit data a tempraroy arff file will be created that holds all the data in it. This file will be delete after the `fit` call.

Release History

This version
History Node


History Node


History Node


Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Hash SHA256 Hash Help Version File Type Upload Date
(18.3 MB) Copy SHA256 Hash SHA256
Source Jul 9, 2014

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting