Skip to main content
POST
/
quantlib
/
ml
/
regression
/
fit
Linear Regression (OLS, Lasso, ElasticNet)
curl --request POST \
  --url https://finceptbackend.share.zrok.io/quantlib/ml/regression/fit \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "X": [
    [
      1.2,
      0.5
    ],
    [
      2.1,
      1.3
    ],
    [
      0.8,
      0.9
    ]
  ],
  "y": [
    150000,
    235000,
    185000
  ],
  "method": "lasso",
  "alpha": 0.1,
  "l1_ratio": 0.5,
  "predict_X": [
    [
      1.5,
      0.7
    ]
  ]
}
'
{
  "success": true,
  "data": {
    "coefficients": [
      85000,
      120000
    ],
    "intercept": 50000,
    "r_squared": 0.847,
    "predictions": [
      197500
    ]
  }
}

Authorizations

X-API-Key
string
header
required

API key for authentication. Get your key at https://finceptbackend.share.zrok.io/auth/register

Body

application/json
X
number[][]
required

Feature matrix

Example:
[[1.2, 0.5], [2.1, 1.3], [0.8, 0.9]]
y
number[]
required

Continuous target values (e.g., LGD, house prices)

Example:
[150000, 235000, 185000]
method
enum<string>
default:ols

Regression method

Available options:
ols,
lasso,
elastic_net
Example:

"lasso"

alpha
number
default:0.01

Regularization strength (for Lasso/ElasticNet)

Example:

0.1

l1_ratio
number
default:0.5

L1/L2 mix for ElasticNet (0=Ridge, 1=Lasso)

Example:

0.5

predict_X
number[][]

Optional feature matrix for prediction

Example:
[[1.5, 0.7]]

Response

Regression results

success
boolean
Example:

true

data
object