{"uid":"cap_B5n3hkc-pFNqExD1C1Sxu","slug":"agent402-tools-forecast-evaluation-backtest-262eadc7","name":"agent402.tools Forecast Evaluation (Backtest)","description":"Backtest a forecasting method on the input series by holding out the last `testSize` observations, forecasting them, and computing MAPE (mean absolute percentage error) + RMSE (root mean squared error). Lets an agent pick which method (mean / naive / drift / ses / holt / holt-winters) actually fits its data before committing to a forward forecast.","url":"https://agent402.tools/api/forecast-eval","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"beta":{"type":"number","description":"Trend smoothing for holt/holt-winters"},"alpha":{"type":"number","description":"Smoothing for ses/holt/holt-winters"},"gamma":{"type":"number","description":"Seasonal smoothing for holt-winters"},"method":{"type":"string","description":"\"mean\", \"naive\", \"drift\", \"ses\", \"holt\", \"holt-winters\""},"period":{"type":"number","description":"Seasonal period for holt-winters (auto-detected if omitted)"},"values":{"type":"array","description":"Numeric series (max 10000)"},"testSize":{"type":"number","description":"Trailing observations to hold out (1 to values.length - 2). Values above n/2 trigger a warning, not an error."},"seasonality":{"type":"string","description":"\"additive\" or \"multiplicative\" for holt-winters"}}},"responseSchema":{"type":"json","example":{"n":10,"mape":1.1139,"rmse":0.2722,"method":"drift","forecast":[{"step":1,"actual":19,"predicted":19.3333},{"step":2,"actual":21,"predicted":20.6667},{"step":3,"actual":22,"predicted":22}],"testSize":3,"warnings":[],"trainSize":7}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.001","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.001/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_7105yOnGtoDMgJXrsnc8T","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.001","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Backtests a time-series forecasting method by holding out the last N observations, generating forecasts, and returning MAPE and RMSE accuracy metrics.","exampleAgentPrompt":"Backtest the Holt-Winters method on my sales data — here are the 120 monthly values: [23, 45, 67, ...] — hold out the last 12 observations as the test set, use an additive seasonality with period 12, and tell me the MAPE and RMSE.","exampleUseCases":null,"resultDescription":"Returns MAPE (mean absolute percentage error) and RMSE (root mean squared error) computed over the held-out test observations, along with possibly a warning if testSize exceeds half the series length.","failureModes":["testSize less than 1 or greater than values.length - 2 returns a validation error","series too short for the chosen method or seasonal period","invalid method string returns an error","holt-winters without sufficient seasonal cycles may fail or warn","values array exceeding 10000 elements rejected"],"whenToPreferThis":"Use this endpoint when you need to objectively measure how well a specific statistical forecasting method (mean, naive, drift, SES, Holt, Holt-Winters) fits a given numeric time series, using held-out test data, without building a full ML pipeline. Ideal for lightweight model selection or benchmarking before committing to a forecasting strategy.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T19:14:06.934Z","isFirstParty":false}