kme {mildsvm} | R Documentation |
Calculate the kernel mean embedding matrix
Description
Function to calculate the kernel mean embedding for to distributional data sets. It uses the empirical approximation for the integral
\int_{\mathcal X} \int_{\mathcal Y} K(x, y) d P_X d Q_Y
for a given
kernel K(\cdot, \cdot)
. Currently only supports radial basis function
kernel for fast computation.
Usage
## Default S3 method:
kme(df, df2 = NULL, sigma = 0.05, ...)
## S3 method for class 'mild_df'
kme(df, df2 = NULL, sigma = 0.05, ...)
Arguments
df |
A data.frame of |
df2 |
A data.frame, |
sigma |
The parameter for |
... |
Additional arguments passed to methods. |
Details
If df2 = NULL
, calculate the kernel mean embedding matrix of (df
, df
)
otherwise calculate (df
, df2
)
Value
A matrix of kernel mean embedding at the instance level.
Methods (by class)
-
default
: Default S3 method -
mild_df
: S3 method for classmild_df
Author(s)
Yifei Liu, Sean Kent
Examples
x = data.frame('instance_name' = c('inst_1', 'inst_2', 'inst_1'),
'X1' = c(-0.4, 0.5, 2))
kme(x)
mild_df1 <- generate_mild_df(nbag = 10, positive_degree = 3)
kme(mild_df1)