Closed erelsgl closed 2 weeks ago
Unfortunately, no. The above link points to a really old and heavily modified version of Weka 3.7.2. sklearn-weka-plugin uses Weka 3.9.6.
But, you can still use the modified Weka version if you are willing to be a bit more low-level. This is possible using the jpype library:
# tested with
# - Java 1.8.0_292
# - Python 3.8.10
# - jpype 1.5.0
import jpype
import jpype.imports
from jpype import JClass
# start jvm
jvm_args = ["-Xmx1g"]
cp = ["./WEKA-LR.jar", "./lib/*"]
jpype.startJVM(*jvm_args, classpath=cp, convertStrings=True)
from weka.core.converters.ConverterUtils import DataSource
data = DataSource.read("./datasets/bodyfat_dense.xarff")
data.setClassIndex(data.numAttributes() - 1)
lrt = JClass("weka.classifiers.labelranking.LRT")()
lrt.setOptions([]) # set appropriate options
lrt.buildClassifier(data)
print(lrt)
# stop jvm
jpype.shutdownJVM()
I do not really need the old version - I just need any algorithm for label ranking. Is there any label ranking algorithm that can be used with sklearn-weka-plugin directly?
I've never used label ranking and am not aware of such an algorithm in Weka. Have you checked the available Weka packages whether there is one in there?
Hi. I would like to use algorithms for label ranking in Python. The algorithms are available in Weka here: https://en.cs.uni-paderborn.de/is/research/research-projects/software/weka-lr-a-label-ranking-extension-for-weka Is it possible to use them through sklearn-weka-plugin? I am particularly interested in the decision tree based algorithm (also called LRT - "label ranking tree"). Thanks!