Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
med:lab_5 [2018/05/12 23:23]
pszwed [Kod]
med:lab_5 [2018/05/12 23:26]
pszwed [IDE]
Line 24: Line 24:
   * Utwórz projekt   * Utwórz projekt
   * Wybierz: //Project -> Properties -> Java Build Path.// Następnie zakładkę //Libraries// i opcję //Add External JARs//. Dodaj bibliotekę ''weka.jar ''   * Wybierz: //Project -> Properties -> Java Build Path.// Następnie zakładkę //Libraries// i opcję //Add External JARs//. Dodaj bibliotekę ''weka.jar ''
 +
 +
 +Dost
 ===== Kod ===== ===== Kod =====
  
Line 104: Line 107:
 saver.writeBatch(); saver.writeBatch();
 </code> </code>
 +
 +5.4.2
 +<code java>
 +Classifier cls;
 +cls = new NaiveBayes();
 +
 +Evaluation eval = new Evaluation(data);
 +eval.crossValidateModel(cls, data, 10, new Random(1));
 +
 +eval.toSummaryString()
 +eval.confusionMatrix()
 +System.out.printf(Locale.US,
 +"[prec recall fmeasure]:\t%f\t%f\t%f\n",
 +eval.weightedPrecision(),
 +eval.weightedRecall(),
 +eval.weightedFMeasure());
 +
 +</code>
 +
 +
CC Attribution-Share Alike 4.0 International
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0