Package weka.core

Examples of weka.core.Instances.classIndex()


    pred = ce.getClassifier().classifyInstance(inst);
  }
  if (inst.classIndex() >= 0) {
    // need to check that the class is not missing
    if (inst.attribute(inst.classIndex()).isNominal()) {
      if (!inst.isMissing(inst.classIndex())) {
        if (m_dataPoint.length < 2) {
    m_dataPoint = new double[2];
    m_dataLegend.addElement("Accuracy");
    m_dataLegend.addElement("RMSE (prob)");
        }
View Full Code Here


    m_dataPoint = new double[1];
    m_dataLegend.addElement("Confidence");
        }
      }
      double primaryMeasure = 0;
      if (!inst.isMissing(inst.classIndex())) {
        primaryMeasure = 1.0 - m_eval.errorRate();
      } else {
        // record confidence as the primary measure
        // (another possibility would be entropy of
        // the distribution, or perhaps average
View Full Code Here

      m_reset = false;
    } else {
      // numeric class
      if (m_dataPoint.length < 1) {
        m_dataPoint = new double[1];
        if (inst.isMissing(inst.classIndex())) {
    m_dataLegend.addElement("Prediction");
        } else {
    m_dataLegend.addElement("RMSE");
        }
      }
View Full Code Here

    m_dataLegend.addElement("Prediction");
        } else {
    m_dataLegend.addElement("RMSE");
        }
      }
      if (!inst.isMissing(inst.classIndex())) {
        double update;
        if (!inst.isMissing(inst.classIndex())) {
    update = m_eval.rootMeanSquaredError();
        } else {
    update = pred;
View Full Code Here

    m_dataLegend.addElement("RMSE");
        }
      }
      if (!inst.isMissing(inst.classIndex())) {
        double update;
        if (!inst.isMissing(inst.classIndex())) {
    update = m_eval.rootMeanSquaredError();
        } else {
    update = pred;
        }
        m_dataPoint[0] = update;
View Full Code Here

    m_min = update;
        }
      }
     
      m_ce.setLegendText(m_dataLegend);
      m_ce.setMin((inst.isMissing(inst.classIndex())
       ? m_min
       : 0));
      m_ce.setMax(m_max);
      m_ce.setDataPoint(m_dataPoint);
      m_ce.setReset(m_reset);
View Full Code Here

    textTitle.substring(textTitle.lastIndexOf('.')+1,
            textTitle.length());
        String results = Messages.getInstance().getString("IncrementalClassifierEvaluator_AcceptClassifier_Result_Text_First") + textTitle
    +  Messages.getInstance().getString("IncrementalClassifierEvaluator_AcceptClassifier_Result_Text_Second") + inst.dataset().relationName() + "\n\n"
    + m_eval.toSummaryString();
              if (inst.classIndex() >= 0 &&
                  inst.classAttribute().isNominal() &&
                  (m_outputInfoRetrievalStats)) {
                results += "\n" + m_eval.toClassDetailsString();
              }
View Full Code Here

                  inst.classAttribute().isNominal() &&
                  (m_outputInfoRetrievalStats)) {
                results += "\n" + m_eval.toClassDetailsString();
              }

              if (inst.classIndex() >= 0 &&
                  inst.classAttribute().isNominal()) {
                results += "\n" + m_eval.toMatrixString();
              }
        textTitle = Messages.getInstance().getString("IncrementalClassifierEvaluator_AcceptClassifier_TextTitle_Text") + textTitle;
        TextEvent te =
View Full Code Here

    if (testSource != null) {
      Instances test = testSource.getStructure();
      if (classIndex != -1) {
  test.setClassIndex(classIndex - 1);
      } else {
  if (test.classIndex() == -1)
    test.setClassIndex(test.numAttributes() - 1);
      }

      // print the header
      printClassificationsHeader(test, attributesToOutput, printDistribution, text);
View Full Code Here

      printClassificationsHeader(test, attributesToOutput, printDistribution, text);

      // print predictions
      int i = 0;
      testSource.reset();
      test = testSource.getStructure(test.classIndex());
      while (testSource.hasMoreElements(test)) {
  Instance inst = testSource.nextElement(test);
        text.append(predictionText(classifier, inst, i,
                                   attributesToOutput, printDistribution));
  i++;
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.