{"id":"classification-metrics-compute","version":"1.0.0","description":"Compute exact binary-classification metrics from integer confusion-matrix counts as reduced fractions or null.","supported_operations":["compute binary classification metrics","confusion matrix precision recall and f1","exact accuracy from tp fp tn fn","calculate sensitivity and specificity","negative predictive value from counts","balanced accuracy as a fraction","classification prevalence from confusion matrix"],"unsupported_operations":["multiclass confusion matrices","confidence intervals or hypothesis tests","threshold selection or ROC curves"],"semantics":["Counts tp, fp, tn and fn are required non-negative integers at most 1000000000.","Metrics use standard confusion-matrix definitions and return reduced n/d strings; an exactly zero numerator is 0/1.","A metric with a zero denominator is null; the all-zero matrix is valid and makes every metric null.","balanced_accuracy is the exact arithmetic mean of recall and specificity and is null if either component is undefined.","No decimal approximation or rounding occurs; output field order is fixed and input is not mutated."],"limits":{"max_count":1000000000,"max_input_bytes":256},"pricing":{"status":"unpriced","charge_usd":null},"input_schema":{"type":"object","additionalProperties":false,"properties":{"tp":{"type":"integer","minimum":0,"maximum":1000000000},"fp":{"type":"integer","minimum":0,"maximum":1000000000},"tn":{"type":"integer","minimum":0,"maximum":1000000000},"fn":{"type":"integer","minimum":0,"maximum":1000000000}},"required":["tp","fp","tn","fn"]},"output_schema":{"type":"object","additionalProperties":false,"properties":{"total":{"type":"integer","minimum":0,"maximum":4000000000},"accuracy":{"type":["string","null"]},"precision":{"type":["string","null"]},"recall":{"type":["string","null"]},"specificity":{"type":["string","null"]},"f1":{"type":["string","null"]},"negative_predictive_value":{"type":["string","null"]},"prevalence":{"type":["string","null"]},"balanced_accuracy":{"type":["string","null"]}},"required":["total","accuracy","precision","recall","specificity","f1","negative_predictive_value","prevalence","balanced_accuracy"]},"examples":[{"input":{"tp":42,"fp":8,"tn":45,"fn":5},"output":{"total":100,"accuracy":"87/100","precision":"21/25","recall":"42/47","specificity":"45/53","f1":"84/97","negative_predictive_value":"9/10","prevalence":"47/100","balanced_accuracy":"4341/4982"}},{"input":{"tp":0,"fp":0,"tn":0,"fn":0},"output":{"total":0,"accuracy":null,"precision":null,"recall":null,"specificity":null,"f1":null,"negative_predictive_value":null,"prevalence":null,"balanced_accuracy":null}}],"execute_url":"/v1/tools/classification-metrics-compute/versions/1.0.0/execute"}