Skip to content

Commit

Permalink
Added ratio of number of segments to segmentation evaluation measures
Browse files Browse the repository at this point in the history
  • Loading branch information
jpauwels committed Oct 7, 2015
1 parent b31c230 commit 178cf1c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions MusOOEvaluator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -808,6 +808,7 @@ int main(int inNumOfArguments,char* inArguments[])
theOutputFile << "Duration of evaluated segments: " << theSegmentationEvaluation.calcTotalDuration() << " s" << endl;
theOutputFile << "Average number of reference segments: " << theSegmentationEvaluation.calcAverageNumRefSegments() << endl;
theOutputFile << "Average number of test segments: " << theSegmentationEvaluation.calcAverageNumTestSegments() << endl;
theOutputFile << "Average ratio of number of segments: " << theSegmentationEvaluation.calcAverageSegmentsRatio() << endl;
theOutputFile << "Average combined Hamming measure (worst): " << theSegmentationEvaluation.calcAverageCombinedHammingMeasureWorst() << endl;
theOutputFile << "Average combined Hamming measure (harmonic): " << theSegmentationEvaluation.calcAverageCombinedHammingMeasureHarmonic() << endl;
theOutputFile << "Average under-segmentation: " << theSegmentationEvaluation.calcAverageUnderSegmentation() << endl;
Expand Down
5 changes: 5 additions & 0 deletions SegmentationEvaluation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,11 @@ const double SegmentationEvaluation::calcAverageNumTestSegments() const
return std::accumulate(m_NumTestSegments.begin(), m_NumTestSegments.end(), 0.) / static_cast<double>(m_NumTestSegments.size());
}

const double SegmentationEvaluation::calcAverageSegmentsRatio() const
{
return std::inner_product(m_NumTestSegments.begin(), m_NumTestSegments.end(), m_NumRefSegments.begin(), 0., std::plus<double>(), std::divides<double>()) / static_cast<double>(m_NumTestSegments.size());
}

const double SegmentationEvaluation::calcAverageUnderSegmentation() const
{
return std::accumulate(m_MissedBoundaries.begin(), m_MissedBoundaries.end(), static_cast<double>(m_MissedBoundaries.size()), std::minus<double>()) / m_MissedBoundaries.size();
Expand Down
1 change: 1 addition & 0 deletions SegmentationEvaluation.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ class SegmentationEvaluation
const double calcTotalDuration() const;
const double calcAverageNumRefSegments() const;
const double calcAverageNumTestSegments() const;
const double calcAverageSegmentsRatio() const;
const double calcAverageUnderSegmentation() const;
const double calcWeightedAverageUnderSegmentation() const;
const double calcAverageOverSegmentation() const;
Expand Down

0 comments on commit 178cf1c

Please sign in to comment.