kfm_nystrom | R Documentation |
Use the Nyström method to fit a feature map that approximates a given kernel.
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", ... )
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. |
For the ...
argument, the additional parameters depend on which kernel is
used:
For kernel = 'radial'
, specify sigma
to define kernel bandwidth.
an object of class kfm_nystrom
with the following components:
df_sub
the sub-sampled version of df
dv
pre-multiplication matrix which contains information on the
eigenvalues and eigenvectors of df_sub
method
'nystrom'
kernel
the input parameter kernel
kernel_params
parameters passed to ...
default
: For use on objects of class data.frame
or matrix
.
mild_df
: Ignore the information columns 'bag_label'
,
'bag_name'
, and 'instance_name'
when calculating kernel approximation.
Sean Kent
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
Other kernel feature map functions:
kfm_exact()
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.