pyeeg.solvers.Solver

class pyeeg.solvers.Solver

Abstract base class for regression solvers.

All solvers accept (X, y, alpha, M) and return a SolverResult. X can be a 2-D array or a list of 2-D arrays (segments). y can be a 2-D array, 3-D array (multi-epoch), or list of 2-D arrays.

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

  • y (ndarray or list of ndarray) – Target (n_samples, n_channels) or (n_samples, n_channels, n_epochs) or list.

  • alpha (float or array-like) – Regularization strength(s). When M is provided, alpha is ignored in the solve (it only controls output axis size for API compatibility).

  • M (ndarray or None) – Quadratic regularization matrix. If provided, REPLACES L2 (alpha) regularization: the solution becomes betas = (X^T X + M)^{-1} X^T y.

Returns:

result – Contains betas (ndarray) and info (dict or None).

Return type:

SolverResult

Methods

Solver.solve(X, y[, alpha, M])

Solve the regression problem and return the coefficients.