Esempio n. 1
0
 def tvar(self, probabilities, auto_retry=True, **params):
     probabilities = vectorize(probabilities)
     path = '{}/tvar/{}'.format(self._get_path(self.id), probabilities)
     return self._get_metrics(path, params, auto_retry=auto_retry)
Esempio n. 2
0
def test_vectorize():
    x = 123
    assert utils.vectorize(x) == 123
    x = [123, 456]
    assert utils.vectorize(x) == '123,456'
Esempio n. 3
0
 def tvar(self, probabilities, auto_retry=True, **params):
     probabilities = vectorize(probabilities)
     path = '%s/tvar/%s' % (self._get_path(self.id), probabilities)
     resp = self._get_metrics(path, params, auto_retry=auto_retry)
     return resp if isinstance(resp, list) else float(resp)
Esempio n. 4
0
 def ep(self, thresholds, auto_retry=True, **params):
     thresholds = vectorize(thresholds)
     path = '{}/exceedance_probabilities/{}'.format(self._get_path(self.id),
                                                    thresholds)
     return self._get_metrics(path, params, auto_retry=auto_retry)
Esempio n. 5
0
 def co_metrics(self, probabilities, auto_retry=True, **params):
     probabilities = vectorize(probabilities)
     path = '%s/co_metrics/%s' % (self._get_path(self.id), probabilities)
     return self._get_metrics(path, params, auto_retry=auto_retry)
Esempio n. 6
0
def test_vectorize():
    x = 123
    assert utils.vectorize(x) == 123
    x = [123, 456]
    assert utils.vectorize(x) == '123,456'
 def tvar(self, probabilities, auto_retry=True, **params):
     probabilities = vectorize(probabilities)
     path = "%s/tvar/%s" % (self._get_path(self.id), probabilities)
     resp = self._get_metrics(path, params, auto_retry=auto_retry)
     return resp if isinstance(resp, list) else float(resp)
 def ep(self, thresholds, auto_retry=True, **params):
     thresholds = vectorize(thresholds)
     path = "%s/exceedance_probabilities/%s" % (self._get_path(self.id), thresholds)
     return self._get_metrics(path, params, auto_retry=auto_retry)
 def co_metrics(self, probabilities, auto_retry=True, **params):
     probabilities = vectorize(probabilities)
     path = "%s/co_metrics/%s" % (self._get_path(self.id), probabilities)
     return self._get_metrics(path, params, auto_retry=auto_retry)