pyeeg.solvers.IRLSSolver.solve
- IRLSSolver.solve(X, y, alpha=0.0, M=None)
Fit the robust Cauchy-loss IRLS model and return coefficients.
Accepts array, list-of-arrays, and 3-D multi-segment targets (see
_as_regression_segments()). Each channel is solved independently with its own convergence criterion; channels may be processed in parallel whenn_jobs > 1.- 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), 3-D array (n_epochs, n_samples, n_channels), or list of arrays (one per segment).
alpha (float, optional) – Tikhonov/L2 regularization strength. Must be scalar. When
Mis provided,alphais ignored in the solve. Default is 0.0.M (ndarray or None, optional) – Quadratic regularization matrix. 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).infois a dict with keysn_iter(max across channels),converged(True if all channels converged),scale(array of per-channel scales), andobjective(sum of final objectives).- Return type: