# Machine Learning Metrics Classification, ranking, regression, calibration and text-generation metrics computed exactly from arrays you send. ## How to pay Machine-payable over x402. USDC on: Base (eip155:8453), Solana (solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp), Polygon (eip155:137), Arbitrum One (eip155:42161). No accounts. No API keys. No signup. The paying wallet is the account. ## Machine-readable - OpenAPI: https://ml-metrics.x402tookit.com/openapi.json - x402 manifest: https://ml-metrics.x402tookit.com/.well-known/x402 - Catalog (free): https://ml-metrics.x402tookit.com/catalog - Health (free): https://ml-metrics.x402tookit.com/health - Uptime (free): https://ml-metrics.x402tookit.com/uptime ## Endpoints (8) ### GET /bleu-rouge — $0.02 Sentence BLEU (1-4 gram, brevity penalty, optional smoothing) and ROUGE-1, ROUGE-2, ROUGE-L F1 for text against references. Params: candidate: string, references: string, tokenizer?: string, smoothing?: string, maxn?: integer Example: https://ml-metrics.x402tookit.com/bleu-rouge?candidate=the+cat+sat+on+the+mat&references=the+cat+is+on+the+mat&smoothing=add1 ### GET /calibration — $0.02 Reliability bins, expected and maximum calibration error and Brier score from binary labels and predicted probabilities. Params: labels: string, probs: string, bins?: integer, strategy?: string Example: https://ml-metrics.x402tookit.com/calibration?labels=0%2C1%2C1%2C1&probs=0.1%2C0.1%2C0.9%2C0.9 ### GET /confusion-matrix — $0.02 Confusion matrix from true and predicted labels: accuracy, precision, recall, specificity, F1, MCC, kappa, averages. Params: actual: string, predicted: string, positive?: string Example: https://ml-metrics.x402tookit.com/confusion-matrix?actual=1%2C1%2C1%2C1%2C0%2C0%2C0%2C0%2C0%2C0&predicted=1%2C1%2C1%2C0%2C1%2C0%2C0%2C0%2C0%2C0 ### GET /log-loss — $0.02 Binary or multiclass log loss (cross entropy) with epsilon clipping, plus the no-skill baseline and worst samples. Params: labels: string, probs: string, classes?: string, eps?: string Example: https://ml-metrics.x402tookit.com/log-loss?labels=1%2C0&probs=0.9%2C0.2 ### GET /precision-recall — $0.02 Precision-recall curve points and average precision (step-wise sum) from binary labels and scores, with the baseline. Params: labels: string, scores: string Example: https://ml-metrics.x402tookit.com/precision-recall?labels=0%2C0%2C1%2C1&scores=0.1%2C0.4%2C0.35%2C0.8 ### GET /regression-metrics — $0.02 MAE, MSE, RMSE, R2, adjusted R2, MAPE, SMAPE, explained variance, median and max error from actual vs predicted numbers. Params: actual: string, predicted: string, predictors?: integer Example: https://ml-metrics.x402tookit.com/regression-metrics?actual=3%2C-0.5%2C2%2C7&predicted=2.5%2C0%2C2%2C8&predictors=1 ### GET /roc-auc — $0.02 ROC curve points and AUC from binary labels and scores via the Mann-Whitney rank-sum identity, with ties counted half. Params: labels: string, scores: string Example: https://ml-metrics.x402tookit.com/roc-auc?labels=0%2C0%2C1%2C1&scores=0.1%2C0.4%2C0.35%2C0.8 ### GET /threshold-sweep — $0.02 Sweep every score threshold for binary labels and return the best F1, Youden J and accuracy thresholds with their metrics. Params: labels: string, scores: string Example: https://ml-metrics.x402tookit.com/threshold-sweep?labels=0%2C0%2C1%2C1&scores=0.1%2C0.4%2C0.35%2C0.8 ## Terms Metrics are computed locally from the arrays you send, with the standard textbook definitions, provided as is. Edge cases (undefined ratios, ties) follow the documented conventions. Results describe your sample only and are not a guarantee of model performance. Do not send secrets in a query string.