# Kernel Ridge Regression¶

Kernel Ridge based classifier combining ridge regression (linear least-squares L2-norm) regression with the kernel trick

*Configuration*:

alphaSmall positive values of alpha improve the conditioning of the problem and reduce the variance of the estimates. Alpha corresponds to

`(2*C)^-1`

in other linear models such as LogisticRegression or LinearSVC. If an array is passed, penalties are assumed to be specific to the targets. Hence they must correspond in number.

kernelKernel mapping used internally. A callable should accept two arguments and the keyword arguments passed to this object as kernel_params, and should return a floating point number. Set to “precomputed” in order to pass a precomputed kernel matrix to the estimator methods instead of samples.

gammaGamma parameter for the RBF, laplacian, polynomial, exponential chi2 and sigmoid kernels. Interpretation of the default value is left to the kernel; see the documentation for sklearn.metrics.pairwise. Ignored by other kernels.

coef0Zero coefficient for polynomial and sigmoid kernels. Ignored by other kernels.

degreeDegree of the polynomial kernel. Ignored by other kernels.

*Attributes*:

dual_coef_Representation of weight vector(s) in kernel space

X_fit_Training data, which is also required for prediction. If kernel == “precomputed” this is instead the precomputed training matrix, shape = [n_samples, n_samples].

*Input ports*:

*Output ports*:**model**: model- Model

**alpha**(alpha)- Small positive values of alpha improve the conditioning of the problem
and reduce the variance of the estimates. Alpha corresponds to
`(2*C)^-1`

in other linear models such as LogisticRegression or LinearSVC. If an array is passed, penalties are assumed to be specific to the targets. Hence they must correspond in number. **kernel**(kernel)- Kernel mapping used internally. A callable should accept two arguments and the keyword arguments passed to this object as kernel_params, and should return a floating point number. Set to “precomputed” in order to pass a precomputed kernel matrix to the estimator methods instead of samples.
**gamma**(gamma)- Gamma parameter for the RBF, laplacian, polynomial, exponential chi2 and sigmoid kernels. Interpretation of the default value is left to the kernel; see the documentation for sklearn.metrics.pairwise. Ignored by other kernels.
**coef0**(coef0)- Zero coefficient for polynomial and sigmoid kernels. Ignored by other kernels.
**degree**(degree)- Degree of the polynomial kernel. Ignored by other kernels.

Some of the docstrings for this module have been automatically extracted from the scikit-learn library and are covered by their respective licenses.