/** * Default constructor specifying DecisionStump as the classifier */ public AdditiveRegression() { this(new weka.classifiers.trees.DecisionStump()); }
/** * Main method for testing this class. * * @param argv the options */ public static void main(String [] argv) { runClassifier(new DecisionStump(), argv); } }
getCapabilities().testWithFail(instances); currVal = findSplitNominal(i); } else { currVal = findSplitNumeric(i);
/** * Finds best split for numeric attribute and returns value. * * @param index attribute index * @return value of criterion for the best split * @throws Exception if something goes wrong */ protected double findSplitNumeric(int index) throws Exception { if (m_Instances.classAttribute().isNominal()) { return findSplitNumericNominal(index); } else { return findSplitNumericNumeric(index); } }
/** * Finds best split for nominal attribute and returns value. * * @param index attribute index * @return value of criterion for the best split * @throws Exception if something goes wrong */ protected double findSplitNominal(int index) throws Exception { if (m_Instances.classAttribute().isNominal()) { return findSplitNominalNominal(index); } else { return findSplitNominalNumeric(index); } }
text.append(att.name() + " = " + att.value((int)m_SplitPoint) + " : "); text.append(printClass(m_Distribution[0])); text.append(att.name() + " != " + att.value((int)m_SplitPoint) + " : "); text.append(printClass(m_Distribution[1])); } else { text.append(att.name() + " <= " + m_SplitPoint + " : "); text.append(printClass(m_Distribution[0])); text.append(att.name() + " > " + m_SplitPoint + " : "); text.append(printClass(m_Distribution[1])); text.append(printClass(m_Distribution[2])); text.append(att.name() + " = " + att.value((int)m_SplitPoint) + "\n"); text.append(printDist(m_Distribution[0])); text.append(att.name() + " != " + att.value((int)m_SplitPoint) + "\n"); text.append(printDist(m_Distribution[1])); } else { text.append(att.name() + " <= " + m_SplitPoint + "\n"); text.append(printDist(m_Distribution[0])); text.append(att.name() + " > " + m_SplitPoint + "\n"); text.append(printDist(m_Distribution[1])); text.append(printDist(m_Distribution[2]));
/** * Main method for testing this class. * * @param argv the options */ public static void main(String [] argv) { runClassifier(new DecisionStump(), argv); } }
getCapabilities().testWithFail(instances); currVal = findSplitNominal(i); } else { currVal = findSplitNumeric(i);
/** * Finds best split for numeric attribute and returns value. * * @param index attribute index * @return value of criterion for the best split * @throws Exception if something goes wrong */ protected double findSplitNumeric(int index) throws Exception { if (m_Instances.classAttribute().isNominal()) { return findSplitNumericNominal(index); } else { return findSplitNumericNumeric(index); } }
/** * Finds best split for nominal attribute and returns value. * * @param index attribute index * @return value of criterion for the best split * @throws Exception if something goes wrong */ protected double findSplitNominal(int index) throws Exception { if (m_Instances.classAttribute().isNominal()) { return findSplitNominalNominal(index); } else { return findSplitNominalNumeric(index); } }
text.append(att.name() + " = " + att.value((int)m_SplitPoint) + " : "); text.append(printClass(m_Distribution[0])); text.append(att.name() + " != " + att.value((int)m_SplitPoint) + " : "); text.append(printClass(m_Distribution[1])); } else { text.append(att.name() + " <= " + m_SplitPoint + " : "); text.append(printClass(m_Distribution[0])); text.append(att.name() + " > " + m_SplitPoint + " : "); text.append(printClass(m_Distribution[1])); text.append(printClass(m_Distribution[2])); text.append(att.name() + " = " + att.value((int)m_SplitPoint) + "\n"); text.append(printDist(m_Distribution[0])); text.append(att.name() + " != " + att.value((int)m_SplitPoint) + "\n"); text.append(printDist(m_Distribution[1])); } else { text.append(att.name() + " <= " + m_SplitPoint + "\n"); text.append(printDist(m_Distribution[0])); text.append(att.name() + " > " + m_SplitPoint + "\n"); text.append(printDist(m_Distribution[1])); text.append(printDist(m_Distribution[2]));
/** * Default constructor specifying DecisionStump as the classifier */ public AdditiveRegression() { this(new weka.classifiers.trees.DecisionStump()); }
/** * Constructor. */ public LogitBoost() { m_Classifier = new weka.classifiers.trees.DecisionStump(); }
/** * Constructor. */ public LogitBoost() { m_Classifier = new weka.classifiers.trees.DecisionStump(); }
/** * Constructor. */ public LWL() { m_Classifier = new weka.classifiers.trees.DecisionStump(); }
/** * Constructor. */ public AdaBoostM1() { m_Classifier = new weka.classifiers.trees.DecisionStump(); }
/** * Constructor. */ public AdaBoostM1() { m_Classifier = new weka.classifiers.trees.DecisionStump(); }
/** * Constructor. */ public LWL() { m_Classifier = new weka.classifiers.trees.DecisionStump(); }
Classifier Mode; // a parent class if(alg.equals("DecisionStump")) { Mode = new DecisionStump(); } else if(alg.equals("NaiveBayes")) { Mode = new NaiveBayes(); }
/** Creates a default DecisionStump */ public Classifier getClassifier() { return new DecisionStump(); }