reflection - LIbSVM of Weka in C# with IKVM -
i using weka machine learning library in c# ikvm. far worked well, however, having problem using libsvm package.
the problem appears when want instantiate libsvm classifier in c# (the class not found), advised:
abstractclassifier classifier = (abstractclassifier)java.lang.class.forname("weka.classifiers.functions.libsvm").newinstance();
what tried:
- add the libsvm.dll , weka.dll project (converted libsvm.jar , weka.jar)
- merge libsvm.jar , weka.jar 1 dll , add project (using ikvm or ilmerge)
note package installed since appears in result of
wekapackagemanager.getinstalledpackages();
has every succeeded using weka libsvm in c# using ikvm?
thanks, botond
i hava same problem ,but found solution website:here.
i use weka.jar(version 3.6) , libsvm package weka 3.8 {home}/wekafiles/packages/libsvm
step 1. need: weka.jar, libsvm.jar(libsvm/libsvm.jar), libsvm.jar (libsvm/lib/libsvm.jar).
step 2. rename libsvm.jar libsvm1.jar.
step 3. run in ikvm: open command line , go ikvm's bin folder
ikvmc.exe -sharedclassloader -target:library weka.jar libsvm.jar libsvm1.jar
step 4. reference generated weka.dll in c# project.
step 5.sample code in c#
libsvm svm = new libsvm(); svm.setoptions(weka.core.utils.splitoptions("-s 3 -k 2 -d 3 -g 0.0 -r 0.0 -n 0.5 -m 40.0 -c 1.0 -e 0.001 -p 0.1 -seed 1")); svm.buildclassifier(dataset);
Comments
Post a Comment