linear_regression
Computes the slope and intercept of a linear regression line from a set of (x, y) points.
Instructions
Performs linear regression on a set of points and returns the slope and intercept.
Args: data: A list of tuples, where each tuple contains (x, y) coordinates.
Returns: On success: {"slope": , "intercept": } On error: {"error": }
Examples: >>> linear_regression([(1, 2), (2, 3), (3, 5)]) {'slope': 1.5, 'intercept': 0.3333333333333335}
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"data": "<data>"
},
"name": "linear_regression"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | Yes |