himalaya.kernel_ridge.solve_kernel_ridge_conjugate_gradient

himalaya.kernel_ridge.solve_kernel_ridge_conjugate_gradient(K, Y, alpha=1.0, fit_intercept=False, initial_dual_weights=None, max_iter=100, tol=0.001, random_state=None, n_targets_batch=None)[source]

Solve kernel ridge regression using conjugate gradient.

Solve the kernel ridge regression:

w* = argmin_w ||K @ w - Y||^2 + alpha (w.T @ K @ w)
Parameters
Karray of shape (n_samples, n_samples)

Input kernel.

Yarray of shape (n_samples, n_targets)

Target data.

alphafloat, or array of shape (n_targets, )

Regularization parameter.

fit_interceptboolean

Whether to fit an intercept. If False, K should be centered (see KernelCenterer), and Y must be zero-mean over samples.

initial_dual_weightsarray of shape (n_samples, n_targets)

Initial kernel ridge coefficients.

max_iterint

Maximum number of conjugate gradient step.

tolfloat > 0 or None

Tolerance for the stopping criterion.

random_stateint, or None

Random generator seed. Not used.

n_targets_batchint or None

Size of the batch for over targets during cross-validation. Used for memory reasons. If None, uses all n_targets at once.

Returns
dual_weightsarray of shape (n_samples, n_targets)

Kernel ridge coefficients.

interceptarray of shape (n_targets,)

Intercept. Only returned when fit_intercept is True.