@Override public void postExecution() throws Exception { super.postExecution(); if (getMetaClassifier() instanceof CommandlineRunnable) { ((CommandlineRunnable) getMetaClassifier()).postExecution(); } }
@Override public void preExecution() throws Exception { super.preExecution(); if (getMetaClassifier() instanceof CommandlineRunnable) { ((CommandlineRunnable) getMetaClassifier()).preExecution(); } }
@Override public void postExecution() throws Exception { super.postExecution(); if (getMetaClassifier() instanceof CommandlineRunnable) { ((CommandlineRunnable) getMetaClassifier()).postExecution(); } }
@Override public void preExecution() throws Exception { super.preExecution(); if (getMetaClassifier() instanceof CommandlineRunnable) { ((CommandlineRunnable) getMetaClassifier()).preExecution(); } }
/** * Gets the current settings of the Classifier. * * @return an array of strings suitable for passing to setOptions */ public String[] getOptions() { String[] superOptions = super.getOptions(); String[] options = new String[superOptions.length + 4]; int current = 0; options[current++] = "-X"; options[current++] = "" + getNumFolds(); options[current++] = "-M"; options[current++] = getMetaClassifier().getClass().getName() + " " + Utils.joinOptions(((OptionHandler) getMetaClassifier()).getOptions()); System.arraycopy(superOptions, 0, options, current, superOptions.length); return options; }
/** * Returns an enumeration describing the available options. * * @return an enumeration of all the available options. */ public Enumeration<Option> listOptions() { Vector<Option> newVector = new Vector<Option>(2); newVector.addElement(new Option( metaOption(), "M", 0, "-M <scheme specification>")); newVector.addElement(new Option( "\tSets the number of cross-validation folds.", "X", 1, "-X <number of folds>")); newVector.addAll(Collections.list(super.listOptions())); if (getMetaClassifier() instanceof OptionHandler) { newVector.addElement(new Option( "", "", 0, "\nOptions specific to meta classifier " + getMetaClassifier().getClass().getName() + ":")); newVector.addAll(Collections.list(((OptionHandler)getMetaClassifier()).listOptions())); } return newVector.elements(); }
/** * Returns an enumeration describing the available options. * * @return an enumeration of all the available options. */ public Enumeration<Option> listOptions() { Vector<Option> newVector = new Vector<Option>(2); newVector.addElement(new Option(metaOption(), "M", 0, "-M <scheme specification>")); newVector.addElement(new Option("\tSets the number of cross-validation folds.", "X", 1, "-X <number of folds>")); newVector.addAll(Collections.list(super.listOptions())); if (getMetaClassifier() instanceof OptionHandler) { newVector.addElement(new Option("", "", 0, "\nOptions specific to meta classifier " + getMetaClassifier().getClass().getName() + ":")); newVector.addAll(Collections.list(((OptionHandler) getMetaClassifier()).listOptions())); } return newVector.elements(); }
/** * Gets the current settings of the Classifier. * * @return an array of strings suitable for passing to setOptions */ public String [] getOptions() { String [] superOptions = super.getOptions(); String [] options = new String [superOptions.length + 4]; int current = 0; options[current++] = "-X"; options[current++] = "" + getNumFolds(); options[current++] = "-M"; options[current++] = getMetaClassifier().getClass().getName() + " " + Utils.joinOptions(((OptionHandler)getMetaClassifier()).getOptions()); System.arraycopy(superOptions, 0, options, current, superOptions.length); return options; }
/** * Returns true if the meta classifier or any of the base classifiers are able to generate batch predictions * efficiently and all of them implement BatchPredictor. * * @return true if batch prediction can be done efficiently */ public boolean implementsMoreEfficientBatchPrediction() { if (!(getMetaClassifier() instanceof BatchPredictor)) { return super.implementsMoreEfficientBatchPrediction(); } boolean atLeastOneIsEfficient = false; for (Classifier c : getClassifiers()) { if (!(c instanceof BatchPredictor)) { return super.implementsMoreEfficientBatchPrediction(); } atLeastOneIsEfficient |= ((BatchPredictor) c).implementsMoreEfficientBatchPrediction(); } return atLeastOneIsEfficient || ((BatchPredictor) getMetaClassifier()).implementsMoreEfficientBatchPrediction(); }