Examples of deleteWithMissingClass()


Examples of weka.core.Instances.deleteWithMissingClass()

    // can classifier handle the data?
    getCapabilities().testWithFail(instances);

    // 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!), "
View Full Code Here

Examples of weka.core.Instances.deleteWithMissingClass()

      // 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;
      for (int i = 0; i < data.numAttributes(); i++) {
        if ( data.classIndex()==i )
View Full Code Here

Examples of weka.core.Instances.deleteWithMissingClass()

    // can classifier handle the data?
    getCapabilities().testWithFail(instances);

    // remove instances with missing class
    Instances trainData = new Instances(instances);
    trainData.deleteWithMissingClass();
   
    if (!(m_Classifier instanceof OptionHandler)) {
      throw new IllegalArgumentException("Base classifier should be OptionHandler.");
    }
    m_InitOptions = ((OptionHandler)m_Classifier).getOptions();
View Full Code Here

Examples of weka.core.Instances.deleteWithMissingClass()

    // can classifier handle the data?
    getCapabilities().testWithFail(instances);

    // remove instances with missing class
    Instances data = new Instances(instances);
    data.deleteWithMissingClass();
   
    if(data.numInstances() < m_Folds)
      throw new Exception("Not enough data for REP.");

    m_ClassAttribute = data.classAttribute();
View Full Code Here

Examples of weka.core.Instances.deleteWithMissingClass()

     
      Classifier[] newModel = Classifier.makeCopies(m_Classifier, m_NumClasses);
     
      // Create a copy of the data with the class transformed into numeric
      Instances boostData = new Instances(data);
      boostData.deleteWithMissingClass();
      int numInstances = boostData.numInstances();
     
      // Temporarily unset the class index
      int classIndex = data.classIndex();
      boostData.setClassIndex(-1);
View Full Code Here

Examples of weka.core.Instances.deleteWithMissingClass()

    getCapabilities().testWithFail(data);

    // remove instances with missing class
    Instances newData = new Instances(data);
    m_BaseFormat = new Instances(data, 0);
    newData.deleteWithMissingClass();

    Random random = new Random(m_Seed);
    newData.randomize(random);
    if (newData.classAttribute().isNominal()) {
      newData.stratify(m_NumFolds);
View Full Code Here

Examples of weka.core.Instances.deleteWithMissingClass()

    // can classifier handle the data?
    getCapabilities().testWithFail(exs);

    // remove instances with missing class
    Instances newData = new Instances(exs);
    newData.deleteWithMissingClass();
   
    int numegs = newData.numInstances();
    m_Dimension = newData.attribute(1).relation().numAttributes();
    m_Attributes = newData.stringFreeStructure();
    m_Change = new double[numegs][m_Dimension];
View Full Code Here

Examples of weka.core.Instances.deleteWithMissingClass()

    // can classifier handle the data?
    getCapabilities().testWithFail(instances);

    // remove instances with missing class
    Instances data = new Instances(instances);
    data.deleteWithMissingClass();
   
    int numCl = data.numClasses();
    m_Root = new Ridor_node();
    m_Class = instances.classAttribute();     // The original class label
 
View Full Code Here

Examples of weka.core.Instances.deleteWithMissingClass()

  public void buildClassifier(Instances data) throws Exception {
    // can classifier handle the data?
    getCapabilities().testWithFail(data);
    // remove instances with missing class
    Instances instances =  new Instances(data);
    instances.deleteWithMissingClass();

    m_binaryClassifiers = new DNBBinary[instances.numClasses()];
    m_numClasses=instances.numClasses();
    m_headerInfo = new Instances(instances, 0);
    for (int i = 0; i < instances.numClasses(); i++) {
View Full Code Here

Examples of weka.core.Instances.deleteWithMissingClass()

     
      Instances data = new Instances(instances);
      if(Utils.eq(data.sumOfWeights(),0))
  throw new Exception(" No training data.");
     
      data.deleteWithMissingClass();
      if(Utils.eq(data.sumOfWeights(),0))
  throw new Exception(" The class labels of all the training data are missing.")
     
      if(data.numInstances() < m_Folds)
  throw new Exception(" Not enough data for REP.");
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.