kfm_nystrom {mildsvm} | R Documentation |
Fit a Nyström kernel feature map approximation
Description
Use the Nyström method to fit a feature map that approximates a given kernel.
Usage
kfm_nystrom(df, m, r, kernel, sampling, ...)
## Default S3 method:
kfm_nystrom(
df,
m = nrow(df),
r = m,
kernel = "radial",
sampling = "random",
...
)
## S3 method for class 'mild_df'
kfm_nystrom(
df,
m = nrow(df),
r = m,
kernel = "radial",
sampling = "random",
...
)
Arguments
df |
An object containing covariates for training. Usually a data.frame or matrix. |
m |
The number of examples from |
r |
The rank of matrix approximation to use. Must be less than or equal
to |
kernel |
A character determining the kernel to use. Currently, only
|
sampling |
A character determining how to sample instances. Default is
|
... |
additional parameters needed for the kernels. See details. |
Details
For the ...
argument, the additional parameters depend on which kernel is
used:
For
kernel = 'radial'
, specifysigma
to define kernel bandwidth.
Value
an object of class kfm_nystrom
with the following components:
-
df_sub
the sub-sampled version ofdf
-
dv
pre-multiplication matrix which contains information on the eigenvalues and eigenvectors ofdf_sub
-
method
'nystrom'
-
kernel
the input parameterkernel
-
kernel_params
parameters passed to...
Methods (by class)
-
default
: For use on objects of classdata.frame
ormatrix
. -
mild_df
: Ignore the information columns'bag_label'
,'bag_name'
, and'instance_name'
when calculating kernel approximation.
Author(s)
Sean Kent
References
Williams, C., & Seeger, M. (2001). Using the Nyström Method to Speed Up Kernel Machines. Advances in Neural Information Processing Systems, 13, 682–688.
Kent, S., & Yu, M. (2022). Non-convex SVM for cancer diagnosis based on morphologic features of tumor microenvironment arXiv preprint arXiv:2206.14704
See Also
Other kernel feature map functions:
kfm_exact()
Examples
df <- data.frame(
X1 = c(2, 3, 4, 5, 6, 7, 8),
X2 = c(1, 1.2, 1.3, 1.4, 1.1, 7, 1),
X3 = rnorm(7)
)
fit <- kfm_nystrom(df, m = 7, r = 6, kernel = "radial", sigma = 0.05)
fm <- build_fm(fit, df)