Commit 05f5d845 authored by Dennis Gläser's avatar Dennis Gläser
Browse files

[status] use more generic term label

parent bfec63fa
......@@ -137,11 +137,11 @@ public:
/*!
* \brief Increase counter of rejected samples
* with a specific rejection reason.
* with a specific rejection label.
*/
void increaseRejectedCounter(const std::string& reason)
void increaseRejectedCounter(const std::string& label)
{
rejectedCount_[reason]++;
rejectedCount_[label]++;
}
/*!
......@@ -174,16 +174,16 @@ public:
return std::accumulate(data.begin(),
data.end(),
0,
[] (const auto& curCount, const auto& reasonCountPair)
{ return curCount + reasonCountPair.second; });
[] (const auto& curCount, const auto& labelCountPair)
{ return curCount + labelCountPair.second; });
}
/*!
* \brief Returns the rejected entity count for a specific reason.
* \brief Returns the rejected entity count for a specific label.
*/
std::size_t getRejectedCount(const std::string& reason) const
std::size_t getRejectedCount(const std::string& label) const
{
auto it = rejectedCount_.find(reason);
auto it = rejectedCount_.find(label);
return it != rejectedCount_.end() ? it->second : 0;
}
......@@ -195,11 +195,11 @@ public:
auto result = rejectedCount_;
if (unspecifiedRejectedCount_ > 0)
{
if (result.find("unspecified") != result.end())
if (result.find("unlabeled") != result.end())
{
std::cout << "WARNING:\n"
<< "Rejection reason \"unspecified\" registered, "
<< "as well as rejection events without reason.\n"
<< "Rejection label \"unlabeled\" registered, "
<< "as well as rejection events without label.\n"
<< "These two counters will be added.\n";
result["unlabeled"] += unspecifiedRejectedCount_;
}
......@@ -260,12 +260,12 @@ public:
{
std::size_t sumRejected = 0;
const auto data = getRejectionData();
for (const auto& [reason, count] : data)
for (const auto& [label, count] : data)
sumRejected += count;
std::cout << "Number of registered rejections: " << sumRejected << std::endl;
for (const auto& [reason, count] : data)
std::cout << "\t-" << reason << ": " << count << " / "
for (const auto& [label, count] : data)
std::cout << "\t-" << label << ": " << count << " / "
<< std::setprecision(2) << std::fixed
<< 100.0*count/sumRejected << " %" << std::endl;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment