src/FitnessFunctions.cpp
MatrixBO EchoBay::Comparator::argmax_label(Eigen::Ref<MatrixBO> predict, Eigen::Ref<MatrixBO> actual)
{
    // Declare label
    MatrixBO label(actual.rows(), actual.cols());
    int argMax;

    for (size_t i = 0; i < (size_t)actual.size(); ++i)
    {
        //Compute Argmax to determine the class
        predict.row(i).maxCoeff(&argMax);
        label(i, 0) = ((floatBO)argMax);
    }

    return label;
}
/**
 * @brief Calculate the output label of a prediction using argMax rule
 * 
 * 
 * @param predict Eigen matrix of predicted values
 * @param actual Eigen matrix of actual values
 * @return MatrixBO labeled matrix
 */
@brief Calculate the output label of a prediction using argMax rule

@param predict Eigen matrix of predicted values
@param actual Eigen matrix of actual values
@return MatrixBO labeled matrix
@brief Calculate the output label of a prediction using argMax rule @param predict Eigen matrix of predicted values @param actual Eigen matrix of actual values @return MatrixBO labeled matrix
MatrixBO EchoBay::Comparator::argmax_label(Eigen::Ref<MatrixBO> predict, Eigen::Ref<MatrixBO> actual)
{
    MatrixBO label(actual.rows(), actual.cols());
    int argMax;
    for (size_t i = 0; i < (size_t)actual.size(); ++i)
    {
        predict.row(i).maxCoeff(&argMax);
        label(i, 0) = ((floatBO)argMax);
    }
    return label;
}
MatrixBO EchoBay :: Comparator :: argmax_label ( Eigen :: Ref < MatrixBO > predict , Eigen :: Ref < MatrixBO > actual ) { MatrixBO label ( actual . rows ( ) , actual . cols ( ) ) ; int argMax ; for ( size_t i = 0 ; i < ( size_t ) actual . size ( ) ; ++ i ) { predict . row ( i ) . maxCoeff ( & argMax ) ; label ( i , 0 ) = ( ( floatBO ) argMax ) ; } return label ; }
@brief Calculate the output label of a prediction using argMax rule
@brief Calculate the output label of a prediction using argMax rule
// Declare label //Compute Argmax to determine the class