@Override public void execute() throws Exception { File storage = getContext().getStorageLocation(TestTask.OUTPUT_KEY, AccessMode.READONLY); Properties props = new Properties(); File evaluationFile = new File(storage.getAbsolutePath() + "/" + TestTask.EVALUATION_DATA_KEY); weka.classifiers.Evaluation eval = (weka.classifiers.Evaluation) SerializationHelper .read(evaluationFile.getAbsolutePath()); HashMap<String, Double> m = new HashMap<String, Double>(); m.put(CORRELATION, eval.correlationCoefficient()); m.put(MEAN_ABSOLUTE_ERROR, eval.meanAbsoluteError()); m.put(RELATIVE_ABSOLUTE_ERROR, eval.relativeAbsoluteError()); m.put(ROOT_MEAN_SQUARED_ERROR, eval.rootMeanSquaredError()); m.put(ROOT_RELATIVE_SQUARED_ERROR, eval.rootRelativeSquaredError()); for (String s : m.keySet()) { props.setProperty(s, m.get(s).toString()); } // Write out properties getContext().storeBinary(TestTask.RESULTS_KEY, new PropertiesAdapter(props)); } }
result[current++] = new Double(eval.rootMeanSquaredError()); result[current++] = new Double(eval.relativeAbsoluteError()); result[current++] = new Double(eval.rootRelativeSquaredError());
result[current++] = new Double(eval.rootMeanSquaredError()); result[current++] = new Double(eval.relativeAbsoluteError()); result[current++] = new Double(eval.rootRelativeSquaredError());
result[current++] = new Double(eval.rootMeanSquaredError()); result[current++] = new Double(eval.relativeAbsoluteError()); result[current++] = new Double(eval.rootRelativeSquaredError());
result[current++] = new Double(eval.rootMeanSquaredError()); result[current++] = new Double(eval.relativeAbsoluteError()); result[current++] = new Double(eval.rootRelativeSquaredError());
/** * Traverses the tree and installs linear models at each node. This method * must be called if pruning is not to be performed. * * @throws Exception if an error occurs */ public void installLinearModels() throws Exception { Evaluation nodeModelEval; if (m_isLeaf) { buildLinearModel(m_indices); } else { if (m_left != null) { m_left.installLinearModels(); } if (m_right != null) { m_right.installLinearModels(); } buildLinearModel(m_indices); } nodeModelEval = new Evaluation(m_instances); nodeModelEval.evaluateModel(m_nodeModel, m_instances); m_rootMeanSquaredError = nodeModelEval.rootMeanSquaredError(); // save space if (!m_saveInstances) { m_instances = new Instances(m_instances, 0); } }
/** * Traverses the tree and installs linear models at each node. This method * must be called if pruning is not to be performed. * * @throws Exception if an error occurs */ public void installLinearModels() throws Exception { Evaluation nodeModelEval; if (m_isLeaf) { buildLinearModel(m_indices); } else { if (m_left != null) { m_left.installLinearModels(); } if (m_right != null) { m_right.installLinearModels(); } buildLinearModel(m_indices); } nodeModelEval = new Evaluation(m_instances); nodeModelEval.evaluateModel(m_nodeModel, m_instances); m_rootMeanSquaredError = nodeModelEval.rootMeanSquaredError(); // save space if (!m_saveInstances) { m_instances = new Instances(m_instances, 0); } }
m_rootMeanSquaredError = nodeModelEval.rootMeanSquaredError(); } else { rmsModel = nodeModelEval.rootMeanSquaredError(); adjustedErrorModel = rmsModel * pruningFactor(m_numInstances, m_nodeModel.numParameters() + 1); rmsSubTree = nodeEval.rootMeanSquaredError();
m_rootMeanSquaredError = nodeModelEval.rootMeanSquaredError(); } else { rmsModel = nodeModelEval.rootMeanSquaredError(); adjustedErrorModel = rmsModel * pruningFactor(m_numInstances, m_nodeModel.numParameters() + 1); rmsSubTree = nodeEval.rootMeanSquaredError();
return m_evaluation.pctCorrect(); return -m_evaluation.rootMeanSquaredError(); case EVAL_ACCURACY: return m_evaluation.pctCorrect(); case EVAL_RMSE: return -m_evaluation.rootMeanSquaredError(); case EVAL_MAE: return -m_evaluation.meanAbsoluteError();
return m_evaluation.pctCorrect(); return -m_evaluation.rootMeanSquaredError(); case EVAL_ACCURACY: return m_evaluation.pctCorrect(); case EVAL_RMSE: return -m_evaluation.rootMeanSquaredError(); case EVAL_MAE: return -m_evaluation.meanAbsoluteError();
m_dataPoint[1] = m_windowEval.rootMeanSquaredError(); m_dataPoint[2] = m_windowEval.kappa(); } else { m_dataPoint[1] = m_eval.rootMeanSquaredError(); m_dataPoint[2] = m_eval.kappa(); if (!inst.isMissing(inst.classIndex())) { if (m_windowSize > 0) { update = m_windowEval.rootMeanSquaredError(); } else { update = m_eval.rootMeanSquaredError();
m_dataPoint[1] = m_windowEval.rootMeanSquaredError(); m_dataPoint[2] = m_windowEval.kappa(); } else { m_dataPoint[1] = m_eval.rootMeanSquaredError(); m_dataPoint[2] = m_eval.kappa(); if (!inst.isMissing(inst.classIndex())) { if (m_windowSize > 0) { update = m_windowEval.rootMeanSquaredError(); } else { update = m_eval.rootMeanSquaredError();
break; case EVAL_RMSE: evalMetric = evaluation.rootMeanSquaredError(); break; case EVAL_MAE:
break; case EVAL_RMSE: evalMetric = evaluation.rootMeanSquaredError(); break; case EVAL_MAE:
break; case EVAL_RMSE: evalMetric = evaluation.rootMeanSquaredError(); break; case EVAL_MAE:
break; case EVAL_RMSE: evalMetric = evaluation.rootMeanSquaredError(); break; case EVAL_MAE:
break; case EVAL_RMSE: repError[i] = m_Evaluation.rootMeanSquaredError(); break; case EVAL_MAE:
break; case EVAL_RMSE: repError[i] = m_Evaluation.rootMeanSquaredError(); break; case EVAL_MAE:
return m_Evaluation.matthewsCorrelationCoefficient(0); case DefaultEvaluationMetrics.EVALUATION_RMSE: return m_Evaluation.rootMeanSquaredError(); case DefaultEvaluationMetrics.EVALUATION_RRSE: return m_Evaluation.rootRelativeSquaredError();