Learn R Programming

mildsvm (version 0.4.1)

kfm_exact: 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)

Value

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

  • kernel

  • degree

  • const

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'.

Author

Sean Kent

Details

Currently, the following kernels are supported:

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

See Also

Other kernel feature map functions: kfm_nystrom()

Examples

Run this code
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)

Run the code above in your browser using DataLab