src/FitnessFunctions.cpp
void EchoBay::Comparator::ConfusionMatrix(Eigen::Ref<MatrixBO> predict, Eigen::Ref<MatrixBO> actual, int nOutput, Eigen::Ref<Eigen::MatrixXi> confusionMat)
{
    int i, c;
    for (size_t j = 0; j < (size_t)actual.size(); j++)
    {
        c = (int)actual(j, 0);
        for (i = 0; i < nOutput; i++)
        {
            confusionMat(c, i) += (int)predict(j, 0) == i;
        }
    }
}
/**
 * @brief Estimate confusion matrix starting from prediction and ground truth
 * 
 * @param predict Eigen Matrix containing predicted labels
 * @param actual Eigen Matrix containing actual labels
 * @param nOutput number of classes
 * @param confusionMat Output confusion matrix TODO make this return value
 */
@brief Estimate confusion matrix starting from prediction and ground truth

@param predict Eigen Matrix containing predicted labels
@param actual Eigen Matrix containing actual labels
@param nOutput number of classes
@param confusionMat Output confusion matrix TODO make this return value
@brief Estimate confusion matrix starting from prediction and ground truth @param predict Eigen Matrix containing predicted labels @param actual Eigen Matrix containing actual labels @param nOutput number of classes @param confusionMat Output confusion matrix TODO make this return value
void EchoBay::Comparator::ConfusionMatrix(Eigen::Ref<MatrixBO> predict, Eigen::Ref<MatrixBO> actual, int nOutput, Eigen::Ref<Eigen::MatrixXi> confusionMat)
{
    int i, c;
    for (size_t j = 0; j < (size_t)actual.size(); j++)
    {
        c = (int)actual(j, 0);
        for (i = 0; i < nOutput; i++)
        {
            confusionMat(c, i) += (int)predict(j, 0) == i;
        }
    }
}
void EchoBay :: Comparator :: ConfusionMatrix ( Eigen :: Ref < MatrixBO > predict , Eigen :: Ref < MatrixBO > actual , int nOutput , Eigen :: Ref < Eigen :: MatrixXi > confusionMat ) { int i , c ; for ( size_t j = 0 ; j < ( size_t ) actual . size ( ) ; j ++ ) { c = ( int ) actual ( j , 0 ) ; for ( i = 0 ; i < nOutput ; i ++ ) { confusionMat ( c , i ) += ( int ) predict ( j , 0 ) == i ; } } }
@brief Estimate confusion matrix starting from prediction and ground truth
@brief Estimate confusion matrix starting from prediction and ground truth