Examples of numAttributes()


Examples of weka.core.Instances.numAttributes()

      // establish attributes to remove from first batch

      Instances toFilter = getInputFormat();
      int[] attsToDelete = new int[toFilter.numAttributes()];
      int numToDelete = 0;
      for(int i = 0; i < toFilter.numAttributes(); i++) {
  if (i==toFilter.classIndex()) continue; // skip class
  AttributeStats stats = toFilter.attributeStats(i);
  if (stats.distinctCount < 2) {
    // remove constant attributes
    attsToDelete[numToDelete++] = i;
View Full Code Here

Examples of weka.core.Instances.numAttributes()

    // remove instances with missing class
    Instances data = new Instances(instances);
    data.deleteWithMissingClass();

    // only class? -> build ZeroR model
    if (data.numAttributes() == 1) {
      System.err.println(
    "Cannot build model (only class attribute present in data!), "
    + "using ZeroR model instead!");
      m_ZeroR = new weka.classifiers.rules.ZeroR();
      m_ZeroR.buildClassifier(data);
View Full Code Here

Examples of weka.core.Instances.numAttributes()

  // rename attributes
  processed = renameAttributes(processed, "filtered-" + i + "-");

  // add attributes
  for (n = 0; n < processed.numAttributes(); n++) {
    if (n == processed.classIndex())
      continue;
    atts.add((Attribute) processed.attribute(n).copy());
  }
      }
View Full Code Here

Examples of weka.core.Instances.numAttributes()

    "The following filter(s) changed the number of instances: " + errors);

    // assemble data
    for (i = 0; i < instances.numInstances(); i++) {
      inst   = instances.instance(i);
      values = new double[result.numAttributes()];

      // filtered data
      index = 0;
      for (n = 0; n < processed.length; n++) {
  for (m = 0; m < processed[n].numAttributes(); m++) {
View Full Code Here

Examples of weka.core.Instances.numAttributes()

   
    // update data
    for (i = 0; i < m_PlotInstances.numInstances(); i++) {
      inst = m_PlotInstances.instance(i);
      // copy old values
      values = new double[data.numAttributes()];
      System.arraycopy(inst.toDoubleArray(), 0, values, 0, inst.numAttributes());
      // add interval data
      predInt = ((NumericPrediction) preds.elementAt(i)).predictionIntervals();
      for (n = 0; n < maxNum; n++) {
  if (n < predInt.length){
View Full Code Here

Examples of weka.core.Instances.numAttributes()

        }
        Instances copy = new Instances(m_Instances);
        copy.setClassIndex(classIndex);
        filter.setInputFormat(copy);
        Instances newInstances = Filter.useFilter(copy, filter);
        if (newInstances == null || newInstances.numAttributes() < 1) {
    throw new Exception("Dataset is empty.");
        }
        m_Log.statusMessage("Saving undo information");
        addUndoPoint();
        m_AttVisualizePanel.setColoringIndex(copy.classIndex());
View Full Code Here

Examples of weka.core.Instances.numAttributes()

                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++) {
                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.numAttributes()

  outBuff.append("\n");

  if (trainHeader != null) {

    outBuff.append("Relation:     " + trainHeader.relationName() + '\n');
    outBuff.append("Attributes:   " + trainHeader.numAttributes() + '\n');
    if (trainHeader.numAttributes() < 100) {
      boolean [] selectedAtts = new boolean [trainHeader.numAttributes()];
      for (int i = 0; i < trainHeader.numAttributes(); i++) {
        selectedAtts[i] = true;
      }
View Full Code Here

Examples of weka.core.Instances.numAttributes()

  if (trainHeader != null) {

    outBuff.append("Relation:     " + trainHeader.relationName() + '\n');
    outBuff.append("Attributes:   " + trainHeader.numAttributes() + '\n');
    if (trainHeader.numAttributes() < 100) {
      boolean [] selectedAtts = new boolean [trainHeader.numAttributes()];
      for (int i = 0; i < trainHeader.numAttributes(); i++) {
        selectedAtts[i] = true;
      }
     
View Full Code Here

Examples of weka.core.Instances.numAttributes()

  if (trainHeader != null) {

    outBuff.append("Relation:     " + trainHeader.relationName() + '\n');
    outBuff.append("Attributes:   " + trainHeader.numAttributes() + '\n');
    if (trainHeader.numAttributes() < 100) {
      boolean [] selectedAtts = new boolean [trainHeader.numAttributes()];
      for (int i = 0; i < trainHeader.numAttributes(); i++) {
        selectedAtts[i] = true;
      }
     
      if (ignoredAtts != null)
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.