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 when n_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 M is provided, alpha is 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 becomes betas = (XᵀX + M)⁻¹ Xᵀy. Default is None.

Returns:

resultbetas has shape (n_features, n_channels). info is a dict with keys n_iter (max across channels), converged (True if all channels converged), scale (array of per-channel scales), and objective (sum of final objectives).

Return type:

SolverResult