Package weka.classifiers.rules

Examples of weka.classifiers.rules.ZeroR


    insts.deleteWithMissingClass();
   
    if (m_Classifier == null) {
      throw new Exception("No base classifier has been set!");
    }
    m_ZeroR = new ZeroR();
    m_ZeroR.buildClassifier(insts);

    int numClassifiers = insts.numClasses() - 1;

    numClassifiers = (numClassifiers == 0) ? 1 : numClassifiers;
View Full Code Here


    newData.deleteWithMissingClass();

    double sum = 0;
    double temp_sum = 0;
    // Add the model for the mean first
    m_zeroR = new ZeroR();
    m_zeroR.buildClassifier(newData);
   
    // only class? -> use only ZeroR model
    if (newData.numAttributes() == 1) {
      System.err.println(
View Full Code Here


  protected void resetOptions () {
    m_trainInstances = null;
    m_Evaluation = null;
    m_BaseClassifier = new ZeroR();
    m_folds = 5;
    m_seed = 1;
    m_threshold = 0.01;
  }
View Full Code Here

   * reset to defaults
   */
  protected void resetOptions () {
    m_trainingInstances = null;
    m_Evaluation = null;
    m_Classifier = new ZeroR();
    m_holdOutFile = new File("Click to set hold out or test instances");
    m_holdOutInstances = null;
    m_useTraining = false;
  }
View Full Code Here

    insts.deleteWithMissingClass();
   
    if (m_Classifier == null) {
      throw new Exception("No base classifier has been set!");
    }
    m_ZeroR = new ZeroR();
    m_ZeroR.buildClassifier(insts);

    m_TwoClassDataset = null;

    int numClassifiers = insts.numClasses();
View Full Code Here

    clusterData.deleteAttributeAt(m_OriginalHeader.classIndex());
    m_ClusteringHeader = new Instances(clusterData, 0);

    if (m_ClusteringHeader.numAttributes() == 0) {
      System.err.println("Data contains only class attribute, defaulting to ZeroR model.");
      m_ZeroR = new ZeroR();
      m_ZeroR.buildClassifier(data);
    }
    else {
      m_ZeroR = null;
     
View Full Code Here

   
    Random random = new Random(m_Seed);

    m_zeroR = null;
    if (data.numAttributes() == 1) {
      m_zeroR = new ZeroR();
      m_zeroR.buildClassifier(data);
      return;
    }

    // Randomize and stratify
View Full Code Here

      filter.setInputFormat(data);
      FilteredClassifier classifier = new FilteredClassifier();
      if (data.numInstances() > 0) {
  classifier.setClassifier(Classifier.makeCopies(m_Classifier, 1)[0]);
      } else {
  classifier.setClassifier(new ZeroR());
      }
      classifier.setFilter(filter);
     
      if (!m_classifiers.containsKey(node.m_left.getString() + "|" + node.m_right.getString())) {
  classifier.buildClassifier(data);
View Full Code Here

  public double[] distributionForInstance(Instance instance) throws Exception {

    if (m_bestCommittee != null) return m_bestCommittee.distributionForInstance(instance);
    else {
      if (m_validationSetChanged || m_zeroR == null) {
  m_zeroR = new ZeroR();
  m_zeroR.buildClassifier(m_validationSet);
  m_validationSetChanged = false;
      }
      return m_zeroR.distributionForInstance(instance);
    }
View Full Code Here

    if (m_bestCommittee != null) {
      return m_bestCommittee.toString();
    } else {
      if ((m_validationSetChanged || m_zeroR == null) && m_validationSet != null
    && m_validationSet.numInstances() > 0) {
  m_zeroR = new ZeroR();
  try {
    m_zeroR.buildClassifier(m_validationSet);
  } catch (Exception e) {}
  m_validationSetChanged = false;
      }
View Full Code Here

TOP

Related Classes of weka.classifiers.rules.ZeroR

Copyright © 2018 www.massapicom. 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.