Waikato / meka

Multi-label classifiers and evaluation procedures using the Weka machine learning framework.
http://waikato.github.io/meka/
GNU General Public License v3.0
200 stars 76 forks source link

FIX: calibrateThreshold throws IndexOutOfBounds for low LC in combination with relatively few test instances #80

Closed lorsbach closed 1 year ago

lorsbach commented 1 year ago

In cases where the label cardinality is low and there are few test instances at the same time, calibrateThreshold throws an IndexOutOfBounds Exception.

This PR adds an additional check if to avoid the IndexOutOfBounds Exception by using the mean of the last two obtained probabilities.

Additionally within the existing edge case the bracketing seemed to be wrong and is fixed as well together with the removal of unnecessary casts.