Skip to content

Commit

Permalink
Modified CV for MLkNN
Browse files Browse the repository at this point in the history
  • Loading branch information
i02momuj committed Feb 27, 2019
1 parent 43c86af commit 2c00177
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions src/executeMulan/mlc/ExecuteMLkNN.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,16 @@ public void execute (String tvalue, String Tvalue, String xvalue, String ovalue,
time_in = System.currentTimeMillis();

learner = new MLkNN();
learner.build(trainingSet);

measures = prepareMeasuresClassification(trainingSet);
results = eval.evaluate(learner, testSet, measures);

measures = prepareMeasuresClassification(trainingSet);

if(nFolds > 0) {
mResults = eval.crossValidate(learner, trainingSet, measures, nFolds);
}
else {
learner.build(trainingSet);
results = eval.evaluate(learner, testSet, measures);
}

time_fin = System.currentTimeMillis();

Expand All @@ -28,7 +34,12 @@ public void execute (String tvalue, String Tvalue, String xvalue, String ovalue,
System.out.println("Execution time (ms): " + total_time);

printHeader(lvalue);
printResults(Tvalue, lvalue, "MLkNN");
if(nFolds <= 0) {
printResults(Tvalue, lvalue, "MLkNN");
}
else {
printResultsCV(tvalue, lvalue, "MLkNN");
}
}
catch(Exception e1)
{
Expand Down

0 comments on commit 2c00177

Please sign in to comment.