{"uid":"cap_Dfy4n23IApnlXsvg4I9nH","slug":"forgemesh-linear-regression-api-cb7ffe25","name":"ForgeMesh Linear Regression API","description":"Linear regression API: fit a least-squares line through paired x/y data and get slope, intercept, R-squared goodness-of-fit, and the line equation. For trend analysis, forecasting inputs, and data-science agents. Exact and deterministic.","url":"https://x402.forgemesh.io/linear-regression","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"x":{"type":"array","items":{"type":"number"}},"y":{"type":"array","items":{"type":"number"}}}},"responseSchema":{"type":"json","example":{"slope":1.9,"equation":"y = 1.9x + -0.5","intercept":-0.5,"r_squared":0.966}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.002","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.002/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_NtOv81xwM76C27nZLQNBD","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.002","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Fits a least-squares linear regression line through paired x/y data, returning slope, intercept, R-squared, and the line equation.","exampleAgentPrompt":"Fit a linear regression line through these data points — x: [1, 2, 3, 4, 5] and y: [2.1, 3.9, 6.2, 7.8, 10.1] — and give me the slope, intercept, R-squared, and the equation of the line.","exampleUseCases":null,"resultDescription":"Returns the slope, intercept, R-squared goodness-of-fit statistic, and the full line equation for the best-fit least-squares line through the provided x/y data pairs. Results are exact and deterministic.","failureModes":["Mismatched array lengths for x and y returns a validation error","Empty or single-element arrays may return undefined slope/intercept","Non-numeric values in input arrays cause schema validation failure","Arrays with zero variance in x (all same x value) produce undefined slope (vertical line singularity)"],"whenToPreferThis":"Use this endpoint when you need a fast, deterministic, exact least-squares linear regression with slope, intercept, and R-squared — especially in data science pipelines, trend analysis workflows, or forecasting preprocessing steps where you need a reliable numeric result without spinning up a full ML environment.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-13T13:02:41.226Z","isFirstParty":false}