Examples of dataset()


Examples of weka.core.Instance.dataset()

      if (filteredInstance == null) {
  return;
      }
      if (!m_structurePassedOn) {
  // pass on the new structure first
  m_ie.setStructure(new Instances(filteredInstance.dataset(), 0));
  notifyInstanceListeners(m_ie);
  m_structurePassedOn = true;
      }

      m_ie.setInstance(filteredInstance);
View Full Code Here

Examples of weka.core.Instance.dataset()

        textTitle =
    textTitle.substring(textTitle.lastIndexOf('.')+1,
            textTitle.length());
        String results = "=== Performance information ===\n\n"
    "Scheme:   " + textTitle + "\n"
    "Relation: "+ 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

Examples of weka.core.Instance.dataset()

    }

    Instance inst = (Instance)instance.copy();

    // First copy string values from input to output
    copyValues(inst, true, inst.dataset(), getOutputFormat());
   
    // Insert the new attribute and reassign to output
    inst.setDataset(null);
    inst.insertAttributeAt(m_Insert.getIndex());
    inst.setDataset(getOutputFormat());
View Full Code Here

Examples of weka.core.Instance.dataset()

    // build instance
    try {
      inst = (Instance)instance.copy();

      // First copy string values from input to output
      copyValues(inst, true, inst.dataset(), getOutputFormat());

      // Insert the new attribute and reassign to output
      inst.setDataset(null);
      inst.insertAttributeAt(m_Index.getIndex());
      inst.setValue(m_Index.getIndex(), m_Counter);
View Full Code Here

Examples of weka.core.Instance.dataset()

  newInstance = new SparseInstance(oldInstance.weight(), newValues);
      else
  newInstance = new Instance(oldInstance.weight(), newValues);

      // copy string/relational values from input to output
      copyValues(newInstance, false, oldInstance.dataset(), getOutputFormat());

      result.add(newInstance);
    }
   
    return result;
View Full Code Here

Examples of weka.core.Instance.dataset()

        instanceSplit.setDataset(instance.dataset());
          
        // Inserts attribute and their value
        for(int i=0; i< instance.numClasses();i++)
          {
            instanceSplit.dataset().insertAttributeAt( new Attribute("N"+ (instance.numClasses()-i)), 0);
            instanceSplit.setValue(i,probs[i]);
          }
        for(int i=0; i< instance.numAttributes();i++)
          instanceSplit.setValue(i+instance.numClasses(),instance.value(i));
          
View Full Code Here

Examples of weka.core.Instance.dataset()

        //chooses best branch          
        int branch = m_localModel.whichSubset(instanceSplit); //split
          
        //delete added attributes
        for(int i=0; i< instance.numClasses();i++)
          instanceSplit.dataset().deleteAttributeAt(0);
           
        probs = m_sons[branch].distributionForInstance(instance);
      }
    }
    return probs;
View Full Code Here

Examples of weka.core.Instance.dataset()

          
        instanceSplit.setDataset(instance.dataset());
    
        for(int i=0; i< instance.numClasses();i++)
          {
            instanceSplit.dataset().insertAttributeAt( new Attribute("N"+ (instance.numClasses()-i)), 0);
            instanceSplit.setValue(i,probs[i]);
          }
        for(int i=0; i< instance.numAttributes();i++)
          instanceSplit.setValue(i+instance.numClasses(),instance.value(i));
         
View Full Code Here

Examples of weka.core.Instance.dataset()

         
          
          
        int branch = m_localModel.whichSubset(instanceSplit); //split
        for(int i=0; i< instance.numClasses();i++)
          instanceSplit.dataset().deleteAttributeAt(0);
           
        //probs = m_sons[branch].distributionForInstance(instance);
        probs = m_sons[branch].distributionForInstance(instance);
      }
    }
View Full Code Here

Examples of weka.core.Instance.dataset()

      for (int i = 0; i < m_Classifiers.length; i++) {
        if (m_Classifiers[i] != null) {
          m_ClassFilters[i].input(instance);
          Instance converted = m_ClassFilters[i].output();
          if (converted != null) {
            converted.dataset().setClassIndex(m_ClassAttribute.index());
            ((UpdateableClassifier)m_Classifiers[i]).
            updateClassifier(converted);
           
            if (m_Method == METHOD_1_AGAINST_1) {
              m_SumOfWeights[i] += converted.weight();
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.