using MultiLayerPerceptron from Weka with IKVM.NET

712 Views Asked by At

I'm trying to use the weka.classifiers.functions.MultilayerPerceptron as classifier on Weka using IKVM.NET but I keep getting the following exception: "Could not load file or assembly 'IKVM.OpenJDK.SwingAWT, Version=7.0.4335.0, Culture=neutral, PublicKeyToken=13235d27fcbfff58' or one of its dependencies. The system cannot find the file specified." I referenced every IKVM assembly I found on the IKVM folder, including IKVM.OpenJDK.SwingAWT, it's a very simple code:

var classifier = new weka.classifiers.functions.MultilayerPerceptron();
classifier.setOptions(weka.core.Utils.splitOptions("weka.classifiers.functions.MultilayerPerceptron -L 0.7 -M 0.3 -N 75 -V 0 -S 0 -E 20 -H a"));

And the exception is thrown whenever the first line is run, if I create another classifier, like NaiveBayes for instance, it works just well.

Does anyone knows anything I could try to fix this problem? Thanks in advance!

1

There are 1 best solutions below

0
On BEST ANSWER

the culprit turned out to be the class library, I had a class library called IA which stored all the weka stuff, and inside it I had a class called Analyzer which was trying to invoke the MultiLayerPerceptron classifier, so I "decorated" the class with a [MTAThread()] attribute and it is working now