curl --request GET \
--url https://api.vainona.ai/v1/namespaces/{ns}/judgments/{name}/thresholds/recommend \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.vainona.ai/v1/namespaces/{ns}/judgments/{name}/thresholds/recommend"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.vainona.ai/v1/namespaces/{ns}/judgments/{name}/thresholds/recommend', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.vainona.ai/v1/namespaces/{ns}/judgments/{name}/thresholds/recommend",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.vainona.ai/v1/namespaces/{ns}/judgments/{name}/thresholds/recommend"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.vainona.ai/v1/namespaces/{ns}/judgments/{name}/thresholds/recommend")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vainona.ai/v1/namespaces/{ns}/judgments/{name}/thresholds/recommend")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"status": "recommended",
"threshold": 0.5,
"precision": 0.5,
"recall": 0.5,
"interval": {
"lower": 0.5,
"upper": 0.5
},
"outcomes": 101,
"from_previous_epoch": true,
"curve": [
{
"threshold": 0.5,
"precision": 0.5,
"recall": 0.5
}
]
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {}
}
}Recommend a threshold for a precision or recall target
The threshold on the raw p (bool) or raw dist[option] (choice) that
meets the target on the active version’s outcomes (§6.10). A document
counts as predicted positive when the raw value is at least the
threshold, and as positive when its outcome is true (bool) or equals
option (choice).
- For a precision target, the lowest threshold whose precision meets it, which keeps the most recall.
- For a recall target, the highest threshold whose recall meets it, which keeps the most precision.
The recommendation rests on the outcomes of the current engine epoch.
When that epoch has fewer than 100, it uses the previous epoch’s and
says so with from_previous_epoch, as calibration does. Nothing
changes until the threshold is applied with PATCH. Score judgments
have no recommendation in v1.5 (invalid_request).
curl --request GET \
--url https://api.vainona.ai/v1/namespaces/{ns}/judgments/{name}/thresholds/recommend \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.vainona.ai/v1/namespaces/{ns}/judgments/{name}/thresholds/recommend"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.vainona.ai/v1/namespaces/{ns}/judgments/{name}/thresholds/recommend', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.vainona.ai/v1/namespaces/{ns}/judgments/{name}/thresholds/recommend",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.vainona.ai/v1/namespaces/{ns}/judgments/{name}/thresholds/recommend"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.vainona.ai/v1/namespaces/{ns}/judgments/{name}/thresholds/recommend")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vainona.ai/v1/namespaces/{ns}/judgments/{name}/thresholds/recommend")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"status": "recommended",
"threshold": 0.5,
"precision": 0.5,
"recall": 0.5,
"interval": {
"lower": 0.5,
"upper": 0.5
},
"outcomes": 101,
"from_previous_epoch": true,
"curve": [
{
"threshold": 0.5,
"precision": 0.5,
"recall": 0.5
}
]
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {}
}
}Authorizations
An organization API key. Keys carry a role (read_write or
read_only) and may be restricted to a namespace prefix such as
acme/*, or to one namespace such as acme/prod/tenant_1. A prefix
matches on a / boundary: acme/prod/tenant_1* covers
acme/prod/tenant_1 and everything under acme/prod/tenant_1/,
never acme/prod/tenant_12.
Path Parameters
A namespace name, or a template prefix ending in /* (§7.7), with any
/ sent as %2F: acme%2Fprod%2Ftenant_123 or acme%2Fprod%2F*.
A namespace name, or a template prefix: a namespace path ending in
/*, such as acme/prod/*, which every namespace under acme/prod/
inherits judgments from (§7.7). Up to 256 bytes.
1 - 256^[A-Za-z0-9._:/-]+(/\*)?$A judgment, attribute or threshold name. Names are path segments in field references, so they never contain ..
1 - 128^[A-Za-z0-9_-]+$Query Parameters
The metric and the value to meet, such as precision:0.9 or recall:0.8.
A metric and the value to meet, such as precision:0.9 or recall:0.8.
^(precision|recall):(0?\.[0-9]*[1-9][0-9]*|1|1\.0+)$Required for a choice judgment, and refused for a bool one. The option the threshold is for, such as fraud.
1Response
A recommendation, an unreachable target, or too few outcomes; status says which.
- Option 1
- Option 2
- Option 3
Apply threshold with the judgment PATCH: {"escalate": threshold} for a bool judgment, {"fraud": {"value": option, "gte": threshold}} for a choice.
The threshold on the raw value, one of the curve's points.
0 <= x <= 1Precision on these outcomes at the threshold.
0 <= x <= 1Recall on these outcomes at the threshold.
0 <= x <= 1The 95% interval of the targeted metric at the threshold.
Show child attributes
Show child attributes
The number of outcomes the recommendation rests on.
x >= 100True when the current engine epoch has fewer than 100 outcomes and the previous epoch's were used.
Precision and recall at each threshold from 0.00 to 1.00 in steps of 0.01, lowest first: 101 points.
101Show child attributes
Show child attributes