Exemplo n.º 1
0
void
PrecisionRecallM::print() {
  std::cout << s << " (precision recall F1 n) = " << getPrecision() << " "
            << getRecall() << " "
            << getF1() << " "
            << (size/n) << std::endl;
}
Exemplo n.º 2
0
double TwoClassStats::getFMeasure() const {

    double precision = getPrecision();
    double recall = getRecall();
    if ((precision + recall) == 0) {
        return 0;
    }
    return 2 * precision * recall / (precision + recall);
}
Exemplo n.º 3
0
string TwoClassStats::toString() const {

    string res = "";
    res.append(std::to_string(getTruePositive())).append(" ");
    res.append(std::to_string(getFalseNegative())).append(" ");
    res.append(std::to_string(getTrueNegative())).append(" ");
    res.append(std::to_string(getFalsePositive())).append(" ");
    res.append(std::to_string(getFalsePositiveRate())).append(" ");
    res.append(std::to_string(getTruePositiveRate())).append(" ");
    res.append(std::to_string(getPrecision())).append(" ");
    res.append(std::to_string(getRecall())).append(" ");
    res.append(std::to_string(getFMeasure())).append(" ");
    res.append(std::to_string(getFallout())).append(" ");

    return res;
}
Exemplo n.º 4
0
	double getFMeasure(double beta) const {
		double betaSquared = beta * beta;
		double precision = getPrecision();
		double recall = getRecall();
		return ((1 + betaSquared) * precision * recall) / (betaSquared * precision + recall);
	}