Home / Servers / Calculators / linear_regression
Linear regression
An MCP tool from the Calculators server, hosted on mcp.hjlabs.in.
Fit a straight line y = m·x + b to paired data: slope, intercept, r, r² and predictions for x values you give. Use for trends and simple forecasts.
Name on the gateway: math__linear_regression · read-only.
Parameters
| Name | Type | Description |
|---|---|---|
x required | array | The x values. |
y required | array | The y values, same length as x. |
predict | array | x values to predict y for. Optional. |
How to call it
Through the Smart Gateway, any client can run it by name with call_tool, or let the gateway find it with search_tools:
{
"name": "math__linear_regression",
"arguments": {
"x": [],
"y": []
}
}Or connect the Calculators server directly, which lists 28 tools including this one:
claude mcp add --transport http hj-math https://mcp.hjlabs.in/mcp/math \
--header "Authorization: Bearer YOUR_API_KEY"Try asking
Use the linear regression tool with x set to ….