Package weka.core

Examples of weka.core.Instance.classIndex()


      }
      catch(NullPointerException e){
        return 1;
      }
     
      String class_interval = ag_entry.stringValue(ag_entry.classIndex());
      //System.out.println("\nAgent: "+ ag_entry);
      /* Parse class interval*/
      class_interval = class_interval.substring(2, class_interval.length()-2);
      class_bounds = class_interval.split("-");

View Full Code Here


      m_Converter = temp;

      // Process all instances
      for(int xyz=0; xyz<data.numInstances(); xyz++){
  Instance datum = data.instance(xyz);
  if (!datum.isMissing(datum.classIndex())) {
    datum.setClassValue((double)m_Converter[(int)datum.classValue()]);
  }
  push(datum);
      }
    }
View Full Code Here

        m_instanceCount++;
  Instance inst = ce.getCurrentInstance();
  //  if (inst.attribute(inst.classIndex()).isNominal()) {
  double [] dist = ce.getClassifier().distributionForInstance(inst);
  double pred = 0;
  if (!inst.isMissing(inst.classIndex())) {
          if (m_outputInfoRetrievalStats) {
            // store predictions so AUC etc can be output.
            m_eval.evaluateModelOnceAndRecordPrediction(dist, inst);
          } else {
            m_eval.evaluateModelOnce(dist, inst);
View Full Code Here

            m_eval.evaluateModelOnce(dist, inst);
          }
  } else {
    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];
View Full Code Here

  } else {
    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

    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

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.