{"uid":"cap_CfNWnncBcpgu0Wp7nmwrJ","slug":"signaldesk-ai-linear-regression-7ab307d0","name":"SignalDesk AI Linear Regression","description":"Evidence-backed autonomous AI jobs and paid data tools. Queue/D1/cron run outside the chat; free quotas and bounded execution apply.","url":"https://x402-agent.kariguetoazul.workers.dev/api/stats/linear-regression?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"x":{"type":"array","items":{"type":"number","maximum":1000000000000000,"minimum":-1000000000000000},"maxItems":1000,"minItems":2,"description":"At least two observations."},"y":{"type":"array","items":{"type":"number","maximum":1000000000000000,"minimum":-1000000000000000},"maxItems":1000,"minItems":2,"description":"At least two observations."}}},"responseSchema":{"type":"json","example":{"slope":2,"intercept":0,"r_squared":1,"observations":3}},"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_EiL22iLq4r8GSVpcXVofY","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":"Computes simple linear regression (slope, intercept, R²) over two paired numeric arrays","exampleAgentPrompt":"Can you run a linear regression on my data? X values are [1, 2, 3, 4, 5] and Y values are [2.1, 3.9, 6.2, 7.8, 10.1] — I need the slope, intercept, and R-squared.","exampleUseCases":[{"title":"Sales trend over time","prompt":"I have monthly sales figures for the last 12 months and want to find the trend line — X is month numbers 1 through 12 and Y is [4200, 4350, 4100, 4600, 5000, 5200, 5400, 5300, 5700, 6000, 6100, 6400]. What's the slope and how good is the fit?"},{"title":"Price vs demand analysis","prompt":"Can you fit a regression line to my price and demand data? X prices are [10, 15, 20, 25, 30] and Y demand units are [500, 420, 370, 310, 250]. I want slope, intercept, and R-squared to understand how price drives demand."},{"title":"Height vs weight correlation","prompt":"I've got a dataset of heights in inches [60, 63, 65, 68, 70, 72, 74] and weights in pounds [120, 135, 145, 160, 172, 185, 200] — run a linear regression so I can see the best-fit line and how strong the relationship is."}],"resultDescription":"Returns a JSON object with four fields: slope (rate of change of Y per unit X), intercept (Y value when X is zero), r_squared (coefficient of determination, 0–1 indicating goodness of fit), and observations (count of data points used in the regression).","failureModes":["Arrays x and y have different lengths — request fails with validation error","Fewer than 2 data points provided — minItems constraint violated","Values exceed ±10^15 boundary — rejected by schema validation","Payment of $0.001 USDC not completed via x402 — 402 Payment Required response","Perfectly vertical data (all x values identical) — division by zero may cause error or undefined slope"],"whenToPreferThis":"Choose this endpoint when you need a quick, cheap ($0.001 USDC) server-side linear regression computation without setting up a local statistics library. It handles up to 1000 paired observations and returns all key regression statistics in one call. Prefer this over client-side computation when the agent environment lacks numpy/scipy, or when you need a lightweight, pay-per-use statistical computation in an autonomous workflow.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-13T00:42:16.900Z","isFirstParty":false,"canonicalSlug":"signaldesk-ai-linear-regression-7ab307d0"}