Learn R Programming

FastKRR (version 0.1.2)

print.approx_kernel: Print method for approximated kernel matrices

Description

Displays the approximated kernel matrix and key options used to construct it.

Usage

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

Value

An approximated kernel matrix and its associated options.

Arguments

x

An S3 object created by approx_kernel.

...

Additional arguments (currently ignored).

Details

The function prints the stored approximated kernel matrix (top-left 6x6) and summarizes options such as the approximation method (opt), approximaion degree (m), numerical tolerance (eps), and number of threads used (n_threads).

See Also

approx_kernel, print.krr, print.kernel_matrix

Examples

Run this code
# Data setting
set.seed(1)
d = 1
n = 1000
m = 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))
K = make_kernel(X, kernel = "gaussian", rho = rho)

# Example: nystrom
K_nystrom = approx_kernel(K = K, opt = "nystrom", m = m, d = d, rho = rho, n_threads = 1)
class(K_nystrom)

print(K_nystrom)

Run the code above in your browser using DataLab