| qsammon {qkerntool} | R Documentation | 
qKernel Sammon Mapping
Description
The qkernel Sammon Mapping is an implementation for Sammon mapping, one of the earliest dimension reduction techniques that aims to find low-dimensional embedding that preserves pairwise distance structure in high-dimensional data space. qsammon is a nonlinear form of Sammon Mapping.
Usage
## S4 method for signature 'matrix'
qsammon(x, kernel = "rbfbase", qpar = list(sigma = 0.5, q = 0.9),
          dims = 2, Initialisation = 'random', MaxHalves = 20,
          MaxIter = 500, TolFun = 1e-7, na.action = na.omit, ...)
## S4 method for signature 'cndkernmatrix'
qsammon(cndkernel, x, k, dims = 2, Initialisation = 'random',
          MaxHalves = 20,MaxIter = 500, TolFun = 1e-7, ...)
## S4 method for signature 'qkernmatrix'
qsammon(qkernel, x, k, dims = 2, Initialisation = 'random',
          MaxHalves = 20, MaxIter = 500, TolFun = 1e-7, ...)
Arguments
| x | the data matrix indexed by row or a kernel matrix of  | 
| kernel | the kernel function used in training and predicting. This parameter can be set to any function, of class kernel, which computes a kernel function value between two vector arguments. qkerntool provides the most popular kernel functions which can be used by setting the kernel parameter to the following strings: 
 The kernel parameter can also be set to a user defined function of class kernel by passing the function name as an argument. | 
| qpar | the list of hyper-parameters (kernel parameters). This is a list which contains the parameters to be used with the kernel function. Valid parameters for existing kernels are : 
 Hyper-parameters for user defined kernels can be passed through the qpar parameter as well. | 
| qkernel | the kernel function to be used to calculate the qkernel matrix. | 
| cndkernel | the cndkernel function to be used to calculate the CND kernel matrix. | 
| k | the dimension of the original data. | 
| dims | Number of features to return. (default: 2) | 
| Initialisation | 
 | 
| MaxHalves | maximum number of step halvings. (default : 20) | 
| MaxIter | the maximum number of iterations allowed. (default : 500) | 
| TolFun | relative tolerance on objective function. (default : 1e-7) | 
| na.action | A function to specify the action to be taken if  | 
| ... | additional parameters | 
Details
Using kernel functions one can efficiently compute
principal components in high-dimensional
feature spaces, related to input space by some non-linear map.
The data can be passed to the qsammon function in a matrix, in addition qsammon also supports input in the form of a
kernel matrix of class qkernmatrix or class cndkernmatrix.
Value
| dimRed | The matrix whose rows are embedded observations. | 
| kcall | The function call contained | 
| cndkernf | The kernel function used | 
all the slots of the object can be accessed by accessor functions.
Author(s)
Yusen Zhang 
yusenzhang@126.com
References
Sammon, J.W. (1969) A Nonlinear Mapping for Data Structure Analysis. IEEE Transactions on Computers, C-18 5:401-409.
See Also
Examples
data(iris)
train <- as.matrix(iris[,1:4])
labeltrain<- as.integer(iris[,5])
## S4 method for signature 'matrix'
kpc2 <- qsammon(train, kernel = "rbfbase", qpar = list(sigma = 2, q = 0.9), dims = 2,
                Initialisation = 'pca', TolFun = 1e-5)
plot(dimRed(kpc2), col = as.integer(labeltrain))
cndkernf(kpc2)