@@ -0,0 +1,1483 @@
+import weka.core.Instances;%0Aimport weka.core.converters.ArffSaver;%0Aimport weka.core.converters.CSVLoader;%0Aimport weka.classifiers.bayes.NaiveBayes;%0Aimport weka.classifiers.functions.MultilayerPerceptron;%0Aimport weka.classifiers.*;%0A%0Aimport java.io.BufferedReader;%0Aimport java.io.File;%0Aimport java.io.FileReader;%0Aimport java.io.FileWriter;%0Aimport java.util.Random;%0A %0Apublic class wekabayes %7B%0A%0A  public static void main(String%5B%5D args) throws Exception %7B%0A%09  BufferedReader traind = new BufferedReader(new FileReader(%22D:%5C%5Cput train here.arff%22));%0A%09  BufferedReader testd = new BufferedReader(new FileReader(%22D:%5C%5Cput test here.arff%22));%0A%09  FileWriter fw =new FileWriter(%22D:put ouput file here.txt%22);%0A%09  double kk%5B%5D;%0A%09  Instances train = new Instances(traind);%0A%09  Instances test = new Instances(testd);%0A%09  train.setClassIndex(train.numAttributes()-1);%0A%09  test.setClassIndex(test.numAttributes()-1);%0A%09  traind.close();%0A%09  testd.close();%0A%09  NaiveBayes nb = new NaiveBayes();%0A%09  nb.buildClassifier(train);%0A%09  Evaluation eval = new Evaluation(train);%0A%09  eval.crossValidateModel(nb, train, 10, new Random(1));%0A%09  System.out.println(eval.toSummaryString(%22%5CnResult%5Cn==========%5Cn%22,true));%0A%09  System.out.println(eval.toClassDetailsString());%0A%09  System.out.println(eval.toMatrixString());%0A%09  System.out.println(eval.fMeasure(1)+%22 %22+eval.precision(1)+%22 %22+eval.recall(1));%0A%09  kk=eval.evaluateModel(nb, test);%0A%09  for (int i=0;i%3Ckk.length;i++)%0A%09  %7B%0A%09%09  fw.write(kk%5Bi%5D+%22%5Cn%22);%0A%09  %7D%0A%0A%09  fw.close();%0A%09  %0A  %7D%0A%7D%0A

Create wekabayes.java