简体   繁体   中英

Which are the possible options for pyweka multisearch function?

I have this code from the examples of pyweka documentation ( https://fracpete.github.io/python-weka-wrapper3/examples.html )

multi = MultiSearch(options=["-sample-size", "100.0", "-initial-folds", "2", "-subsequent-folds", "2","-num-slots", "1", "-S", "1"])           
multi.evaluation = "CC"
mparam = MathParameter()
mparam.prop = "classifier.kernel.gamma"
mparam.minimum = -3.0
mparam.maximum = 3.0
mparam.step = 1.0
mparam.base = 10.0
mparam.expression = "pow(BASE,I)"
lparam = ListParameter()
lparam.prop = "classifier.C"
lparam.values = ["-2.0", "-1.0", "0.0", "1.0", "2.0"]
multi.parameters = [mparam, lparam]
cls = Classifier(
    classname="weka.classifiers.functions.SMOreg",
    options=["-K", "weka.classifiers.functions.supportVector.RBFKernel"])
multi.classifier = cls
multi.build_classifier(data)
print("Model:\n" + str(multi))
print("\nBest setup:\n" + multi.best.to_commandline())

And when I execute it I'm having this problem:

JavaException                             Traceback (most recent call last)
/tmp/ipykernel_2021/2844706061.py in <module>
----> 1 multi = MultiSearch(options=['-sample-size', "100.0", "-initial-folds", "2", "-subsequent-folds", "2","-num-slots", "1", "-S", "1"])
      2 multi.evaluation = "CC"
      3 mparam = MathParameter()
      4 mparam.prop = "classifier.kernel.gamma"
      5 mparam.minimum = -3.0

JavaException: Illegal options: -sample-size 100.0 -initial-folds 2 -subsequent-folds 2 -num-slots 1 

I tried to find a solution, searching what are these options but did not find anything.

Thanks for pointing out that error in the documentation. It should just read:

multi = MultiSearch(options=["-S", "1"])

Just pushed out the updated documentation.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM