{"openapi":"3.1.0","info":{"title":"Machine Learning Metrics","version":"1.0.0","description":"Classification, ranking, regression, calibration and text-generation metrics computed exactly from arrays you send. One call, one computed answer, no accounts or API keys. Machine-payable over x402.","x-guidance":"Machine Learning Metrics: Classification, ranking, regression, calibration and text-generation metrics computed exactly from arrays you send. Machine Learning Metrics computes evaluation numbers an agent should not do by hand, from arrays you supply: /confusion-matrix (accuracy, precision, recall, F1, MCC, kappa, macro/micro/weighted), /roc-auc (ROC curve and AUC with ties), /precision-recall (PR curve and average precision), /regression-metrics (MAE, RMSE, R2, MAPE and more), /log-loss (cross entropy with clipping), /bleu-rouge (sentence BLEU and ROUGE-1/2/L), /calibration (reliability bins, expected calibration error) and /threshold-sweep (best F1 and Youden threshold). Arrays travel in the query string as comma-separated lists or JSON. Each paid GET returns a computed verdict with the reasons, the source and what was NOT checked. A verdict of UNVERIFIED means a lookup failed: treat it as unknown. No account or key: pay per call in USDC over x402."},"servers":[{"url":"https://ml-metrics.x402tookit.com"}],"paths":{"/bleu-rouge":{"get":{"operationId":"bleu_rouge","summary":"Sentence BLEU (1-4 gram, brevity penalty, optional smoothing) and ROUGE-1, ROUGE-2, ROUGE-L F1 for text against references.","description":"Sentence BLEU (1-4 gram, brevity penalty, optional smoothing) and ROUGE-1, ROUGE-2, ROUGE-L F1 for text against references.","tags":["nlp","bleu","rouge","machine-translation","summarization"],"parameters":[{"name":"candidate","in":"query","required":true,"description":"Generated text, up to 5000 characters","schema":{"type":"string"}},{"name":"references","in":"query","required":true,"description":"One or more reference texts separated by a line break or |||, up to 20 references, 5000 characters each","schema":{"type":"string"}},{"name":"tokenizer","in":"query","required":false,"description":"whitespace (default, text is split on spaces as given) or words (lowercase, punctuation removed)","schema":{"type":"string"}},{"name":"smoothing","in":"query","required":false,"description":"none (default), add1 (add one to n>1 counts), or epsilon (0.1 for zero matches)","schema":{"type":"string"}},{"name":"maxn","in":"query","required":false,"description":"Highest BLEU n-gram order, 1 to 4, default 4","schema":{"type":"integer"}}],"responses":{"200":{"description":"The answer.","content":{"application/json":{"schema":{"type":"object","properties":{"verdict":{"type":["null","string"]},"summary":{"type":["null","string"]},"reasons":{"type":["array","null"]},"bleu":{"type":["null","number"]},"bleuOrder":{"type":["null","number"]},"smoothing":{"type":["null","string"]},"tokenizer":{"type":["null","string"]},"brevityPenalty":{"type":["null","number"]},"candidateTokens":{"type":["null","number"]},"closestReferenceTokens":{"type":["null","number"]},"referenceCount":{"type":["null","number"]},"ngramPrecisions":{"type":["array","null"],"items":{"type":"object","properties":{"n":{"type":["null","number"]},"matches":{"type":["null","number"]},"total":{"type":["null","number"]},"precision":{"type":["null","number"]}}}},"rouge1":{"type":["null","object"],"properties":{"precision":{"type":["null","number"]},"recall":{"type":["null","number"]},"f1":{"type":["null","number"]}}},"rouge2":{"type":["null","object"],"properties":{"precision":{"type":["null","number"]},"recall":{"type":["null","number"]},"f1":{"type":["null","number"]}}},"rougeL":{"type":["null","object"],"properties":{"precision":{"type":["null","number"]},"recall":{"type":["null","number"]},"f1":{"type":["null","number"]}}},"rougeNote":{"type":["null","string"]},"degraded":{"type":["boolean","null"]},"notChecked":{"type":["array","null"],"items":{"type":"string"}},"source":{"type":["null","string"]},"asOf":{"type":["null","string"]},"disclaimer":{"type":["null","string"]}}},"example":{"verdict":"MODERATE_OVERLAP","summary":"BLEU-4 0.485492; ROUGE-1 F1 0.833333, ROUGE-2 F1 0.6, ROUGE-L F1 0.833333.","reasons":[],"bleu":0.485492,"bleuOrder":4,"smoothing":"add1","tokenizer":"whitespace","brevityPenalty":1,"candidateTokens":6,"closestReferenceTokens":6,"referenceCount":1,"ngramPrecisions":[{"n":1,"matches":5,"total":6,"precision":0.833333},{"n":2,"matches":3,"total":5,"precision":0.666667}],"rouge1":{"precision":0.833333,"recall":0.833333,"f1":0.833333},"rouge2":{"precision":0.6,"recall":0.6,"f1":0.6},"rougeL":{"precision":0.833333,"recall":0.833333,"f1":0.833333},"rougeNote":"With several references each ROUGE score is the best F1 over the references.","degraded":false,"notChecked":["semantic quality (n-gram overlap only)","stemming, synonyms or ROUGE-S/SU variants","…2 more"],"source":"computed locally","asOf":"2026-10-21T05:49:43.592Z","disclaimer":"Screening signal computed from the named public source. Not financial, legal or investment advice; provided as is. Verify at the source before acting."}}}},"400":{"description":"A parameter was missing or out of range."},"402":{"description":"Payment Required"},"502":{"description":"The upstream source failed or timed out."}},"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.0200"},"protocols":[{"x402":{"network":"eip155:8453","scheme":"exact","currency":"USDC","endpoint":"https://ml-metrics.x402tookit.com/bleu-rouge"}},{"x402":{"network":"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp","scheme":"exact","currency":"USDC","endpoint":"https://ml-metrics.x402tookit.com/bleu-rouge"}},{"x402":{"network":"eip155:137","scheme":"exact","currency":"USDC","endpoint":"https://ml-metrics.x402tookit.com/bleu-rouge"}},{"x402":{"network":"eip155:42161","scheme":"exact","currency":"USDC","endpoint":"https://ml-metrics.x402tookit.com/bleu-rouge"}}]}}},"/calibration":{"get":{"operationId":"calibration","summary":"Reliability bins, expected and maximum calibration error and Brier score from binary labels and predicted probabilities.","description":"Reliability bins, expected and maximum calibration error and Brier score from binary labels and predicted probabilities.","tags":["machine-learning","calibration","ece","brier-score"],"parameters":[{"name":"labels","in":"query","required":true,"description":"True binary labels 0/1, comma-separated or JSON array, up to 10000 values","schema":{"type":"string"}},{"name":"probs","in":"query","required":true,"description":"Predicted probability of class 1 per sample (0 to 1), same length","schema":{"type":"string"}},{"name":"bins","in":"query","required":false,"description":"Number of bins, 2 to 50, default 10","schema":{"type":"integer"}},{"name":"strategy","in":"query","required":false,"description":"uniform (equal-width bins, default) or quantile (equal-count bins)","schema":{"type":"string"}}],"responses":{"200":{"description":"The answer.","content":{"application/json":{"schema":{"type":"object","properties":{"verdict":{"type":["null","string"]},"summary":{"type":["null","string"]},"reasons":{"type":["array","null"],"items":{"type":"string"}},"expectedCalibrationError":{"type":["null","number"]},"maximumCalibrationError":{"type":["null","number"]},"brierScore":{"type":["null","number"]},"sampleCount":{"type":["null","number"]},"binCount":{"type":["null","number"]},"strategy":{"type":["null","string"]},"bins":{"type":["array","null"],"items":{"type":"object","properties":{"bin":{"type":["null","number"]},"count":{"type":["null","number"]},"meanPredicted":{"type":["null","number"]},"observedRate":{"type":["null","number"]},"gap":{"type":["null","number"]},"lowest":{"type":["null","number"]},"highest":{"type":["null","number"]},"direction":{"type":["null","string"]}}}},"degraded":{"type":["boolean","null"]},"notChecked":{"type":["array","null"],"items":{"type":"string"}},"source":{"type":["null","string"]},"asOf":{"type":["null","string"]},"disclaimer":{"type":["null","string"]}}},"example":{"verdict":"POORLY_CALIBRATED","summary":"Expected calibration error 0.25, max 0.4, Brier 0.21 over 4 sample(s) in 10 uniform bins.","reasons":["ECE bands (0.05, 0.15) are a rule of thumb; ECE depends on the bin count and is noisy with few samples."],"expectedCalibrationError":0.25,"maximumCalibrationError":0.4,"brierScore":0.21,"sampleCount":4,"binCount":10,"strategy":"uniform","bins":[{"bin":0,"count":0,"meanPredicted":null,"observedRate":null,"gap":null},{"bin":1,"count":2,"lowest":0.1,"highest":0.1,"meanPredicted":0.1,"observedRate":0.5,"gap":0.4,"direction":"under-confident"}],"degraded":false,"notChecked":["confidence intervals on bin accuracies","sensitivity of ECE to the number of bins","…1 more"],"source":"computed locally","asOf":"2026-10-21T05:49:43.846Z","disclaimer":"Screening signal computed from the named public source. Not financial, legal or investment advice; provided as is. Verify at the source before acting."}}}},"400":{"description":"A parameter was missing or out of range."},"402":{"description":"Payment Required"},"502":{"description":"The upstream source failed or timed out."}},"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.0200"},"protocols":[{"x402":{"network":"eip155:8453","scheme":"exact","currency":"USDC","endpoint":"https://ml-metrics.x402tookit.com/calibration"}},{"x402":{"network":"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp","scheme":"exact","currency":"USDC","endpoint":"https://ml-metrics.x402tookit.com/calibration"}},{"x402":{"network":"eip155:137","scheme":"exact","currency":"USDC","endpoint":"https://ml-metrics.x402tookit.com/calibration"}},{"x402":{"network":"eip155:42161","scheme":"exact","currency":"USDC","endpoint":"https://ml-metrics.x402tookit.com/calibration"}}]}}},"/confusion-matrix":{"get":{"operationId":"confusion_matrix","summary":"Confusion matrix from true and predicted labels: accuracy, precision, recall, specificity, F1, MCC, kappa, averages.","description":"Confusion matrix from true and predicted labels: accuracy, precision, recall, specificity, F1, MCC, kappa, averages.","tags":["machine-learning","classification","confusion-matrix","f1","mcc"],"parameters":[{"name":"actual","in":"query","required":true,"description":"True labels, comma-separated or JSON array, up to 10000 values","schema":{"type":"string"}},{"name":"predicted","in":"query","required":true,"description":"Predicted labels in the same order and length as actual","schema":{"type":"string"}},{"name":"positive","in":"query","required":false,"description":"For two classes: the label treated as positive (default: 1, true, or the last label in sorted order)","schema":{"type":"string"}}],"responses":{"200":{"description":"The answer.","content":{"application/json":{"schema":{"type":"object","properties":{"verdict":{"type":["null","string"]},"summary":{"type":["null","string"]},"reasons":{"type":["array","null"]},"sampleCount":{"type":["null","number"]},"labels":{"type":["array","null"],"items":{"type":"string"}},"matrix":{"type":["array","null"],"items":{"type":"array","items":{"type":"number"}}},"matrixNote":{"type":["null","string"]},"accuracy":{"type":["null","number"]},"cohenKappa":{"type":["null","number"]},"mcc":{"type":["null","number"]},"perClass":{"type":["array","null"],"items":{"type":"object","properties":{"label":{"type":["null","string"]},"support":{"type":["null","number"]},"tp":{"type":["null","number"]},"fp":{"type":["null","number"]},"fn":{"type":["null","number"]},"tn":{"type":["null","number"]},"precision":{"type":["null","number"]},"recall":{"type":["null","number"]},"specificity":{"type":["null","number"]},"f1":{"type":["null","number"]}}}},"averages":{"type":["null","object"],"properties":{"macro":{"type":["null","object"],"properties":{"precision":{"type":["null","number"]},"recall":{"type":["null","number"]},"f1":{"type":["null","number"]}}},"weighted":{"type":["null","object"],"properties":{"precision":{"type":["null","number"]},"recall":{"type":["null","number"]},"f1":{"type":["null","number"]}}},"micro":{"type":["null","object"],"properties":{"precision":{"type":["null","number"]},"recall":{"type":["null","number"]},"f1":{"type":["null","number"]}}}}},"undefinedRatioConvention":{"type":["null","string"]},"binary":{"type":["null","object"],"properties":{"positiveLabel":{"type":["null","string"]},"tp":{"type":["null","number"]},"fp":{"type":["null","number"]},"tn":{"type":["null","number"]},"fn":{"type":["null","number"]},"accuracy":{"type":["null","number"]},"precision":{"type":["null","number"]},"recall":{"type":["null","number"]},"specificity":{"type":["null","number"]},"f1":{"type":["null","number"]},"mcc":{"type":["null","number"]},"cohenKappa":{"type":["null","number"]},"balancedAccuracy":{"type":["null","number"]}}},"degraded":{"type":["boolean","null"]},"notChecked":{"type":["array","null"],"items":{"type":"string"}},"source":{"type":["null","string"]},"asOf":{"type":["null","string"]},"disclaimer":{"type":["null","string"]}}},"example":{"verdict":"BINARY","summary":"10 samples, 2 class(es): accuracy 0.8, MCC 0.583333, macro F1 0.791667.","reasons":[],"sampleCount":10,"labels":["0","1"],"matrix":[[5,1],[1,3]],"matrixNote":"rows are actual labels, columns are predicted labels, in the order of labels","accuracy":0.8,"cohenKappa":0.583333,"mcc":0.583333,"perClass":[{"label":"0","support":6,"tp":5,"fp":1,"fn":1,"tn":3,"precision":0.833333,"recall":0.833333,"specificity":0.75,"f1":0.833333},{"label":"1","support":4,"tp":3,"fp":1,"fn":1,"tn":5,"precision":0.75,"recall":0.75,"specificity":0.833333,"f1":0.75}],"averages":{"macro":{"precision":0.791667,"recall":0.791667,"f1":0.791667},"weighted":{"precision":0.8,"recall":0.8,"f1":0.8},"micro":{"precision":0.8,"recall":0.8,"f1":0.8}},"undefinedRatioConvention":"precision, recall, specificity or F1 with a zero denominator is reported as 0","binary":{"positiveLabel":"1","tp":3,"fp":1,"tn":5,"fn":1,"accuracy":0.8,"precision":0.75,"recall":0.75,"specificity":0.833333,"f1":0.75,"mcc":0.583333,"cohenKappa":0.583333,"balancedAccuracy":0.791667},"degraded":false,"notChecked":["class imbalance effects beyond the weighted average","confidence intervals","…1 more"],"source":"computed locally","asOf":"2026-10-21T05:49:44.098Z","disclaimer":"Screening signal computed from the named public source. Not financial, legal or investment advice; provided as is. Verify at the source before acting."}}}},"400":{"description":"A parameter was missing or out of range."},"402":{"description":"Payment Required"},"502":{"description":"The upstream source failed or timed out."}},"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.0200"},"protocols":[{"x402":{"network":"eip155:8453","scheme":"exact","currency":"USDC","endpoint":"https://ml-metrics.x402tookit.com/confusion-matrix"}},{"x402":{"network":"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp","scheme":"exact","currency":"USDC","endpoint":"https://ml-metrics.x402tookit.com/confusion-matrix"}},{"x402":{"network":"eip155:137","scheme":"exact","currency":"USDC","endpoint":"https://ml-metrics.x402tookit.com/confusion-matrix"}},{"x402":{"network":"eip155:42161","scheme":"exact","currency":"USDC","endpoint":"https://ml-metrics.x402tookit.com/confusion-matrix"}}]}}},"/log-loss":{"get":{"operationId":"log_loss","summary":"Binary or multiclass log loss (cross entropy) with epsilon clipping, plus the no-skill baseline and worst samples.","description":"Binary or multiclass log loss (cross entropy) with epsilon clipping, plus the no-skill baseline and worst samples.","tags":["machine-learning","log-loss","cross-entropy","classification"],"parameters":[{"name":"labels","in":"query","required":true,"description":"Binary: 0/1 labels. Multiclass: class index (0-based) or class name per sample; up to 10000 values","schema":{"type":"string"}},{"name":"probs","in":"query","required":true,"description":"Binary: P(label=1) per sample, comma list. Multiclass: JSON array of per-sample probability rows","schema":{"type":"string"}},{"name":"classes","in":"query","required":false,"description":"Multiclass only: class names in the column order of probs, if labels are names","schema":{"type":"string"}},{"name":"eps","in":"query","required":false,"description":"Clipping epsilon, default 1e-15, between 1e-300 and 0.5","schema":{"type":"string"}}],"responses":{"200":{"description":"The answer.","content":{"application/json":{"schema":{"type":"object","properties":{"verdict":{"type":["null","string"]},"summary":{"type":["null","string"]},"reasons":{"type":["array","null"]},"logLoss":{"type":["null","number"]},"sampleCount":{"type":["null","number"]},"mode":{"type":["null","string"]},"classCount":{"type":["null","number"]},"uniformBaseline":{"type":["null","number"]},"epsilon":{"type":["null","number"]},"clippedValues":{"type":["null","number"]},"worstSamples":{"type":["array","null"],"items":{"type":"object","properties":{"index":{"type":["null","number"]},"loss":{"type":["null","number"]}}}},"degraded":{"type":["boolean","null"]},"notChecked":{"type":["array","null"],"items":{"type":"string"}},"source":{"type":["null","string"]},"asOf":{"type":["null","string"]},"disclaimer":{"type":["null","string"]}}},"example":{"verdict":"WELL_BELOW_BASELINE","summary":"Binary log loss 0.164252 over 2 sample(s); a uniform guess scores 0.693147.","reasons":[],"logLoss":0.164252,"sampleCount":2,"mode":"binary","classCount":2,"uniformBaseline":0.693147,"epsilon":1e-15,"clippedValues":0,"worstSamples":[{"index":1,"loss":0.223144},{"index":0,"loss":0.105361}],"degraded":false,"notChecked":["whether probabilities are calibrated (use /calibration)","rows that do not sum to 1 are not renormalised"],"source":"computed locally","asOf":"2026-10-21T05:49:44.348Z","disclaimer":"Screening signal computed from the named public source. Not financial, legal or investment advice; provided as is. Verify at the source before acting."}}}},"400":{"description":"A parameter was missing or out of range."},"402":{"description":"Payment Required"},"502":{"description":"The upstream source failed or timed out."}},"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.0200"},"protocols":[{"x402":{"network":"eip155:8453","scheme":"exact","currency":"USDC","endpoint":"https://ml-metrics.x402tookit.com/log-loss"}},{"x402":{"network":"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp","scheme":"exact","currency":"USDC","endpoint":"https://ml-metrics.x402tookit.com/log-loss"}},{"x402":{"network":"eip155:137","scheme":"exact","currency":"USDC","endpoint":"https://ml-metrics.x402tookit.com/log-loss"}},{"x402":{"network":"eip155:42161","scheme":"exact","currency":"USDC","endpoint":"https://ml-metrics.x402tookit.com/log-loss"}}]}}},"/precision-recall":{"get":{"operationId":"precision_recall","summary":"Precision-recall curve points and average precision (step-wise sum) from binary labels and scores, with the baseline.","description":"Precision-recall curve points and average precision (step-wise sum) from binary labels and scores, with the baseline.","tags":["machine-learning","precision-recall","average-precision","classification"],"parameters":[{"name":"labels","in":"query","required":true,"description":"True binary labels 0/1, comma-separated or JSON array, up to 10000 values","schema":{"type":"string"}},{"name":"scores","in":"query","required":true,"description":"Model scores (higher = more positive), same length as labels","schema":{"type":"string"}}],"responses":{"200":{"description":"The answer.","content":{"application/json":{"schema":{"type":"object","properties":{"verdict":{"type":["null","string"]},"summary":{"type":["null","string"]},"reasons":{"type":["array","null"],"items":{"type":"string"}},"averagePrecision":{"type":["null","number"]},"baseline":{"type":["null","number"]},"positives":{"type":["null","number"]},"negatives":{"type":["null","number"]},"curve":{"type":["array","null"],"items":{"type":"object","properties":{"threshold":{"type":["null","number"]},"precision":{"type":["null","number"]},"recall":{"type":["null","number"]}}}},"curveTruncated":{"type":["boolean","null"]},"degraded":{"type":["boolean","null"]},"notChecked":{"type":["array","null"],"items":{"type":"string"}},"source":{"type":["null","string"]},"asOf":{"type":["null","string"]},"disclaimer":{"type":["null","string"]}}},"example":{"verdict":"BETTER_THAN_BASELINE","summary":"Average precision 0.833333 against a no-skill baseline of 0.5 (2 positive of 4).","reasons":["Average precision is the sum over thresholds of (recall step) times precision, as in scikit-learn; no interpolation."],"averagePrecision":0.833333,"baseline":0.5,"positives":2,"negatives":2,"curve":[{"threshold":0.8,"precision":1,"recall":0.5},{"threshold":0.4,"precision":0.5,"recall":0.5}],"curveTruncated":false,"degraded":false,"notChecked":["interpolated precision (this is the step-wise definition)","confidence intervals","…1 more"],"source":"computed locally","asOf":"2026-10-21T05:49:44.600Z","disclaimer":"Screening signal computed from the named public source. Not financial, legal or investment advice; provided as is. Verify at the source before acting."}}}},"400":{"description":"A parameter was missing or out of range."},"402":{"description":"Payment Required"},"502":{"description":"The upstream source failed or timed out."}},"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.0200"},"protocols":[{"x402":{"network":"eip155:8453","scheme":"exact","currency":"USDC","endpoint":"https://ml-metrics.x402tookit.com/precision-recall"}},{"x402":{"network":"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp","scheme":"exact","currency":"USDC","endpoint":"https://ml-metrics.x402tookit.com/precision-recall"}},{"x402":{"network":"eip155:137","scheme":"exact","currency":"USDC","endpoint":"https://ml-metrics.x402tookit.com/precision-recall"}},{"x402":{"network":"eip155:42161","scheme":"exact","currency":"USDC","endpoint":"https://ml-metrics.x402tookit.com/precision-recall"}}]}}},"/regression-metrics":{"get":{"operationId":"regression_metrics","summary":"MAE, MSE, RMSE, R2, adjusted R2, MAPE, SMAPE, explained variance, median and max error from actual vs predicted numbers.","description":"MAE, MSE, RMSE, R2, adjusted R2, MAPE, SMAPE, explained variance, median and max error from actual vs predicted numbers.","tags":["machine-learning","regression","rmse","r2"],"parameters":[{"name":"actual","in":"query","required":true,"description":"True values, comma-separated or JSON array, up to 10000","schema":{"type":"string"}},{"name":"predicted","in":"query","required":true,"description":"Predicted values, same length as actual","schema":{"type":"string"}},{"name":"predictors","in":"query","required":false,"description":"Number of model predictors p (1 to 1000) for adjusted R2; needs n > p + 1","schema":{"type":"integer"}}],"responses":{"200":{"description":"The answer.","content":{"application/json":{"schema":{"type":"object","properties":{"verdict":{"type":["null","string"]},"summary":{"type":["null","string"]},"reasons":{"type":["array","null"]},"sampleCount":{"type":["null","number"]},"mae":{"type":["null","number"]},"mse":{"type":["null","number"]},"rmse":{"type":["null","number"]},"r2":{"type":["null","number"]},"adjustedR2":{"type":["null","number"]},"explainedVariance":{"type":["null","number"]},"mapePercent":{"type":["null","number"]},"smapePercent":{"type":["null","number"]},"medianAbsoluteError":{"type":["null","number"]},"maxError":{"type":["null","number"]},"meanError":{"type":["null","number"]},"smapeNote":{"type":["null","string"]},"biasNote":{"type":["null","string"]},"degraded":{"type":["boolean","null"]},"notChecked":{"type":["array","null"],"items":{"type":"string"}},"source":{"type":["null","string"]},"asOf":{"type":["null","string"]},"disclaimer":{"type":["null","string"]}}},"example":{"verdict":"STRONG_FIT","summary":"n=4: RMSE 0.612372, MAE 0.5, R2 0.948608.","reasons":[],"sampleCount":4,"mae":0.5,"mse":0.375,"rmse":0.612372,"r2":0.948608,"adjustedR2":0.922912,"explainedVariance":0.957173,"mapePercent":32.738095,"smapePercent":57.878788,"medianAbsoluteError":0.5,"maxError":1,"meanError":0.25,"smapeNote":"SMAPE = mean of 200*|a-f|/(|a|+|f|) percent (0 to 200 scale); terms with a=f=0 count as 0","biasNote":"meanError is mean(predicted - actual); positive means over-prediction","degraded":false,"notChecked":["residual patterns, heteroscedasticity or outliers beyond max error","out-of-sample validity"],"source":"computed locally","asOf":"2026-10-21T05:49:44.852Z","disclaimer":"Screening signal computed from the named public source. Not financial, legal or investment advice; provided as is. Verify at the source before acting."}}}},"400":{"description":"A parameter was missing or out of range."},"402":{"description":"Payment Required"},"502":{"description":"The upstream source failed or timed out."}},"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.0200"},"protocols":[{"x402":{"network":"eip155:8453","scheme":"exact","currency":"USDC","endpoint":"https://ml-metrics.x402tookit.com/regression-metrics"}},{"x402":{"network":"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp","scheme":"exact","currency":"USDC","endpoint":"https://ml-metrics.x402tookit.com/regression-metrics"}},{"x402":{"network":"eip155:137","scheme":"exact","currency":"USDC","endpoint":"https://ml-metrics.x402tookit.com/regression-metrics"}},{"x402":{"network":"eip155:42161","scheme":"exact","currency":"USDC","endpoint":"https://ml-metrics.x402tookit.com/regression-metrics"}}]}}},"/roc-auc":{"get":{"operationId":"roc_auc","summary":"ROC curve points and AUC from binary labels and scores via the Mann-Whitney rank-sum identity, with ties counted half.","description":"ROC curve points and AUC from binary labels and scores via the Mann-Whitney rank-sum identity, with ties counted half.","tags":["machine-learning","roc","auc","classification"],"parameters":[{"name":"labels","in":"query","required":true,"description":"True binary labels 0/1, comma-separated or JSON array, up to 10000 values","schema":{"type":"string"}},{"name":"scores","in":"query","required":true,"description":"Model scores (higher = more positive), same length as labels","schema":{"type":"string"}}],"responses":{"200":{"description":"The answer.","content":{"application/json":{"schema":{"type":"object","properties":{"verdict":{"type":["null","string"]},"summary":{"type":["null","string"]},"reasons":{"type":["array","null"],"items":{"type":"string"}},"auc":{"type":["null","number"]},"aucTrapezoid":{"type":["null","number"]},"gini":{"type":["null","number"]},"positives":{"type":["null","number"]},"negatives":{"type":["null","number"]},"rocPoints":{"type":["array","null"],"items":{"type":"object","properties":{"threshold":{"type":["null","number"]},"fpr":{"type":["null","number"]},"tpr":{"type":["null","number"]}}}},"rocPointsTruncated":{"type":["boolean","null"]},"degraded":{"type":["boolean","null"]},"notChecked":{"type":["array","null"],"items":{"type":"string"}},"source":{"type":["null","string"]},"asOf":{"type":["null","string"]},"disclaimer":{"type":["null","string"]}}},"example":{"verdict":"FAIR_SEPARATION","summary":"AUC 0.75 from 2 positive and 2 negative sample(s).","reasons":["Bands (0.9, 0.8, 0.7) are a common rule of thumb, not a standard."],"auc":0.75,"aucTrapezoid":0.75,"gini":0.5,"positives":2,"negatives":2,"rocPoints":[{"threshold":null,"fpr":0,"tpr":0},{"threshold":0.8,"fpr":0,"tpr":0.5}],"rocPointsTruncated":false,"degraded":false,"notChecked":["confidence interval for the AUC","calibration of the scores","…1 more"],"source":"computed locally","asOf":"2026-10-21T05:49:45.117Z","disclaimer":"Screening signal computed from the named public source. Not financial, legal or investment advice; provided as is. Verify at the source before acting."}}}},"400":{"description":"A parameter was missing or out of range."},"402":{"description":"Payment Required"},"502":{"description":"The upstream source failed or timed out."}},"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.0200"},"protocols":[{"x402":{"network":"eip155:8453","scheme":"exact","currency":"USDC","endpoint":"https://ml-metrics.x402tookit.com/roc-auc"}},{"x402":{"network":"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp","scheme":"exact","currency":"USDC","endpoint":"https://ml-metrics.x402tookit.com/roc-auc"}},{"x402":{"network":"eip155:137","scheme":"exact","currency":"USDC","endpoint":"https://ml-metrics.x402tookit.com/roc-auc"}},{"x402":{"network":"eip155:42161","scheme":"exact","currency":"USDC","endpoint":"https://ml-metrics.x402tookit.com/roc-auc"}}]}}},"/threshold-sweep":{"get":{"operationId":"threshold_sweep","summary":"Sweep every score threshold for binary labels and return the best F1, Youden J and accuracy thresholds with their metrics.","description":"Sweep every score threshold for binary labels and return the best F1, Youden J and accuracy thresholds with their metrics.","tags":["machine-learning","threshold","f1","youden","classification"],"parameters":[{"name":"labels","in":"query","required":true,"description":"True binary labels 0/1, comma-separated or JSON array, up to 10000 values","schema":{"type":"string"}},{"name":"scores","in":"query","required":true,"description":"Model scores (higher = more positive); a sample is predicted positive when score >= threshold","schema":{"type":"string"}}],"responses":{"200":{"description":"The answer.","content":{"application/json":{"schema":{"type":"object","properties":{"verdict":{"type":["null","string"]},"summary":{"type":["null","string"]},"reasons":{"type":["array","null"],"items":{"type":"string"}},"positives":{"type":["null","number"]},"negatives":{"type":["null","number"]},"bestF1":{"type":["null","object"],"properties":{"threshold":{"type":["null","number"]},"tp":{"type":["null","number"]},"fp":{"type":["null","number"]},"tn":{"type":["null","number"]},"fn":{"type":["null","number"]},"precision":{"type":["null","number"]},"recall":{"type":["null","number"]},"specificity":{"type":["null","number"]},"f1":{"type":["null","number"]},"youdenJ":{"type":["null","number"]},"accuracy":{"type":["null","number"]}}},"bestYouden":{"type":["null","object"],"properties":{"threshold":{"type":["null","number"]},"tp":{"type":["null","number"]},"fp":{"type":["null","number"]},"tn":{"type":["null","number"]},"fn":{"type":["null","number"]},"precision":{"type":["null","number"]},"recall":{"type":["null","number"]},"specificity":{"type":["null","number"]},"f1":{"type":["null","number"]},"youdenJ":{"type":["null","number"]},"accuracy":{"type":["null","number"]}}},"bestAccuracy":{"type":["null","object"],"properties":{"threshold":{"type":["null","number"]},"tp":{"type":["null","number"]},"fp":{"type":["null","number"]},"tn":{"type":["null","number"]},"fn":{"type":["null","number"]},"precision":{"type":["null","number"]},"recall":{"type":["null","number"]},"specificity":{"type":["null","number"]},"f1":{"type":["null","number"]},"youdenJ":{"type":["null","number"]},"accuracy":{"type":["null","number"]}}},"youdenTiedThresholds":{"type":["array","null"],"items":{"type":"number"}},"sweep":{"type":["array","null"],"items":{"type":"object","properties":{"threshold":{"type":["null","number"]},"tp":{"type":["null","number"]},"fp":{"type":["null","number"]},"tn":{"type":["null","number"]},"fn":{"type":["null","number"]},"precision":{"type":["null","number"]},"recall":{"type":["null","number"]},"specificity":{"type":["null","number"]},"f1":{"type":["null","number"]},"youdenJ":{"type":["null","number"]},"accuracy":{"type":["null","number"]}}}},"sweepTruncated":{"type":["boolean","null"]},"degraded":{"type":["boolean","null"]},"notChecked":{"type":["array","null"],"items":{"type":"string"}},"source":{"type":["null","string"]},"asOf":{"type":["null","string"]},"disclaimer":{"type":["null","string"]}}},"example":{"verdict":"USABLE_THRESHOLD","summary":"Best F1 0.8 at threshold 0.35; best Youden J 0.5 at 0.8; best accuracy 0.75 at 0.8.","reasons":["Ties between thresholds resolve to the higher threshold.","Youden J ties at thresholds 0.8, 0.35."],"positives":2,"negatives":2,"bestF1":{"threshold":0.35,"tp":2,"fp":1,"tn":1,"fn":0,"precision":0.666667,"recall":1,"specificity":0.5,"f1":0.8,"youdenJ":0.5,"accuracy":0.75},"bestYouden":{"threshold":0.8,"tp":1,"fp":0,"tn":2,"fn":1,"precision":1,"recall":0.5,"specificity":1,"f1":0.666667,"youdenJ":0.5,"accuracy":0.75},"bestAccuracy":{"threshold":0.8,"tp":1,"fp":0,"tn":2,"fn":1,"precision":1,"recall":0.5,"specificity":1,"f1":0.666667,"youdenJ":0.5,"accuracy":0.75},"youdenTiedThresholds":[0.8,0.35],"sweep":[{"threshold":0.8,"tp":1,"fp":0,"tn":2,"fn":1,"precision":1,"recall":0.5,"specificity":1,"f1":0.666667,"youdenJ":0.5,"accuracy":0.75},{"threshold":0.4,"tp":1,"fp":1,"tn":1,"fn":1,"precision":0.5,"recall":0.5,"specificity":0.5,"f1":0.5,"youdenJ":0,"accuracy":0.5}],"sweepTruncated":false,"degraded":false,"notChecked":["costs of false positives versus false negatives (pick the threshold that fits them)","overfitting of a threshold chosen on the same data","…1 more"],"source":"computed locally","asOf":"2026-10-21T05:49:45.382Z","disclaimer":"Screening signal computed from the named public source. Not financial, legal or investment advice; provided as is. Verify at the source before acting."}}}},"400":{"description":"A parameter was missing or out of range."},"402":{"description":"Payment Required"},"502":{"description":"The upstream source failed or timed out."}},"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.0200"},"protocols":[{"x402":{"network":"eip155:8453","scheme":"exact","currency":"USDC","endpoint":"https://ml-metrics.x402tookit.com/threshold-sweep"}},{"x402":{"network":"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp","scheme":"exact","currency":"USDC","endpoint":"https://ml-metrics.x402tookit.com/threshold-sweep"}},{"x402":{"network":"eip155:137","scheme":"exact","currency":"USDC","endpoint":"https://ml-metrics.x402tookit.com/threshold-sweep"}},{"x402":{"network":"eip155:42161","scheme":"exact","currency":"USDC","endpoint":"https://ml-metrics.x402tookit.com/threshold-sweep"}}]}}}}}