> I am trying to use GeneticSearch for attribute seleciton with the python-wekawrapper3 in python. I have tried to pass the option auto_install=True to the jvm.start() command, but it keeps failing. Shall I copy the .jar file and indicate (somehow) where to find this package?
Since you neither posted code nor error messages, I can't comment on
what's going wrong.
The following code executes just fine the second time it is execute
(during the first run, the missing package gets installed):
import weka.core.jvm as jvm
from weka.core.converters import load_any_file
from weka.attribute_selection import ASSearch
from weka.attribute_selection import ASEvaluation
from weka.attribute_selection import AttributeSelection
jvm.start(packages=True, auto_install=True)
data = load_any_file("/home/fracpete/development/datasets/uci/anneal.arff",
class_index="last")
search = ASSearch(classname="weka.attributeSelection.GeneticSearch", options=[])
evaluation = ASEvaluation(classname="weka.attributeSelection.CfsSubsetEval",
options=["-P", "1", "-E", "1"])
attsel = AttributeSelection()
attsel.search(search)
attsel.evaluator(evaluation)
attsel.select_attributes(data)
print(attsel.results_string)
jvm.stop()
Cheers, Peter
--
Peter Reutemann
Dept. of Computer Science
University of Waikato, Hamilton, NZ
Mobile
+64 22 190 2375
https://www.cs.waikato.ac.nz/~fracpete/
http://www.data-mining.co.nz/