Examples of classIndex()


Examples of weka.core.Instances.classIndex()

        }
       
        eval.setPriors(mappedClassifierDataset);
        plotInstances.setInstances(mappedClassifierDataset);
        plotInstances.setClassifier(classifier);
        plotInstances.setClassIndex(mappedClassifierDataset.classIndex());
        plotInstances.setEvaluation(eval);
      }
    }
   
    return eval;
View Full Code Here

Examples of weka.core.Instances.classIndex()

  protected Instance mergeInstances(Instance source, Instance dest) {

    Instances outputFormat = outputFormatPeek();
    double[] vals = new double[outputFormat.numAttributes()];
    for(int i = 0; i < vals.length; i++) {
      if ((i != outputFormat.classIndex()) && (m_SelectedCols.isInRange(i))) {
        if (source != null) {
          vals[i] = source.value(i);
        } else {
          vals[i] = Utils.missingValue();
        }
View Full Code Here

Examples of weka.core.Instances.classIndex()

      }
     
      //      Instances dataset = m_incrementalEvent.getInstance().dataset();
      Instances dataset = m_incrementalEvent.getStructure();
      // default to the last column if no class is set
      if (dataset.classIndex() < 0) {
        stop();
        String errorMessage = statusMessagePrefix()
            + "ERROR: no class attribute set in incoming stream!";
        if (m_log != null) {
          m_log.statusMessage(errorMessage);
View Full Code Here

Examples of weka.core.Instances.classIndex()

   
    weka.classifiers.Classifier classifierToUse = m_Classifier;
   
    Instances testSet = e.getTestSet();
    if (testSet != null) {
      if (testSet.classIndex() < 0) {
  //        testSet.setClassIndex(testSet.numAttributes() - 1);
        // stop all processing
        stop();
        String errorMessage = statusMessagePrefix()
            + "ERROR: no class attribute set in test data!";
View Full Code Here

Examples of weka.core.Instances.classIndex()

        } else {
          // if headers do not match check to see if it's
          // just the class that is different and that
          // all class values are missing
          if (testSet.numInstances() > 0) {
            if (testSet.classIndex() == m_trainingSet.classIndex() &&
                testSet.attributeStats(testSet.classIndex()).missingCount ==
                testSet.numInstances()) {
              // now check the other attributes against the training
              // structure
              boolean ok = true;
View Full Code Here

Examples of weka.core.Instances.classIndex()

          // if headers do not match check to see if it's
          // just the class that is different and that
          // all class values are missing
          if (testSet.numInstances() > 0) {
            if (testSet.classIndex() == m_trainingSet.classIndex() &&
                testSet.attributeStats(testSet.classIndex()).missingCount ==
                testSet.numInstances()) {
              // now check the other attributes against the training
              // structure
              boolean ok = true;
              for (int i = 0; i < testSet.numAttributes(); i++) {
View Full Code Here

Examples of weka.core.Instances.classIndex()

                testSet.numInstances()) {
              // now check the other attributes against the training
              // structure
              boolean ok = true;
              for (int i = 0; i < testSet.numAttributes(); i++) {
                if (i != testSet.classIndex()) {
                  ok = testSet.attribute(i).equals(m_trainingSet.attribute(i));
                  if (!ok) {
                    break;
                  }
                }
View Full Code Here

Examples of weka.core.Instances.classIndex()

        remove.setInputFormat(data);
        data = Filter.useFilter(data, remove);
      }
      // setting class attribute if the data format does not provide this information
      // E.g., the XRFF format saves the class attribute information as well
      if (data.classIndex() == -1)
        data.setClass(data.attribute(attribute));
     
      // train M5P
      cl = new M5P();
      cl.setBuildRegressionTree(true);
View Full Code Here

Examples of weka.core.Instances.classIndex()

    for (File curArff : trainFiles) {

      // load data
      Instances data = new weka.core.converters.ConverterUtils.DataSource(curArff.toString()).getDataSet();
      if (data.classIndex() == -1)
        data.setClassIndex(data.numAttributes() - 1);
      data.deleteWithMissingClass();

      // count numeric and nominal attributes
      int numNumeric = 0, numNominal = 0;
View Full Code Here

Examples of weka.core.Instances.classIndex()

      data.deleteWithMissingClass();

      // count numeric and nominal attributes
      int numNumeric = 0, numNominal = 0;
      for (int i = 0; i < data.numAttributes(); i++) {
        if ( data.classIndex()==i )
          continue;
        if ( data.attribute(i).isNominal() )
          numNominal++;
        if ( data.attribute(i).isNumeric() )
          numNumeric++;
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.