类型或命名空间名称' DataSource'无法找到

时间:2015-04-19 18:52:26

标签: java c# .net weka ikvm

我通过C#使用weka API。我已经使用ikvm将weka jar文件转换为C#DLL。然后我在我的参考文献中添加了转换后的DLL(wekacsharp.dll)。

我还在我的参考资料中添加了ikvm.gnu.classpath.dll,IKVM.OpenJDK.Core.dll,IKVM.OpenJDK.Util.dll,IKVM.OpenJDK.Text.dll,IKVM.OpenJDK.Core。

我正在尝试使用j48算法,但我收到错误。附上代码错误的屏幕截图。请检查并建议修复它。

            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

0 个答案:

没有答案