kme | R Documentation |
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.
## Default S3 method: kme(df, df2 = NULL, sigma = 0.05, ...) ## S3 method for class 'mild_df' kme(df, df2 = NULL, sigma = 0.05, ...)
df |
A data.frame of |
df2 |
A data.frame, |
sigma |
The parameter for |
... |
Additional arguments passed to methods. |
If df2 = NULL
, calculate the kernel mean embedding matrix of (df
, df
)
otherwise calculate (df
, df2
)
A matrix of kernel mean embedding at the instance level.
default
: Default S3 method
mild_df
: S3 method for class mild_df
Yifei Liu, Sean Kent
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.