コード例 #1
0
ファイル: ResultsPanel.java プロジェクト: bigbigbug/wekax
  /** Updates the test chooser with possible tests */
  protected void setTTester() {

    String name = (new SimpleDateFormat("HH:mm:ss - ")).format(new Date()) + "Available resultsets";
    StringBuffer outBuff = new StringBuffer();
    outBuff.append("Available resultsets\n" + m_TTester.resultsetKey() + "\n\n");
    m_History.addResult(name, outBuff);
    m_History.setSingle(name);

    m_TestsModel.removeAllElements();
    for (int i = 0; i < m_TTester.getNumResultsets(); i++) {
      String tname = m_TTester.getResultsetName(i);
      /*      if (tname.length() > 20) {
      tname = tname.substring(0, 20);
      } */
      m_TestsModel.addElement(tname);
    }
    m_TestsModel.addElement("Summary");
    m_TestsModel.addElement("Ranking");
    // ================ BEGIN EDIT melville ================
    m_TestsModel.addElement("Learning Curve Summary");
    // ================ END EDIT melville ================
    m_TestsList.setSelectedIndex(0);
    m_TestsButton.setEnabled(true);

    m_PerformBut.setEnabled(true);
  }
コード例 #2
0
ファイル: ResultsPanel.java プロジェクト: bigbigbug/wekax
  /** Carries out a t-test using the current configuration. */
  protected void performTest() {

    String sigStr = m_SigTex.getText();
    if (sigStr.length() != 0) {
      m_TTester.setSignificanceLevel((new Double(sigStr)).doubleValue());
    } else {
      m_TTester.setSignificanceLevel(0.05);
    }

    String precStr = m_PrecTex.getText();
    if (precStr.length() != 0) {
      m_TTester.setPrecision((new Integer(precStr)).intValue());
    } else {
      m_TTester.setPrecision(2);
    }
    // Carry out the test chosen and biff the results to the output area
    m_TTester.setShowStdDevs(m_ShowStdDevs.isSelected());
    int compareCol = m_CompareCombo.getSelectedIndex();
    int tType = m_TestsList.getSelectedIndex();

    // =============== BEGIN EDIT melville ===============
    String test_selected = (String) m_TestsList.getSelectedValue();
    String name =
        (new SimpleDateFormat("HH:mm:ss - ")).format(new Date())
            + (String) m_CompareCombo.getSelectedItem()
            + " - "
            + test_selected;
    StringBuffer outBuff = new StringBuffer();
    if (((String) m_CompareCombo.getSelectedItem()).equalsIgnoreCase("%error_reduction"))
      outBuff.append(m_TTester.header("Percentage error reduction"));
    else if (((String) m_CompareCombo.getSelectedItem())
        .equalsIgnoreCase("top_20%_%error_reduction"))
      outBuff.append(m_TTester.header("Top 20% Percentage error reduction"));
    else outBuff.append(m_TTester.header(compareCol));
    outBuff.append("\n");
    m_History.addResult(name, outBuff);
    m_History.setSingle(name);
    try {
      if (tType < m_TTester.getNumResultsets()) {
        if (((String) m_CompareCombo.getSelectedItem()).equalsIgnoreCase("%error_reduction")) {
          outBuff.append(m_TTester.multiResultsetPercentErrorReduction(tType, m_ErrorCompareCol));
        } else if (((String) m_CompareCombo.getSelectedItem())
            .equalsIgnoreCase("top_20%_%error_reduction")) {
          outBuff.append(
              m_TTester.multiResultsetTopNPercentErrorReduction(tType, m_ErrorCompareCol, 0.20));
        } else outBuff.append(m_TTester.multiResultsetFull(tType, compareCol));
      } else if (test_selected.equalsIgnoreCase("summary")) {
        outBuff.append(m_TTester.multiResultsetSummary(compareCol));
      } else if (test_selected.equalsIgnoreCase("ranking")) {
        outBuff.append(m_TTester.multiResultsetRanking(compareCol));
      }
      // ================ END EDIT melville ================

      outBuff.append("\n");
    } catch (Exception ex) {
      outBuff.append(ex.getMessage() + "\n");
    }
    m_History.updateResult(name);
  }