/** * Main method for running this classifier. * * @param args the commandline options */ public static void main(String[] args) { runClassifier(new SMOreg(), args); } }
/** * Gets the current settings of the classifier. * * @return an array of strings suitable for passing to setOptions */ public String[] getOptions() { Vector<String> result = new Vector<String>(); result.add("-C"); result.add("" + getC()); result.add("-N"); result.add("" + m_filterType); result.add("-I"); result.add("" + getRegOptimizer().getClass().getName() + " " + Utils.joinOptions(getRegOptimizer().getOptions())); result.add("-K"); result.add("" + getKernel().getClass().getName() + " " + Utils.joinOptions(getKernel().getOptions())); Collections.addAll(result, super.getOptions()); return (String[]) result.toArray(new String[result.size()]); }
/** * Returns a string describing classifier * * @return a description suitable for * displaying in the explorer/experimenter gui */ public String globalInfo() { return "SMOreg implements the support vector machine for regression. " + "The parameters can be learned using various algorithms. The " + "algorithm is selected by setting the RegOptimizer. The most " + "popular algorithm (" + RegSMOImproved.class.getName().replaceAll(".*\\.", "") + ") is due to Shevade, Keerthi " + "et al and this is the default RegOptimizer.\n\n" + "For more information see:\n\n" + getTechnicalInformation().toString(); }
/** * Returns the value of the named measure * @param measureName the name of the measure to query for its value * @return the value of the named measure * @throws IllegalArgumentException if the named measure is not supported */ public double getMeasure(String measureName) { if (measureName.equalsIgnoreCase("measureKernelEvaluations")) return measureKernelEvaluations(); else if (measureName.equalsIgnoreCase("measureCacheHits")) return measureCacheHits(); else throw new IllegalArgumentException("Measure '" + measureName + "' is not supported!"); }
/** Creates a default SMOreg */ public Classifier getClassifier() { return new SMOreg(); }
"", "", 0, "\nOptions specific to optimizer ('-I') " + getRegOptimizer().getClass().getName() + ":")); result.addAll(Collections.list(((OptionHandler) getRegOptimizer()).listOptions())); + getKernel().getClass().getName() + ":")); result.addAll(Collections.list(((OptionHandler) getKernel()).listOptions()));
text.append((m_weights[i] >= 0 ? " + " : " - ") + Utils.doubleToString(Math.abs(m_weights[i]), 12, 4) + " * "); if (m_SVM.getFilterType().getSelectedTag().getID() == SMOreg.FILTER_STANDARDIZE) { text.append("(standardized) "); } else if (m_SVM.getFilterType().getSelectedTag().getID() == SMOreg.FILTER_NORMALIZE) { text.append("(normalized) ");
getCapabilities().testWithFail(instances); instances = Filter.useFilter(instances, m_Missing); if (getCapabilities().handles(Capability.NUMERIC_ATTRIBUTES)) { if (!m_onlyNumeric) { m_NominalToBinary = new NominalToBinary();
/** Creates a default SMOreg */ public Classifier getClassifier() { return new SMOreg(); }
/** * Returns the value of the named measure * @param measureName the name of the measure to query for its value * @return the value of the named measure * @throws IllegalArgumentException if the named measure is not supported */ public double getMeasure(String measureName) { if (measureName.equalsIgnoreCase("measureKernelEvaluations")) return measureKernelEvaluations(); else if (measureName.equalsIgnoreCase("measureCacheHits")) return measureCacheHits(); else throw new IllegalArgumentException("Measure '" + measureName + "' is not supported!"); }
"", "", 0, "\nOptions specific to optimizer ('-I') " + getRegOptimizer().getClass().getName() + ":")); result.addAll(Collections.list(((OptionHandler) getRegOptimizer()).listOptions())); + getKernel().getClass().getName() + ":")); result.addAll(Collections.list(((OptionHandler) getKernel()).listOptions()));
text.append((m_weights[i] >= 0 ? " + " : " - ") + Utils.doubleToString(Math.abs(m_weights[i]), 12, 4) + " * "); if (m_SVM.getFilterType().getSelectedTag().getID() == SMOreg.FILTER_STANDARDIZE) { text.append("(standardized) "); } else if (m_SVM.getFilterType().getSelectedTag().getID() == SMOreg.FILTER_NORMALIZE) { text.append("(normalized) ");
getCapabilities().testWithFail(instances); instances = Filter.useFilter(instances, m_Missing); if (getCapabilities().handles(Capability.NUMERIC_ATTRIBUTES)) { if (!m_onlyNumeric) { m_NominalToBinary = new NominalToBinary();
/** * Main method for running this classifier. * * @param args the commandline options */ public static void main(String[] args) { runClassifier(new SMOreg(), args); } }
/** * Gets the current settings of the classifier. * * @return an array of strings suitable for passing to setOptions */ public String[] getOptions() { Vector<String> result = new Vector<String>(); result.add("-C"); result.add("" + getC()); result.add("-N"); result.add("" + m_filterType); result.add("-I"); result.add("" + getRegOptimizer().getClass().getName() + " " + Utils.joinOptions(getRegOptimizer().getOptions())); result.add("-K"); result.add("" + getKernel().getClass().getName() + " " + Utils.joinOptions(getKernel().getOptions())); Collections.addAll(result, super.getOptions()); return (String[]) result.toArray(new String[result.size()]); }
/** * Returns default capabilities of the classifier. * * @return the capabilities of this classifier */ public Capabilities getCapabilities() { Capabilities result = getKernel().getCapabilities(); result.setOwner(this); // attribute result.enableAllAttributeDependencies(); // with NominalToBinary we can also handle nominal attributes, but only // if the kernel can handle numeric attributes if (result.handles(Capability.NUMERIC_ATTRIBUTES)) result.enable(Capability.NOMINAL_ATTRIBUTES); result.enable(Capability.MISSING_VALUES); // class result.disableAllClasses(); result.disableAllClassDependencies(); result.disable(Capability.NO_CLASS); result.enable(Capability.NUMERIC_CLASS); result.enable(Capability.DATE_CLASS); result.enable(Capability.MISSING_CLASS_VALUES); return result; }