Learn R Programming

kernlab (version 0.6-2)

chol.reduce: Incomplete Cholesky decomposition

Description

chol.reduce computes the incomplete Cholesky decomposition of the kernel matrix from a data matrix.

Usage

chol.reduce(x, kernel="rbfdot", kpar=list(sigma=0.1), tol = 0.001, 
            max.iter = dim(x)[1], blocksize = 50, verbose = 0)

Arguments

x
The data matrix indexed by row
kernel
the kernel function used in training and predicting. This parameter can be set to any function, of class kernel, which computes a dot product between two vector arguments. kernlab provides the most popular kernel functions which c
kpar
the list of hyper-parameters (kernel parameters). This is a list which contains the parameters to be used with the kernel function. For valid parameters for existing kernels are :
  • sigmainverse kernel width for the Radial B
tol
algorithm stops when remaining pivots bring less accuracy then tol (default: 0.001)
max.iter
maximum number of iterations and colums in $Z$
blocksize
add this many columns to matrix per iteration
verbose
print info on algorithm convergence

Value

  • An S4 object of class "inc.chol" which is an extension of the class "matrix". The object is the decomposed kernel matrix along with the slots :
  • pivotsIndices on which pivots where done
  • diag.residuesResiduals left on the diagonal
  • maxresidualsResiduals picked for pivoting
  • slots can be accessed either by object@slot or by accessor functions with the same name (e.g. pivots(object))

Details

An incomplete cholesky decomposition calculates $Z$ where $K= ZZ'$ $K$ being the kernel matrix. Since the rank of a kernel matrix is usually low, $Z$ tends to be smaller then the complete kernel matrix. The decomposed matrix can be used to create memory efficient kernel-based algorithms without the need to compute and store a complete kernel matrix in memory.

References

Francis R. Bach, Michael I. Jordan Kernel Independent Component Analysis Journal of Machine Learning Research 3, 1-48 http://www.jmlr.org/papers/volume3/bach02a/bach02a.pdf

See Also

chol

Examples

Run this code
data(iris)
datamatrix <- as.matrix(iris[,-5])
# initialize kernel function
rbf <- rbfdot(sigma=0.1)
rbf
Z <- chol.reduce(datamatrix,kernel=rbf)
dim(Z)
pivots(Z)
# calculate kernel matrix
K <- crossprod(t(Z))
# difference between approximated and real kernel matrix
(K - kernelMatrix(kernel=rbf, datamatrix))[6,]

Run the code above in your browser using DataLab