build_fm | R Documentation |
Feature maps provide a set of covariates in a transformed space. The
build_fm()
function creates these covariates based on an object that
specifies the feature map and a provided dataset.
build_fm(kfm_fit, new_data, ...) ## S3 method for class 'kfm_exact' build_fm(kfm_fit, new_data, ...) ## S3 method for class 'kfm_nystrom' build_fm(kfm_fit, new_data, ...)
kfm_fit |
An object from a function in the |
new_data |
The data to generate features from. |
... |
Additional arguments for methods. |
A matrix of covariates in the feature space, with the same number of
rows as new_data
. If new_data
is a mild_df
object, build_fm()
will also return the columns containing 'bag_label', 'bag_name',
'instance_name'.
kfm_exact
: Method for kfm_exact
class.
kfm_nystrom
: Method for kfm_nystrom
class.
Sean Kent
kfm_nystrom()
fit a Nystrom kernel feature map approximation.
kfm_exact()
create an exact kernel feature map.
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) fit <- kfm_exact(kernel = "polynomial", degree = 2, const = 1) fm <- build_fm(fit, df)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.