简体   繁体   English

SMOreg在Java代码中花费了太多时间

[英]SMOreg taking too much time in java code

I am using SMOreg(SVM regression) from weka in my java code. 我在我的Java代码中使用来自weka的SMOreg(SVM回归)。 It is taking more than 30 min at buildClassifier() method. 在buildClassifier()方法上花费的时间超过30分钟。 When I ran same inputs through weka gui toolbox it is hardly taking 2 mins. 当我通过weka gui工具箱运行相同的输入时,几乎不需要2分钟。 Here is part of my code. 这是我的代码的一部分。

Instances trainD = DataSource.read(trin_file);
trainD.setClassIndex(trainD.numAttributes()-1);
SMOreg predict = new SMOreg();
predict.buildClassifier(trainD);

Is there any specific reason to take longer time in java-code for same task? 是否有任何特定原因需要花费更长的时间在Java代码中完成同一任务?

You're probably not passing all of the same options. 您可能没有通过所有相同的选项。 Also, make sure you're allocating the same amount of memory for running the GUI and running your native java code. 另外,请确保为运行GUI和运行本机Java代码分配的内存量相同。

In general, regression takes a while. 通常,回归需要一段时间。 As one example, I had an experiment that took about 2 hours to run using SMO/SVM (classification). 举一个例子,我做了一个实验,使用SMO / SVM(分类)花费了大约2个小时。 When I changed the class attribute to be continuous, and ran SMOreg, it took over a day to run. 当我将class属性更改为Continuous并运行SMOreg时,它花了一天的时间来运行。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM