Skip to main content

linalg.ensemble_lstsq

linalg.ensemble_lstsq(X, Y, n_folds=5, n_reps=20, seed=0, n_jobs=1)

Linear regression with k-fold bagging.

Parameters

Name Type Description Default
X ndarray of shape (n_samples, n_features) The design matrix. required
Y ndarray of shape (n_samples, n_targets) The target matrix. required
n_folds int Number of folds. 5
n_reps int Number of repetitions. 20
seed int Random seed for the random number generator. 0

Returns

Name Type Description
beta ndarray of shape (n_features, n_targets) The regression coefficients.
Yhat ndarray of shape (n_samples, n_targets) The predicted values (out-of-bag cross-validation).
R2 ndarray of shape (n_targets,) The R-squared values (cross-validated).
r ndarray of shape (n_targets,) The correlation coefficients between the predicted and actual values.