cmf_krr_pred_mem {conmolfields} | R Documentation |
To meke predictions in memory
Description
To meke predictions in memory
Usage
cmf_krr_pred_mem(model, kernels_pred, y_exp, print_pred = TRUE, plot_pred = TRUE, ...)
Arguments
model |
|
kernels_pred |
|
y_exp |
|
print_pred |
|
plot_pred |
|
... |
|
Examples
##---- 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 (model, kernels_pred, y_exp, print_pred = TRUE, plot_pred = TRUE,
...)
{
alphas_pred <- kernels_pred$alphas
y_train <- model$y_exp
K_pred <- cmf_calc_combined_kernels(kernels_pred, model$h,
model$alpha, alphas_pred)
y_pred <- K_pred %*% model$a + model$b
if (!is.na(y_exp[1])) {
if (print_pred) {
regr <- regr_param(y_pred, y_exp)
r2ex <- regr_param_ex(y_pred, y_exp, model$y_exp)
cat(sprintf("R2pred=%g RMSEpred=%g (%g%%) R2pred_ex=%g\n",
regr$R2, regr$RMSE, regr$RMSE_pc, r2ex))
flush.console()
}
if (plot_pred) {
cinf_plotxy(y_pred, y_exp, xlab = "Predicted", ylab = "Experiment",
main = "Scatter Plot for External Prediction")
abline(coef = c(0, 1))
}
}
y_pred
}
[Package
conmolfields version 0.0-19
Index]