nimble.calculate.detectBestResult

nimble.calculate.detectBestResult(functionToCheck)

Determine if higher or lower values are optimal for the function.

Provides sample data to the functionToCheck and evaluates the results to determine whether the function associates correctness of predictions with minimum returned values or maximum returned values. The trials are avoided if functionToCheck has an ‘optimal’ attribute with the value ‘min’ or ‘max’. The optimal values are ‘min’ if lower values are associated with correctness of predictions by functionToCheck, or ‘max’ if higher values are associated with correctness.

Functions are expected to take two parameters, knownValues and predictedValues. The knownValues are the known data which will be compared to the predictedValues. The predictedValues should accept data in one of three forms, depending whether the ‘scoreMode’ is set to ‘labels’, ‘bestScore’, or ‘allScores’. This function will test also determine the ‘scoreMode’ expected by functionToCheck.

Parameters:

functionToCheck (function) – In the form function(knownValues, predictedValues) that is expected to return a single numeric value.