Description Usage Arguments Examples
Computes indicator kernel matrices for prediction and saves to file
1 | comp_ind_kernels_pred(train_fname = "ligands-train.mol2", pred_fname = "ligands-pred.mol2", ind_kernels_pred_fname = "ligands-ind-kernels-pred.RData", print_comp_kernels = TRUE, ...)
|
train_fname |
|
pred_fname |
|
ind_kernels_pred_fname |
|
print_comp_kernels |
|
... |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | ##---- Should be DIRECTLY executable !! ----
##-- ==> Define data, use random,
##-- or do help(data=index) for the standard data sets.
## The function is currently defined as
function (train_fname = "ligands-train.mol2", pred_fname = "ligands-pred.mol2",
ind_kernels_pred_fname = "ligands-ind-kernels-pred.RData",
print_comp_kernels = TRUE, ...)
{
mdb0_train <- read_mol2(train_fname)
mdb0_pred <- read_mol2(pred_fname)
mdb_train <- cmf_params_tripos(mdb0_train)
mdb_pred <- cmf_params_tripos(mdb0_pred)
syb_types <- get_syb_types_list(mdb_train)
kernels_pred <- list()
kernels_pred$alphas <- alphas
for (type in syb_types) {
kernels_pred[[type]] <- list()
}
for (ialpha in 1:length(alphas)) {
alpha <- alphas[ialpha]
if (print_comp_kernels) {
cat(sprintf("computing indicator kernels for alpha=%g\n",
alpha))
flush.console()
}
for (type in syb_types) {
if (print_comp_kernels)
cat(type)
kernels_pred[[type]][[ialpha]] <- cmf_indicator_kernel_matrix_pred(mdb_pred,
mdb_train, alpha, type, verbose = print_comp_kernels)
}
}
save(kernels_pred, file = ind_kernels_pred_fname)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.