kliep | R Documentation |
Kullback-Leibler importance estimation procedure
kliep(
df_numerator,
df_denominator,
scale = "numerator",
nsigma = 10,
sigma_quantile = NULL,
sigma = NULL,
ncenters = 200,
centers = NULL,
cv = TRUE,
nfold = 5,
epsilon = NULL,
maxit = 5000,
progressbar = TRUE
)
df_numerator |
|
df_denominator |
|
scale |
|
nsigma |
Integer indicating the number of sigma values (bandwidth parameter of the Gaussian kernel gram matrix) to use in cross-validation. |
sigma_quantile |
|
sigma |
|
ncenters |
Maximum number of Gaussian centers in the kernel gram matrix. Defaults to all numerator samples. |
centers |
Option to specify the Gaussian samples manually. |
cv |
Logical indicating whether or not to do cross-validation |
nfold |
Number of cross-validation folds used in order to calculate the
optimal |
epsilon |
Numeric scalar or vector with the learning rate for the
gradient-ascent procedure. If a vector, all values are used as the learning
rate. By default, |
maxit |
Maximum number of iterations for the optimization scheme. |
progressbar |
Logical indicating whether or not to display a progressbar. |
kliep
-object, containing all information to calculate the
density ratio using optimal sigma and optimal weights.
Sugiyama, M., Suzuki, T., Nakajima, S., Kashima, H., Von Bünau, P., & Kawanabe, M. (2008). Direct importance estimation for covariate shift adaptation. Annals of the Institute of Statistical Mathematics 60, 699-746. Doi: https://doi.org/10.1007/s10463-008-0197-x.
set.seed(123)
# Fit model
dr <- kliep(numerator_small, denominator_small)
# Inspect model object
dr
# Obtain summary of model object
summary(dr)
# Plot model object
plot(dr)
# Plot density ratio for each variable individually
plot_univariate(dr)
# Plot density ratio for each pair of variables
plot_bivariate(dr)
# Predict density ratio and inspect first 6 predictions
head(predict(dr))
# Fit model with custom parameters
kliep(numerator_small, denominator_small,
nsigma = 1, ncenters = 100, nfold = 10,
epsilon = 10^{2:-5}, maxit = 500)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.