pyeeg.solvers.SVDSolver.solve
- SVDSolver.solve(X, y, alpha=0.0, M=None)
Solve the SVD regression and return the coefficients.
Xmay be a 2-D array or a list of 2-D arrays (segments / trials). When a list is given (with possibly different n_samples), the covariance matrices are accumulated across trials; the number of samples must then be the same inXandyper trial. Ifyis a 3-D array (n_epochs, n_samples, n_chans), the normal equations are accumulated across epochs.- 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
yis a list of arrays, each element is treated as an individual subject / segment and thebetascoefficients are computed on the accumulated covariance matrices.alpha (float or array-like, optional) – Regularization parameter (Tikhonov/L2). If array-like, betas are computed for every regularization value at once. When
Mis provided,alphano longer enters the solve (it only controls the size of the last output axis for API compatibility). Default is 0.0.M (ndarray, optional) – Quadratic regularization matrix (e.g. smoothness / Laplacian). If provided, it REPLACES the L2 (
alpha) regularization: the solution becomesbetas = (XᵀX + M)⁻¹ Xᵀy. Default is None.
- Returns:
result –
betashas shape (n_features, n_channels) or (n_features, n_channels, len(alpha)) whenalphais array-like;infois None.- Return type: