/** * Main method for testing this class. * * @param argv the options */ public static void main(String [] argv) { runClassifier(new CVParameterSelection(), argv); } }
/** * Set method for CVParameters. * * @param params the CVParameters to use * @throws Exception if the setting of the CVParameters fails */ public void setCVParameters(Object[] params) throws Exception { Vector<CVParameter> backup = m_CVParams; m_CVParams = new Vector<CVParameter>(); for(int i=0; i<params.length; i++) { try{ addCVParameter((String)params[i]); } catch(Exception ex) { m_CVParams = backup; throw ex; } } }
/** * Gets the current settings of the Classifier. * * @return an array of strings suitable for passing to setOptions */ public String [] getOptions() { Vector<String> options = new Vector<String>(); for (int i = 0; i < m_CVParams.size(); i++) { options.add("-P"); options.add("" + getCVParameter(i)); } options.add("-X"); options.add("" + getNumFolds()); Collections.addAll(options, super.getOptions()); return options.toArray(new String[0]); }
/** Creates a default CVParameterSelection */ public Classifier getClassifier() { return new CVParameterSelection(); }
getCapabilities().testWithFail(instances); m_ClassifierOptions); findParamsByCrossValidation(0, trainData, random);
setNumFolds(Integer.parseInt(foldsString)); } else { setNumFolds(10); cvParam = Utils.getOption('P', options); if (cvParam.length() != 0) { addCVParameter(cvParam);
cvParam.m_ParamValue <= upper; cvParam.m_ParamValue += increment) { findParamsByCrossValidation(depth + 1, trainData, random); String[] options = createOptions(); if (m_Debug) { System.err.print("Setting options for " m_BestClassifierOptions = createOptions();
/** * Returns a string describing this classifier * @return a description of the classifier suitable for * displaying in the explorer/experimenter gui */ public String globalInfo() { return "Class for performing parameter selection by cross-validation " + "for any classifier.\n\n" + "For more information, see:\n\n" + getTechnicalInformation().toString(); }
/** Creates a default CVParameterSelection */ public Classifier getClassifier() { return new CVParameterSelection(); }
getCapabilities().testWithFail(instances); m_ClassifierOptions); findParamsByCrossValidation(0, trainData, random);
setNumFolds(Integer.parseInt(foldsString)); } else { setNumFolds(10); cvParam = Utils.getOption('P', options); if (cvParam.length() != 0) { addCVParameter(cvParam);
cvParam.m_ParamValue <= upper; cvParam.m_ParamValue += increment) { findParamsByCrossValidation(depth + 1, trainData, random); String[] options = createOptions(); if (m_Debug) { System.err.print("Setting options for " m_BestClassifierOptions = createOptions();
/** * Returns a string describing this classifier * @return a description of the classifier suitable for * displaying in the explorer/experimenter gui */ public String globalInfo() { return "Class for performing parameter selection by cross-validation " + "for any classifier.\n\n" + "For more information, see:\n\n" + getTechnicalInformation().toString(); }
/** * Main method for testing this class. * * @param argv the options */ public static void main(String [] argv) { runClassifier(new CVParameterSelection(), argv); } }
/** * Gets the current settings of the Classifier. * * @return an array of strings suitable for passing to setOptions */ public String [] getOptions() { Vector<String> options = new Vector<String>(); for (int i = 0; i < m_CVParams.size(); i++) { options.add("-P"); options.add("" + getCVParameter(i)); } options.add("-X"); options.add("" + getNumFolds()); Collections.addAll(options, super.getOptions()); return options.toArray(new String[0]); }
/** * Set method for CVParameters. * * @param params the CVParameters to use * @throws Exception if the setting of the CVParameters fails */ public void setCVParameters(Object[] params) throws Exception { Vector<CVParameter> backup = m_CVParams; m_CVParams = new Vector<CVParameter>(); for(int i=0; i<params.length; i++) { try{ addCVParameter((String)params[i]); } catch(Exception ex) { m_CVParams = backup; throw ex; } } }