Description Usage Arguments Details
View source: R/cross-validation.R
Given a Bayesian network, some training data and some test data, the model given by fitting the Bayesian network to the training data is used to predict each node of the test data, given the parents of that node in the Bayesian network.
1 2 | residualsMultDir(x, weights = 1, train, test,
metric = kronecker_delta, verbose = F)
|
x |
A BN, or a |
weights |
A numeric vector weights for the models
|
train |
A data frame of training data |
test |
A data frame of test data |
metric |
A function that measures the distance between the predictions and the true values |
verbose |
Logical indicating whether verbose output should be given |
The residual is then computed, using the supplied
metric
.
Alternatively, a bn.list
of Bayesian networks can
be supplied, together with a vector of weights. The
models (Bayesian networks) are then averaged over,
according to the supplied weights, to give a model
averaging prediction.
The residuals are again computed, using the suppplied
metric
.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.