nispace.stats.coloc.lasso
- nispace.stats.coloc.lasso(x, y, cv=None, seed=None, kwargs={})[source]
Lasso-regularized regression of x on y via sklearn.linear_model.LassoCV.
- Parameters:
x (np.ndarray, shape (n_obs, n_predictors)) – Does not handle NaN – sklearn errors on NaN input; pre-mask.
y (np.ndarray, shape (n_obs,)) –
cv (int, cross-validation generator, or None) – Passed to LassoCV for selecting alpha.
seed (int, optional) – Passed as LassoCV’s random_state.
kwargs (dict, default {}) – Forwarded to LassoCV.
- Returns:
out –
"alpha"(selected regularization strength),"r2","beta"(shape(n_predictors,)).- Return type:
dict
Notes
Used by core/colocalize.py’s regularized-regression colocalization case, with NaN excluded list-wise (see elasticnet’s Notes) before calling this function.