/** * 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>(); options.add("-S"); options.add("" + getShrinkage()); if (getMinimizeAbsoluteError()) { options.add("-A"); } Collections.addAll(options, super.getOptions()); return options.toArray(new String[0]); }
/** * 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>(); options.add("-S"); options.add("" + getShrinkage()); if (getMinimizeAbsoluteError()) { options.add("-A"); } if (getResume()) { options.add("-resume"); } Collections.addAll(options, super.getOptions()); return options.toArray(new String[0]); }
double sum = 0; for (int i = 0; i < m_Data.numInstances(); i++) { if (getMinimizeAbsoluteError()) { sum += m_Data.instance(i).weight() * Math.abs(m_Data.instance(i).classValue()); } else { if (getMinimizeAbsoluteError()) { System.err.println("Sum of absolute residuals: " + sum); } else {
double sum = 0; for (int i = 0; i < m_Data.numInstances(); i++) { if (getMinimizeAbsoluteError()) { sum += m_Data.instance(i).weight() * Math.abs(m_Data.instance(i).classValue()); } else { if (getMinimizeAbsoluteError()) { System.err.println("Sum of absolute residuals: " + sum); } else {
if (getMinimizeAbsoluteError()) { m_InitialPrediction = m_Data.kthSmallestValue(m_Data.classIndex(), m_Data.numInstances() / 2); } else { m_Diff = Double.MAX_VALUE; for (int i = 0; i < m_Data.numInstances(); i++) { if (getMinimizeAbsoluteError()) { m_Error += m_Data.instance(i).weight() * Math.abs(m_Data.instance(i).classValue()); } else { if (getMinimizeAbsoluteError()) { System.err.println("Sum of absolute residuals (predicting the median) : " + m_Error); } else {
if (getMinimizeAbsoluteError()) { m_InitialPrediction = m_Data .kthSmallestValue(m_Data.classIndex(), m_Data.numInstances() / 2); m_Diff = Double.MAX_VALUE; for (int i = 0; i < m_Data.numInstances(); i++) { if (getMinimizeAbsoluteError()) { m_Error += m_Data.instance(i).weight() * Math.abs(m_Data.instance(i).classValue()); } else { if (getMinimizeAbsoluteError()) { System.err.println( "Sum of absolute residuals (predicting the median) : " + m_Error);