{"uid":"cap_57ludvbpIvPWjuG-TIrLT","slug":"ml-regression-metrics-calculator-8bea5f62","name":"ML Regression Metrics Calculator","description":"MAE, MSE, RMSE, R2, adjusted R2, MAPE, SMAPE, explained variance, median and max error from actual vs predicted numbers.","url":"https://ml-metrics.x402tookit.com/regression-metrics?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method"],"properties":{"type":{"type":"string","const":"http"},"method":{"enum":["GET"],"type":"string"},"queryParams":{"type":"object","required":["actual","predicted"],"properties":{"actual":{"type":"string","description":"True values, comma-separated or JSON array, up to 10000"},"predicted":{"type":"string","description":"Predicted values, same length as actual"},"predictors":{"type":"integer","description":"Number of model predictors p (1 to 1000) for adjusted R2; needs n > p + 1"}}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object","properties":{"r2":{"type":["null","number"]},"mae":{"type":["null","number"]},"mse":{"type":["null","number"]},"asOf":{"type":["null","string"]},"rmse":{"type":["null","number"]},"source":{"type":["null","string"]},"reasons":{"type":["array","null"]},"summary":{"type":["null","string"]},"verdict":{"type":["null","string"]},"biasNote":{"type":["null","string"]},"degraded":{"type":["boolean","null"]},"maxError":{"type":["null","number"]},"meanError":{"type":["null","number"]},"smapeNote":{"type":["null","string"]},"adjustedR2":{"type":["null","number"]},"disclaimer":{"type":["null","string"]},"notChecked":{"type":["array","null"],"items":{"type":"string"}},"mapePercent":{"type":["null","number"]},"sampleCount":{"type":["null","number"]},"smapePercent":{"type":["null","number"]},"explainedVariance":{"type":["null","number"]},"medianAbsoluteError":{"type":["null","number"]}}}}}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.02","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.02/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.02","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.02","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_-PGTd5KhVcUvb3chhDcV2","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.02","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Computes a comprehensive suite of regression evaluation metrics (MAE, MSE, RMSE, R², adjusted R², MAPE, SMAPE, explained variance, median absolute error, max error) from arrays of actual and predicted values.","exampleAgentPrompt":"Can you compute regression metrics — MAE, RMSE, R², and adjusted R² — for these actual values [1.2, 3.4, 2.8, 5.1] and predicted values [1.0, 3.6, 2.5, 5.3] using 2 predictors?","exampleUseCases":[{"title":"Evaluating a price prediction model","prompt":"I trained a house price model and got these actual prices [250000,310000,480000,290000] and predictions [240000,325000,460000,300000]. Can you calculate the full suite of regression metrics including RMSE, R², and MAPE so I can see how accurate it is?"},{"title":"Validating a demand forecasting model","prompt":"Here are my actual demand values [120,95,140,110,130] and my model's predicted values [115,100,135,108,128] — can you compute MAE, SMAPE, and explained variance to evaluate the forecast quality?"},{"title":"Comparing adjusted R² across model complexity","prompt":"I have actual outputs [3.1,5.7,2.4,8.9,4.6] and predicted outputs [3.0,5.9,2.6,8.7,4.8] from a model with 3 predictors — can you calculate adjusted R² alongside the other regression error metrics?"}],"resultDescription":"A JSON object containing regression error metrics: MAE, MSE, RMSE, R², adjusted R² (if predictors provided), MAPE percent, SMAPE percent, explained variance, median absolute error, max error, mean error, and sample count. May also include notes on bias, SMAPE edge cases, degraded computation warnings, and a summary verdict.","failureModes":["Mismatched array lengths between actual and predicted return an error","Too few samples relative to predictors makes adjusted R² undefined (needs n > p + 1)","Non-numeric or malformed comma-separated values cause parse errors","MAPE undefined when actual values contain zeros","Very large arrays (>10000 values) rejected"],"whenToPreferThis":"Use this endpoint when you need a comprehensive set of standard regression evaluation metrics in a single call, especially when you need adjusted R² alongside MAPE/SMAPE. Prefer over custom implementations when you need bias notes, SMAPE edge case handling, and a summary verdict without writing evaluation code yourself.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-11-02T12:31:01.496Z","isFirstParty":false,"canonicalSlug":"ml-regression-metrics-calculator-8bea5f62"}