This function takes a value and a vector of thresholds It iterates over the reversed vector of indexes in the thresholds vector And checks if the value is less than the threshold value at the itered index (comparing from smallest to largest). The threshold score is calculated as the length of the thresholds minus every else branch iter of the loop.