Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Object does not implement or subclass weka.classifiers.Classifier: __builtin__.list #52

Closed
colingoldberg opened this issue Jul 10, 2017 · 1 comment

Comments

@colingoldberg
Copy link

colingoldberg commented Jul 10, 2017

Hi,

As a weka novice, I ran a test of auto-weka using the weka python wrapper, getting this error. The test was run on an AWS EC2 Linux instance.

My python script is as follows:

import weka.core.packages as packages
from weka.classifiers import Classifier
from weka.core.converters import Loader
from weka.core.dataset import Instances
from weka.classifiers import Classifier
import weka.core.serialization as serialization
import weka.core.jvm as jvm

jvm.start()

loader = Loader("weka.core.converters.ArffLoader")
data = loader.load_file('./weather.arff')
data.class_is_last()
classifier = Classifier("weka.classifiers.meta.AutoWEKAClassifier",
["-seed", "123", "-timeLimit", "15", "-memLimit", "1024",
"-nBestConfigs", "1", "-metric", "errorRate", "-parallelRuns", "1"])
classifier.build_classifier(data)
outfile = './weather.model'
serialization.write_all(outfile, [classifier, Instances.template_instances(data)])

jvm.stop()
quit()

End of script

Both WEKA_JAR_PATH and CLASSPATH were explicitly exported.
export WEKA_JAR_PATH=/usr/local/share/weka/weka-3-8-1/weka.jar
export CLASSPATH=/usr/local/share/weka/weka-3-8-1/weka.jar

The Auto-Weka package was installed as follows:
java weka.core.WekaPackageManager -install-package Auto-WEKA

The traceback output was:
Traceback (most recent call last):
File "autoweka.py", line 16, in
"-nBestConfigs", "1", "-metric", "errorRate", "-parallelRuns", "1"])
File "/usr/local/lib/python2.7/site-packages/weka/classifiers.py", line 54, in init
self.enforce_type(jobject, "weka.classifiers.Classifier")
File "/usr/local/lib/python2.7/site-packages/weka/core/classes.py", line 573, in enforce_type
raise TypeError("Object does not implement or subclass " + intf_or_class + ": " + get_classname(jobject))
TypeError: Object does not implement or subclass weka.classifiers.Classifier: builtin.list

I bring this to your attention, not really knowing if I omitted something or if this is a bug.

Can you help?

Colin Goldberg

@larskotthoff
Copy link
Collaborator

This looks like a bug with the Python wrapper. I don't have any experience with this, sorry!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants