pyeeg.solvers.ConjugateGradientSolver

class pyeeg.solvers.ConjugateGradientSolver(tol=1e-10, max_iter=None, preconditioner=None, verbose=False)

Regression solver using Conjugate Gradient on normal equations.

Computes XᵀX and Xᵀy, then solves (XᵀX + alpha*I + M) beta = Xᵀy using the Conjugate Gradient method.

Parameters:
  • tol (float, optional) – Convergence tolerance for the conjugate gradient. Default is 1e-10.

  • max_iter (int or None, optional) – Maximum number of iterations. If None, defaults to the number of features. Default is None.

  • preconditioner (callable or None, optional) – Function that builds a preconditioner from the system matrix A (e.g. incomplete_cholesky_preconditioner() or diagonal_preconditioner()). If None, no preconditioning is applied. Default is None.

  • verbose (bool, optional) – Whether to log progress information. Default is False.

Methods

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

Solve the regression problem with block conjugate gradient.