kfm_exact: Create an exact kernel feature map

View source: R/kfm_exact.R

kfm_exactR Documentation

Create an exact kernel feature map

Description

For some kernels, it is possible to create the exact features from given data. This function stores the information needed to build those exact features.

Usage

kfm_exact(kernel = "polynomial", degree = 2, const = 1)

Arguments

kernel

A character determining the kernel to use. Currently, only 'radial' is implemented.

degree

A numeric value (default 2) that provides the degree for kernel = 'polynomial'

const

A numeric value (default 1) for the constant term when kernel = 'polynomial'.

Details

Currently, the following kernels are supported:

  • 'polynomial', with degree = d and const = c

Value

An object of class kfm_exact with the following components, returned from the inputs:

  • kernel

  • degree

  • const

Author(s)

Sean Kent

See Also

Other kernel feature map functions: kfm_nystrom()

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_exact(kernel = "polynomial", degree = 2, const = 1)
fm <- build_fm(fit, df)


mildsvm documentation built on July 14, 2022, 9:08 a.m.