Java 如何使用斯坦福分类器的交叉验证?

Java 如何使用斯坦福分类器的交叉验证?,java,nlp,stanford-nlp,Java,Nlp,Stanford Nlp,我已经下载了stanford分类器,想做交叉验证。它有方法交叉验证,所以我使用了以下代码: ColumnDataClassifier cdc = new ColumnDataClassifier("examples/iris2007.prop"); Pair<GeneralDataset<String,String> , List<String[]>> cv = cdc.readTestExamples("examples/iris.train");

我已经下载了stanford分类器,想做交叉验证。它有方法交叉验证,所以我使用了以下代码:

ColumnDataClassifier cdc = new ColumnDataClassifier("examples/iris2007.prop");
    Pair<GeneralDataset<String,String> , List<String[]>> cv = cdc.readTestExamples("examples/iris.train");
    Pair<Double, Double> result = cdc.crossValidate(cv.first(), cv.second());
ColumnDataClassifier cdc=新的ColumnDataClassifier(“examples/iris2007.prop”);
配对cv=cdc.readTestExamples(“examples/iris.train”);
Pair result=cdc.crossValidate(cv.first(),cv.second());

但它的精度和宏F都报告为0.00。我是否在代码中遗漏了一些可以正常工作的内容

你找到解决办法了吗?如果你能分享它,那会很有帮助。@sangam;您应该在特性的prop文件中添加
crossValidationFolds=10
printCrossValidationDecisions=true
shuffleTrainingData=true