public double getMetric ( int id , int classLabel ) { try { switch ( id ) { case DefaultEvaluationMetrics . EVALUATION_CC : return m_Evaluation . correlationCoefficient ( ) ; case DefaultEvaluationMetrics . EVALUATION_MATTHEWS_CC : return m_Evaluation . matthewsCorrelationCoefficient ( 0 ) ; case DefaultEvaluationMetrics . EVALUATION_RMSE : return m_Evaluation . rootMeanSquaredError ( ) ; case DefaultEvaluationMetrics . EVALUATION_RRSE : return m_Evaluation . rootRelativeSquaredError ( ) ; case DefaultEvaluationMetrics . EVALUATION_MAE : return m_Evaluation . meanAbsoluteError ( ) ; case DefaultEvaluationMetrics . EVALUATION_RAE : return m_Evaluation . relativeAbsoluteError ( ) ; case DefaultEvaluationMetrics . EVALUATION_COMBINED : return ( 1 - StrictMath . abs ( m_Evaluation . correlationCoefficient ( ) ) + m_Evaluation . rootRelativeSquaredError ( ) + m_Evaluation . relativeAbsoluteError ( ) ) ; case DefaultEvaluationMetrics . EVALUATION_ACC : return m_Evaluation . pctCorrect ( ) ; case DefaultEvaluationMetrics . EVALUATION_KAPPA : return m_Evaluation . kappa ( ) ; case DefaultEvaluationMetrics . EVALUATION_PRECISION : return m_Evaluation . precision ( classLabel ) ; case DefaultEvaluationMetrics . EVALUATION_WEIGHTED_PRECISION : return m_Evaluation . weightedPrecision ( ) ; case DefaultEvaluationMetrics . EVALUATION_RECALL : return m_Evaluation . recall ( classLabel ) ; case DefaultEvaluationMetrics . EVALUATION_WEIGHTED_RECALL : return m_Evaluation . weightedRecall ( ) ; case DefaultEvaluationMetrics . EVALUATION_AUC : return m_Evaluation . areaUnderROC ( classLabel ) ; case DefaultEvaluationMetrics . EVALUATION_WEIGHTED_AUC : return m_Evaluation . weightedAreaUnderROC ( ) ; case DefaultEvaluationMetrics . EVALUATION_PRC : return m_Evaluation . areaUnderPRC ( classLabel ) ; case DefaultEvaluationMetrics . EVALUATION_WEIGHTED_PRC : return m_Evaluation . weightedAreaUnderPRC ( ) ; case DefaultEvaluationMetrics . EVALUATION_FMEASURE : return m_Evaluation . fMeasure ( classLabel ) ; case DefaultEvaluationMetrics . EVALUATION_WEIGHTED_FMEASURE : return m_Evaluation . weightedFMeasure ( ) ; case DefaultEvaluationMetrics . EVALUATION_TRUE_POSITIVE_RATE : return m_Evaluation . truePositiveRate ( classLabel ) ; case DefaultEvaluationMetrics . EVALUATION_TRUE_NEGATIVE_RATE : return m_Evaluation . trueNegativeRate ( classLabel ) ; case DefaultEvaluationMetrics . EVALUATION_FALSE_POSITIVE_RATE : return m_Evaluation . falsePositiveRate ( classLabel ) ; case DefaultEvaluationMetrics . EVALUATION_FALSE_NEGATIVE_RATE : return m_Evaluation . falseNegativeRate ( classLabel ) ; default : return Double . NaN ; } } catch ( Exception e ) { return Double . NaN ; } }
Returns the metric for the given ID .