Description Usage Arguments Details Value Examples
The function fits POIS-glment and applies cross-validation (CV) to choose an optimal regularization parameter.
1 2 3 4 5 6 7 8 9 10 11 12 13 | fit_pois_glmnet_mmdcv(
z,
r = max(z),
train_ratio = 0.7,
nlam = 12,
lambda = 10^seq(-4, -1.3, length.out = nlam),
nreps = 2,
agg_func = mean,
alpha = 1,
use_parallel = F,
ncores = 7,
symmetrize = TRUE
)
|
z |
is a potentially sparse data array of dimensions: (sample size) x (data dimension) |
r |
maximum number of levels (K)' |
train_ratio |
train/validation split ratio will be train_ratio/(1-train_ratio). |
nlam |
number of regularization parameters (lambda) to use; ignored if lambda is provided. |
lambda |
the vector of regularization parameters to use. |
nreps |
the number of CV splits to average over. |
agg_func |
the aggregation function for the MMDs. |
The maximum mean discrepency (MMD) is used as the evaluation metric for CV. The MMD is computed between a sample from the original data and one from the fitted model. The MMD is computed for a sequence of Gaussian kernels with varying bandwidths, and aggregated using a user-supplied function.
The lambda vector, the regularization curve, a list of fitted POIS models, the index of the optimal model and the optimal lambda
1 | out = fit_pois_glmnet_mmdcv(amazon, lambda = 10^seq(-4,-1.3, length.out = 5))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.