LQM Registry / statistical
Linear Regression
Ordinary least squares regression for one explanatory series with explicit fit diagnostics.
Model key
lq.statistics.linear-regressionVersion1.0.0
Runtimephp-native
Model contract
Inputs are explicit.
{
"type": "object",
"required": [
"x",
"y"
],
"properties": {
"x": {
"type": "array",
"items": {
"type": "number"
},
"minItems": 2
},
"y": {
"type": "array",
"items": {
"type": "number"
},
"minItems": 2
}
}
}Output contract
Outputs are explicit.
{
"type": "object",
"properties": {
"count": {
"type": "integer"
},
"slope": {
"type": "number"
},
"intercept": {
"type": "number"
},
"r_squared": {
"type": "number"
},
"rmse": {
"type": "number"
}
}
}Default parameters
{
"fit_intercept": true
}Example input
{
"x": [
1,
2,
3,
4,
5
],
"y": [
2.100000000000000088817841970012523233890533447265625,
3.899999999999999911182158029987476766109466552734375,
6.20000000000000017763568394002504646778106689453125,
8.0999999999999996447286321199499070644378662109375,
10.199999999999999289457264239899814128875732421875
]
}