使用C#运行weka分类器

时间:2012-03-27 10:40:13

标签: c# command-line weka

我正在尝试使用以下代码通过C#运行分类器。在命令行上,这可以正常工作,但在通过C#运行时有一些问题。请看一下

{
    ...
    ProcessStartInfo exeStartInfo = new ProcessStartInfo();

    exeStartInfo.WorkingDirectory = @"c:\Program Files\Weka-3-6";

    exeStartInfo.UseShellExecute = false;
    exeStartInfo.RedirectStandardOutput = true;
    exeStartInfo.RedirectStandardError = true;
    exeStartInfo.CreateNoWindow = true;
    exeStartInfo.FileName = "cmd.exe";
    exeStartInfo.Arguments = "java -classpath \"C:\\Program Files\\Weka-     3-6\\weka.jar\" weka.classifiers.bayes.NaiveBayes -t data\\iris.arff -i > c:\\users  \\A\\Desktop\\out.txt";
    Process comd_line;
    using (comd_line = new Process())
    {
        comd_line.StartInfo = exeStartInfo;
        comd_line.Start();
    }

    comd_line.Dispose();
    comd_line.Close();

}

0 个答案:

没有答案