Learn R Programming

FastKRR (version 0.1.2)

print.krr: Print method for fitted Kernel Ridge Regression models

Description

Displays key information from a fitted Kernel Ridge Regression (KRR) model, including the original call, first few coefficients, a 6×6 block of the kernel (or approximated kernel) matrix, and the main kernel options.

Usage

# S3 method for krr
print(x, ...)

Value

A human-readable summary of the fitted KRR model to the console.

Arguments

x

An S3 object of class krr, typically returned by fastkrr.

...

Additional arguments (currently ignored).

See Also

fastkrr, print.approx_kernel, print.kernel_matrix

Examples

Run this code
# Data setting
set.seed(1)
lambda = 1e-4
d = 1
n = 50
rho = 1
X = matrix(runif(n*d, 0, 1), nrow = n, ncol = d)
y = as.vector(sin(2*pi*rowMeans(X)^3) + rnorm(n, 0, 0.1))

# Example: exact
model = fastkrr(X, y,
                kernel = "gaussian", opt = "exact",
                rho = rho, lambda = 1e-4)
class(model)

print(model)

Run the code above in your browser using DataLab