Package weka.core

Examples of weka.core.Attribute.numValues()


      newAtts.addElement(att.copy());
    }
  } else {

    if (j < getInputFormat().classIndex()) {
      newClassIndex += att.numValues() - 1;
    }

    // Compute values for new attributes
    for (int k = 0; k < att.numValues(); k++) {
      attributeName =
View Full Code Here


    if (j < getInputFormat().classIndex()) {
      newClassIndex += att.numValues() - 1;
    }

    // Compute values for new attributes
    for (int k = 0; k < att.numValues(); k++) {
      attributeName =
        new StringBuffer(att.name() + "=");
      attributeName.append(att.value(k));
      if (m_Numeric) {
        newAtts.
View Full Code Here

      if ((!att.isNominal()) ||
    (j == getInputFormat().classIndex())) {
  newAtts.addElement(att.copy());
      } else {
  if (j < getInputFormat().classIndex())
    newClassIndex += att.numValues() - 2;
   
  // Compute values for new attributes
   
  for (int k = 1; k < att.numValues(); k++) {
    attributeName =
View Full Code Here

  if (j < getInputFormat().classIndex())
    newClassIndex += att.numValues() - 2;
   
  // Compute values for new attributes
   
  for (int k = 1; k < att.numValues(); k++) {
    attributeName =
      new StringBuffer(att.name() + "=");
    for (int l = k; l < att.numValues(); l++) {
      if (l > k) {
        attributeName.append(',');
View Full Code Here

  // Compute values for new attributes
   
  for (int k = 1; k < att.numValues(); k++) {
    attributeName =
      new StringBuffer(att.name() + "=");
    for (int l = k; l < att.numValues(); l++) {
      if (l > k) {
        attributeName.append(',');
      }
      attributeName.append(att.value(m_Indices[j][l]));
    }
View Full Code Here

      Attribute att = getInputFormat().attribute(j);
      if ((!att.isNominal()) || (j == getInputFormat().classIndex())) {
  vals[attSoFar] = instance.value(j);
  attSoFar++;
      } else {
  if ( (att.numValues() <= 2) && (!m_TransformAll) ) {
    vals[attSoFar] = instance.value(j);
    attSoFar++;
  } else {
    if (instance.isMissing(j)) {
      for (int k = 0; k < att.numValues(); k++) {
View Full Code Here

  if ( (att.numValues() <= 2) && (!m_TransformAll) ) {
    vals[attSoFar] = instance.value(j);
    attSoFar++;
  } else {
    if (instance.isMissing(j)) {
      for (int k = 0; k < att.numValues(); k++) {
              vals[attSoFar + k] = instance.value(j);
      }
    } else {
      for (int k = 0; k < att.numValues(); k++) {
        if (k == (int)instance.value(j)) {
View Full Code Here

    if (instance.isMissing(j)) {
      for (int k = 0; k < att.numValues(); k++) {
              vals[attSoFar + k] = instance.value(j);
      }
    } else {
      for (int k = 0; k < att.numValues(); k++) {
        if (k == (int)instance.value(j)) {
                vals[attSoFar + k] = 1;
        } else {
                vals[attSoFar + k] = 0;
        }
View Full Code Here

        } else {
                vals[attSoFar + k] = 0;
        }
      }
    }
    attSoFar += att.numValues();
  }
      }
    }
    Instance inst = null;
    if (instance instanceof SparseInstance) {
View Full Code Here

      if ((!att.isNominal()) || (j == getInputFormat().classIndex())) {
  vals[attSoFar] = instance.value(j);
  attSoFar++;
      } else {
  if (instance.isMissing(j)) {
    for (int k = 0; k < att.numValues() - 1; k++) {
            vals[attSoFar + k] = instance.value(j);
    }
  } else {
    int k = 0;
    while ((int)instance.value(j) != m_Indices[j][k]) {
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.