1

I've installed weka and the python-weka-wrapper.

I got as far as

from weka.classifiers import Classifier
clf=Classifier(classname="weka.classifiers.rules.JRip")

from random import randint
X = [[randint(1,10) for _ in range(5)] for _ in range(100)]
y = [randint(0,1) for _ in range(100)]

but now I don't know how to load my data which is available as a Python data structure.

How can I load my data matrices, output the rules (in some parsable format) and test the classifier on new data?

1 Answer 1

2

You can create data on the fly, by defining the structure (ie attributes) and then adding the data rows. Also, I added a convenience method to instantiate Instances to the weka.core.dataset module called create_Instances_from_lists, which is scheduled for the next release. This question has been answered on the project's mailing list as well, including examples and pointers.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.