/** * Default constructor. */ public ClassificationViaRegression() { m_Classifier = new weka.classifiers.trees.M5P(); }
/** * Gets the current settings of the classifier. * * @return an array of strings suitable for passing to setOptions */ @Override public String[] getOptions() { String[] superOpts = super.getOptions(); String[] options = new String[superOpts.length + 1]; int current = superOpts.length; for (int i = 0; i < current; i++) { options[i] = superOpts[i]; } if (getSaveInstances()) { options[current++] = "-L"; } while (current < options.length) { options[current++] = ""; } return options; }
/** * returns information about the classifier * * @return a description suitable for displaying in the explorer/experimenter * gui */ public String globalInfo() { return "Implements the M5' model tree algorithm. " + "The original M5 algorithm was developed by R. Quinlan. Yong Wang " + "made improvements leading to M5'.\n\n" + "For more information see:\n\n" + getTechnicalInformation().toString(); }
/** * Main method by which this class can be tested * * @param args an array of options */ public static void main(String[] args) { runClassifier(new M5P(), args); } }
/** * Creates a new <code>M5P</code> instance. */ public M5P() { super(); setGenerateRules(false); }
setSaveInstances(Utils.getFlag('L', options)); super.setOptions(options);
/** * Main method by which this class can be tested * * @param args an array of options */ public static void main(String[] args) { runClassifier(new M5P(), args); } }
/** * Creates a new <code>M5P</code> instance. */ public M5P() { super(); setGenerateRules(false); }
setSaveInstances(Utils.getFlag('L', options)); super.setOptions(options);
/** * Default constructor. */ public ClassificationViaRegression() { m_Classifier = new weka.classifiers.trees.M5P(); }
/** * returns information about the classifier * * @return a description suitable for displaying in the explorer/experimenter * gui */ public String globalInfo() { return "Implements the M5' model tree algorithm. " + "The original M5 algorithm was developed by R. Quinlan. Yong Wang " + "made improvements leading to M5'.\n\n" + "For more information see:\n\n" + getTechnicalInformation().toString(); }
/** * Gets the current settings of the classifier. * * @return an array of strings suitable for passing to setOptions */ @Override public String[] getOptions() { String[] superOpts = super.getOptions(); String[] options = new String[superOpts.length + 1]; int current = superOpts.length; for (int i = 0; i < current; i++) { options[i] = superOpts[i]; } if (getSaveInstances()) { options[current++] = "-L"; } while (current < options.length) { options[current++] = ""; } return options; }
/** Creates a default M5P */ public Classifier getClassifier() { return new M5P(); }
/** Creates a default M5P */ public Classifier getClassifier() { return new M5P(); }
protected WekaClassifierMapTask setupBatchRegressor() { WekaClassifierMapTask task = new WekaClassifierMapTask(); task.setClassifier(new weka.classifiers.trees.M5P()); return task; }
ml = new MetaLabeler(learner[i].makeCopy(), new M5P(), "Content-Based", "Numeric-Class"); ml.setFolds(1); results = eval.crossValidate(ml, dataset, measures, numFolds); System.out.println(learnerName[i] + ";metalabeler;m5p;train;content;" + results.toCSV()); ml = new MetaLabeler(learner[i].makeCopy(), new M5P(), "Score-Based", "Numeric-Class"); ml.setFolds(1); results = eval.crossValidate(ml, dataset, measures, numFolds); System.out.println(learnerName[i] + ";metalabeler;m5p;train;scores;" + results.toCSV()); ml = new MetaLabeler(learner[i].makeCopy(), new M5P(), "Rank-Based", "Numeric-Class"); ml.setFolds(1); results = eval.crossValidate(ml, dataset, measures, numFolds); ml = new MetaLabeler(learner[i].makeCopy(), new M5P(), "Content-Based", "Numeric-Class"); ml.setFolds(5); results = eval.crossValidate(ml, dataset, measures, numFolds); System.out.println(learnerName[i] + ";metalabeler;m5p;cv;content;" + results.toCSV()); ml = new MetaLabeler(learner[i].makeCopy(), new M5P(), "Score-Based", "Numeric-Class"); ml.setFolds(5); results = eval.crossValidate(ml, dataset, measures, numFolds); System.out.println(learnerName[i] + ";metalabeler;m5p;cv;scores;" + results.toCSV()); ml = new MetaLabeler(learner[i].makeCopy(), new M5P(), "Rank-Based", "Numeric-Class"); ml.setFolds(5); results = eval.crossValidate(ml, dataset, measures, numFolds); tp = new ThresholdPrediction(learner[i].makeCopy(), new M5P(), "Content-Based", 1); results = eval.crossValidate(tp, dataset, measures, numFolds); System.out.println(learnerName[i] + ";tp;m5p;train;content;" + results.toCSV()); tp = new ThresholdPrediction(learner[i].makeCopy(), new M5P(), "Score-Based", 1); results = eval.crossValidate(tp, dataset, measures, numFolds);
/** * Creates a RemoveMisclassified, with either J48 (true) or M5P (false) * as classifier */ protected Filter getFilter(boolean nominal) { RemoveMisclassified f = new RemoveMisclassified(); // classifier if (nominal) f.setClassifier(new weka.classifiers.trees.J48()); else f.setClassifier(new weka.classifiers.trees.M5P()); // threshold if (!nominal) f.setThreshold(2.0); return f; }
/** * Creates a RemoveMisclassified, with either J48 (true) or M5P (false) * as classifier */ protected Filter getFilter(boolean nominal) { RemoveMisclassified f = new RemoveMisclassified(); // classifier if (nominal) f.setClassifier(new weka.classifiers.trees.J48()); else f.setClassifier(new weka.classifiers.trees.M5P()); // threshold if (!nominal) f.setThreshold(2.0); return f; }
cls = new weka.classifiers.trees.J48(); else if (filter.getCapabilities().handles(Capability.NUMERIC_CLASS)) cls = new weka.classifiers.trees.M5P(); else if (filter.getCapabilities().handles(Capability.DATE_CLASS)) cls = new weka.classifiers.trees.M5P(); else throw new IllegalStateException("Cannot determine base classifier for FilteredClassifier!");
cls = new weka.classifiers.trees.J48(); else if (filter.getCapabilities().handles(Capability.NUMERIC_CLASS)) cls = new weka.classifiers.trees.M5P(); else if (filter.getCapabilities().handles(Capability.DATE_CLASS)) cls = new weka.classifiers.trees.M5P(); else throw new IllegalStateException("Cannot determine base classifier for FilteredClassifier!");