Fit a least-squares line y = slope·x + intercept to two equal-length series
Fit a least-squares line y = slope·x + intercept to two equal-length series. Returns slope, intercept, r² (variance explained), and optionally predicted y values for new x inputs - useful for trend extrapolation (e.g. project next quarter's revenue from the last 8 quarters).
Answeringour last check, 2026-09-24
1 of 1checks answered this week
927 msmedian answer time
$0.001listed price per call
$0.001price it asked us
Paid test badge: not yet. The checks above are free: we call the tool without paying and read the payment request it sends back. The Verified badge needs paid calls whose answers match the promised output, and nobody can buy a badge.
Endpoint
POST https://agent402.tools/api/linear-regression
| Category | Everything else |
|---|---|
| Provider host | agent402.tools |
| Networks | algorand:wGHE2Pwdvd7S12BL5FaOP20EGYesN73ktiC1qzkkit8=, eip155:10, eip155:1329, eip155:137, eip155:143, eip155:42161, eip155:42220, eip155:43114, eip155:4663, eip155:8453, solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp, stellar:pubnet |
| Payment schemes | exact, upto |
| Self-reported calls, 30 days | 5 from 1 payers (the provider's figure, not ours) |
Our checks, last 30 days
| Day | Result | HTTP | Asked | Time |
|---|---|---|---|---|
| 2026-09-24 | valid payment request | 402 | $0.001 | 927 ms |
Example input (from the provider)
{
"body": {
"predict": [
6,
7
],
"x": [
1,
2,
3,
4,
5
],
"y": [
2.1,
4,
6.1,
7.9,
10.2
]
},
"bodyType": "json",
"method": "POST",
"type": "http"
}
Promised output schema (from the provider)
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
"input": {
"additionalProperties": false,
"properties": {
"body": {
"properties": {
"predict": {
"description": "Optional x values to predict y for, using the fitted line",
"type": "array"
},
"x": {
"description": "Independent variable series (e.g. time)",
"type": "array"
},
"y": {
"description": "Dependent variable series (same length as x)",
"type": "array"
}
},
"required": [
"x",
"y"
]
},
"bodyType": {
"enum": [
"json",
"form-data",
"text"
],
"type": "string"
},
"method": {
"enum": [
"POST"
],
"type": "string"
},
"type": {
"const": "http",
"type": "string"
}
},
"required": [
"type",
"method",
"bodyType",
"body"
],
"type": "object"
},
"output": {
"properties": {
"example": {
"properties": {
"equation": {
"type": "string"
},
"intercept": {
"type": "number"
},
"n": {
"type": "integer"
},
"predictions": {
"items": {
"properties": {
"x": {
"type": "integer"
},
"y": {
"type": "number"
}
},
"type": "object"
},
"type": "array"
},
"rSquared": {
"type": "number"
},
"slope": {
"type": "number"
}
},
"required": [
"n",
"slope",
"intercept",
"rSquared",
"equation",
"predictions"
],
"type": "object"
},
"type": {
"type": "string"
}
},
"required": [
"type"
],
"type": "object"
}
},
"required": [
"input"
],
"type": "object"
}