osl_dynamics.analysis.regression
#
Functions to perform regression analysis.
Module Contents#
Functions#
|
Wrapper for sklearn.linear_model.LinearRegression. |
Attributes#
- osl_dynamics.analysis.regression.linear(X, y, fit_intercept, normalize=False, log_message=False)[source]#
Wrapper for sklearn.linear_model.LinearRegression.
- Parameters:
X (np.ndarray) – Regressors, should be a 2D array (n_targets, n_regressors).
y (np.ndarray) – Targets. Should be a 2D array: (n_targets, n_features). If a higher dimension array is passed, the extra dimensions are concatenated.
fit_intercept (bool) – Should we fit an intercept?
normalize (bool, optional) – Should we z-transform the regressors?
log_message (bool, optional) – Should we log a message?
- Returns:
coefs (np.ndarray) – Regression coefficients. 2D array or higher dimensionality: (n_regressors, n_features).
intercept (np.ndarray) – Regression intercept. 1D array or higher dimensionality: (n_features,). Returned if
fit_intercept=True
.