81trust / 100

Forecast Eval

by Forecast backtest (MAPE + RMSE) in Weather & location

x402 APIPassing, checked 3 h ago

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.

POST https://agent402.tools/api/forecast-eval

Last 30 days

All checks passedSome failedAll failedNot checked
Uptime
100%
Response time
191 ms typical, 191 ms slowest 5%
Last check
3 h ago
Next check
any minute now

How to call it

# See the payment challenge (nothing is charged)
curl -i -X POST "https://agent402.tools/api/forecast-eval" \
  -H "content-type: application/json" \
  -d '{"method":"drift","testSize":3,"values":[10,12,13,12,15,16,18,19,21,22]}'
import { wrapFetchWithPayment } from "@x402/fetch";
import { x402Client } from "@x402/core/client";
import { ExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";

const client = new x402Client().register(
  "eip155:8453",
  new ExactEvmScheme(privateKeyToAccount(process.env.AGENT_KEY)),
);
const pay = wrapFetchWithPayment(fetch, client);

// Not sure it's safe to pay? Preflight it first for $0.005:
// GET https://toolvet.app/api/v1/check?url=https%3A%2F%2Fagent402.tools%2Fapi%2Fforecast-eval
const res = await pay("https://agent402.tools/api/forecast-eval", {
  method: "POST",
  headers: { "content-type": "application/json" },
  body: JSON.stringify({"method":"drift","testSize":3,"values":[10,12,13,12,15,16,18,19,21,22]}),
});
console.log(await res.json());

Example input

{
  "method": "drift",
  "testSize": 3,
  "values": [
    10,
    12,
    13,
    12,
    15,
    16,
    18,
    19,
    21,
    22
  ]
}

Example output

{
  "forecast": [
    {
      "actual": 19,
      "predicted": 19.3333,
      "step": 1
    },
    {
      "actual": 21,
      "predicted": 20.6667,
      "step": 2
    },
    {
      "actual": 22,
      "predicted": 22,
      "step": 3
    }
  ],
  "mape": 1.1139,
  "method": "drift",
  "n": 10,
  "rmse": 0.2722,
  "testSize": 3,
  "trainSize": 7,
  "warnings": []
}

Security scan

  • No findings. We scan names, descriptions and tool definitions for hidden instructions and other prompt-injection patterns.

Recent checks

WhenResultHTTPTimePrice
3 h agoPassed402191 ms$0.001
8 h agoPassed402233 ms$0.001