예제 #1
0
 public static void demo2() {
   ResultSet set = new ResultSet();
   for (int c = 1; c <= 10; c++) {
     for (int s = 1; s <= 3; s++) {
       int idx = set.addResult();
       set.setResultValue(idx, "Category", "C" + c);
       set.setResultValue(idx, "Series", "Series" + s);
       set.setResultValue(idx, "Value", new Random().nextDouble());
     }
   }
   ResultSetLinePlot plot =
       new ResultSetLinePlot(set, new String[] {"Value"}, "Series", "Category");
   SwingUtil.showInFrame(plot.getChartPanel());
   System.exit(0);
 }
예제 #2
0
  public static void demo() {
    ResultSet set = ResultSet.dummySet();

    List<String> equalProperties = new ArrayList<String>();
    equalProperties.add("dataset");
    equalProperties.add("algorithm");

    List<String> ommitProperties = new ArrayList<String>();
    ommitProperties.add("fold");
    ommitProperties.add("features");

    List<String> varProperties = new ArrayList<String>();
    varProperties.add("accuracy");

    ResultSet joined = set.join(equalProperties, ommitProperties, varProperties);
    System.out.println("\njoined folds\n");
    System.out.println(joined.toNiceString());

    ResultSetLinePlot plot =
        new ResultSetLinePlot(
            joined, new String[] {"accuracy", "accuracy", "accuracy"}, "algorithm", "dataset");
    plot.addMarker("accuracy", "mouse", "mark");
    {
      ResultSet test =
          set.pairedTTest(
              "algorithm", new String[] {"fold"}, "accuracy", 0.01, null, new String[] {"dataset"});
      for (Object datasetWins :
          ResultSet.listSeriesWins(test, "algorithm", "accuracy", "dataset", "SVM", "NB"))
        plot.setDrawShape("accuracy", datasetWins.toString(), "SVM");
      System.out.println(test.toNiceString());
    }

    SwingUtil.showInFrame(plot.getChartPanel());

    //		SwingUtil.showInDialog(ResultSetLinePlot.getCombinedPlot(set, "accuracy", "accuracy",
    // "algorithm", "dataset"));

    System.exit(0);
  }