Evaluates the accuracy of a predictive measure (e.g. r-squared)

    :param value: float, between 0.0 and 1.0.
    :return:
502471
def lc_score(value):
    
    rebased = 2 * (value - 0.5)

    if rebased == 0:
        return 0
    elif rebased > 0:
        compliment = 1.0 - rebased
        score = - np.log2(compliment)
    else:
        compliment = 1.0 + rebased
        score = np.log2(compliment)
    return score
188055
def _compute_inflation(value, reference_value):
        
        res = value / float(reference_value)
        return InflationResult(factor=res, value=res - 1)
850806
def score(self, X, y):
        
        predictions = self.predict(X)
        true = 0.0
        total = 0.0
        for i in range(len(predictions)):
            total += 1
            if predictions[i] == y[i]:
                true += 1
        return true/total
664184
def overall_accuracy_calc(TP, POP):
    
    try:
        overall_accuracy = sum(TP.values()) / POP
        return overall_accuracy
    except Exception:
        return "None"
1311991
def accuracy(self):
        
        true_pos = self.matrix[0][0]
        false_pos = self.matrix[1][0]
        false_neg = self.matrix[0][1]
        true_neg = self.matrix[1][1]

        num = 1.0 * (true_pos + true_neg)
        den = true_pos + true_neg + false_pos + false_neg

        return divide(num, den)
734358
def getIndexForValue(self, value):
        
        return math.trunc(self.slope * float(value) + self.intercept)
281269
def predict(parameters_value, regressor_gp):
    '''
    
    '''
    parameters_value = numpy.array(parameters_value).reshape(-1, len(parameters_value))
    mu, sigma = regressor_gp.predict(parameters_value, return_std=True)

    return mu[0], sigma[0]
1353570
def value(self, value):
        
        args = (self.__ptr, int(value))
        _ec.metric_set(args)
516435
private static function checkZero(float $value, float $epsilon = self::EPSILON): float
    {
        return abs($value) < $epsilon ? 0.0 : $value;
    }
390835
def valueAt(self, percent):
        
        values = self.values()
        if percent < 0:
            index = 0
        elif percent > 1:
            index = -1
        else:
            index = percent * (len(values) - 1)
        
        # allow some floating point errors for the index (30% left or right)
        remain = index % 1
        if remain < 0.3 or 0.7 < remain:
            try:
                return values[int(round(index))]
            except IndexError:
                return None
        return None
786992
def accuracy(input:Tensor, targs:Tensor)->Rank0Tensor:
    ""
    n = targs.shape[0]
    input = input.argmax(dim=-1).view(n,-1)
    targs = targs.view(n,-1)
    return (input==targs).float().mean()
390776
def error_value_processor(value, error):
    
    if isinstance(error, (str, unicode)):
        try:
            if "%" in error:
                error_float = float(error.replace("%", ""))
                error_abs = (value/100) * error_float
                return error_abs
            elif error == "":
                error = 0.0
            else:
                error = float(error)
        except:
            pass

    return error
1327033
def _fast_normalise(self):
        
        if not self.is_unit():
            mag_squared = np.dot(self.q, self.q)
            if (mag_squared == 0):
                return
            if (abs(1.0 - mag_squared) < 2.107342e-08):
                mag =  ((1.0 + mag_squared) / 2.0) # More efficient. Pade approximation valid if error is small
            else:
                mag =  sqrt(mag_squared) # Error is too big, take the performance hit to calculate the square root properly

            self.q = self.q / mag
925271
def R(self, value):
        
        self._R = value
        self._R1_2 = cholesky(self._R, lower=True)
1035481
function roundToStepRatio (value, stepRatio) {
  const stepRatioDecimals = calculateDecimals(stepRatio);
  const stepDecimalsMultiplier = Math.pow(10, stepRatioDecimals);

  value = Math.round(value / stepRatio) * stepRatio;

  return Math.round(value * stepDecimalsMultiplier) / stepDecimalsMultiplier;
}
30264
def score(self, X, y):
        """"""

        from sklearn.metrics import accuracy_score
        return accuracy_score(y, self.predict(X))
954394
def accuracy(logits, labels):
  """"""
  is_correct = tf.nn.in_top_k(logits, labels, 1)
  correct = tf.reduce_sum(tf.cast(is_correct, tf.int32))
  incorrect = tf.reduce_sum(tf.cast(tf.logical_not(is_correct), tf.int32))
  correct_count = tf.Variable(0, False)
  incorrect_count = tf.Variable(0, False)
  correct_count_update = tf.assign_add(correct_count, correct)
  incorrect_count_update = tf.assign_add(incorrect_count, incorrect)
  accuracy_op = tf.cast(correct_count, tf.float32) / tf.cast(
      correct_count + incorrect_count, tf.float32)
  return [correct_count_update, incorrect_count_update], accuracy_op