nispace.stats.coloc.ridge
- nispace.stats.coloc.ridge(x, y, cv=None, seed=None, kwargs={})[source]
Ridge-regularized regression of x on y via sklearn.linear_model.RidgeCV.
- 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 RidgeCV for selecting alpha.
seed (int, optional) – Unused by RidgeCV (which has no random_state); accepted for a uniform signature with lasso/elasticnet.
kwargs (dict, default {}) – Forwarded to RidgeCV.
- 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.