pyeeg.solvers.LSTSQSolver.solve

LSTSQSolver.solve(X, y, alpha=0.0, M=None)

Solve the least-squares regression and return the coefficients.

X may be a 2-D array or a list of 2-D arrays (segments / trials). When a list is given, the covariance matrices are accumulated across trials; the number of samples must then be the same in X and y per trial. alpha and M are accepted for API compatibility but do not modify the solution.

Parameters:
  • X (ndarray (n_samples, n_features) or list of such) – Design matrix, or list of segments to accumulate.

  • y (ndarray (n_samples, n_channels) or list of such) – Target. If y is a list of arrays, each element is treated as an individual subject / segment and the betas coefficients are computed on the accumulated covariance matrices.

  • alpha (float or array-like, optional) – Accepted for API compatibility; not used by this solver. Default is 0.0.

  • M (ndarray, optional) – Accepted for API compatibility; not used by this solver. Default is None.

Returns:

resultbetas has shape (n_features, n_channels); info is None.

Return type:

SolverResult