<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: The bn.kcv class structure</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="https://rpkg.net/assets/examples.css" />
</head><body>

<table width="100%" summary="page for bn.kcv class"><tr><td>bn.kcv class</td><td style="text-align: right;">R Documentation</td></tr></table>

<h2>The bn.kcv class structure</h2>

<h3>Description</h3>

<p>The structure of an object of S3 class <code>bn.kcv</code> or <code>bn.kcv.list</code>.
</p>


<h3>Details</h3>

<p>An object of class <code>bn.kcv.list</code> is a list whose elements are objects
of class <code>bn.kcv</code>.
</p>
<p>An object of class <code>bn.kcv</code> is a list whose elements correspond to the
iterations of a k-fold cross-validation. Each element contains the following
objects:
</p>

<ul>
<li> <p><code>test</code>: an integer vector, the indexes of the observations
used as a test set.
</p>
</li>
<li> <p><code>fitted</code>: an object of class <code>bn.fit</code>, the Bayesian network
fitted from the training set.
</p>
</li>
<li> <p><code>learning</code>: the <code>learning</code> element of the <code>bn</code> object
that was used for parameter learning from the training set (either learned
from the training set as well or specified by the user).
</p>
</li>
<li> <p><code>loss</code>: the value of the loss function.
</p>
</li></ul>

<p>If the loss function requires to predict values from the test sets, each
element also contains:
</p>

<ul>
<li> <p><code>predicted</code>: a factor or a numeric vector, the predicted values
for the target node in the test set.
</p>
</li>
<li> <p><code>observed</code>: a factor or a numeric vector, the observed values
for the target node in the test set.
</p>
</li></ul>

<p>In addition, an object of class <code>bn.kcv</code> has the following attributes:
</p>

<ul>
<li> <p><code>loss</code>: a character string, the label of the loss function.
</p>
</li>
<li> <p><code>mean</code>: the mean of the values of the loss function computed in
the <code>k</code> iterations of the cross-validation, which is printed as the
&quot;expected loss&quot; or averaged to compute the &quot;average loss over the runs&quot;.
</p>
</li>
<li> <p><code>bn</code>: either a character string (the label of the learning
algorithm to be applied to the training data in each iteration) or an
object of class <code>bn</code> (a fixed network structure).
</p>
</li></ul>



<h3>Author(s)</h3>

<p>Marco Scutari</p>


</body></html>
