Lasso Regression
lasso_regressionTrain an L1-regularized linear regression on a numeric split to shrink weak coefficients to zero and perform feature selection while returning metrics, top features, and warnings.
Instructions
Train a Lasso (L1-regularised) linear regression. It can shrink weak coefficients to exactly zero, so it also acts as feature selection. The split must have only numerical, complete features. Args: split_id (str): ID of a split made by train_test_split. alpha (float): Regularisation strength, greater than 0. Default is 1.0. If the target has a large scale (e.g. prices in the millions) a value of 1 may be too small to have any effect. fit_intercept (bool): Learn an intercept. Default is True. max_iter (int): Maximum solver iterations. Default is 10000. scale (bool): Standardise the features first. Strongly recommended. Default is True. Returns: dict: model_id, train/test metrics (R2, MAE, MSE, RMSE, MAPE), top features and warnings.
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": {
"split_id": "<split_id>"
},
"name": "lasso_regression"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| alpha | No | ||
| scale | No | ||
| max_iter | No | ||
| split_id | Yes | ||
| fit_intercept | No |