The type or namespace name 'DataSource' could not be found- weka c#

down vote favorite


I am using weka api through c#. I have converted weka jar file to c# dll by using ikvm. Then I have added the converted dll (wekacsharp.dll) in my reference.


I have also added ikvm.gnu.classpath.dll, IKVM.OpenJDK.Core.dll, IKVM.OpenJDK.Util.dll, IKVM.OpenJDK.Text.dll, IKVM.OpenJDK.Core in my reference.


I am trying to use j48 algorithm but i am getting the error. Screen shot of code error is attached. Kindly check it and suggest me something to fix it. Thanks!



J48 J48_tree = new J48(); //Creating J48 tree instance
DataSource data_source = new DataSource("iris.arff");
Instances data = data_source.getDataSet();
if (data.classIndex() == -1)
data.setClassIndex(data.numAttributes() - 1);

J48_tree.buildClassifier(data); // Builds the classifier

javax.swing.JFrame j_frame = new javax.swing.JFrame("J48 Tree");

//final javax.swing.JFrame j_frame = new javax.swing.JFrame("J48 Tree");
j_frame.setSize(1200,700);
j_frame.getContentPane().setLayout(new BorderLayout());
TreeVisualizer tree_visualizer = new TreeVisualizer(null, J48_tree.graph(), new PlaceNode2());
j_frame.getContentPane().add(tree_visualizer, BorderLayout.CENTER);

j_frame.addWindowListener(new java.awt.event.WindowAdapter() {public void windowClosing(java.awt.event.WindowEvent e) {j_frame.dispose(); }});

j_frame.setVisible(true);
tree_visualizer.fitToScreen();


enter image description here enter image description here