osl_dynamics.analysis.regression#

Functions to perform regression analysis.

Module Contents#

Functions#

linear(X, y, fit_intercept[, normalize, log_message])

Wrapper for sklearn.linear_model.LinearRegression.

Attributes#

_logger

osl_dynamics.analysis.regression._logger[source]#
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.