0

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!

leandro koiti
  • 423
  • 1
  • 7
  • 18
  • something weird I noticed, if I create a console application and try to run the same code it works, maybe the problem has something to do with me trying to run this code from a class library? – leandro koiti May 17 '12 at 20:15
  • it turned to be the class library the culprit, I had a class library called IA which stored all the weka stuff, and inside 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 – leandro koiti May 17 '12 at 20:22

1 Answers1

0

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

leandro koiti
  • 423
  • 1
  • 7
  • 18