MakePnode.NeticaNode | R Documentation |
This does the actual work of making a node from a warehose manifest.
It is typically called from WarehouseMake
.
MakePnode.NeticaNode(net, name, data)
net |
A |
name |
The name of the node. Ideally, this should follow the Netica IDname rules. |
data |
A |
This is a key piece of the Warehouse
infrastructure. If a node of the designated name does not exist, it
will be created. If it does exist, the metadata fields of the node
will be adjusted to match the fields in the data
object.
Some of the fields of the data
object apply to the whole
node. In these fields, the value in the first row is used and the
rest are ignored.
A integer giving the number of states for a discrete variable or the discritzation of a continuous one. The number of rows of the data frame should match this.
A logical value telling whether or not the node should be regarded as continuous.
This is a longer unconstrained name for the node.
This is a longer string describing the node.
This is a comma separated list of tags identifying
sets to which the node belongs. See
PnodeLabels
.
These fields are repeated for each of the states in the node, as they are different for each state.
The name of the state, this should follow the Netica IDname conventions.
This is a longer unconstrained name for the state.
This is a longer string describing the state.
Additionally, the following field is used only for discrete nodes:
This is a numeric value assigned to the state. This value is used when calculating the node expected value.
The StateValue plays two important roles. First, when used with the
PnodeEAP
and PnodeSD
functions, it is the value assigned to the node. Second, when
constructing CPTs using the DiBello framework, it is used at the
effective thetas. See PnodeParentTvals
and
PnodeStateValues
Continuous nodes in Netica are handled by breaking the interval up
into pieces. This is the function
PnodeStateBounds
. Note that the bounds should
be either monotonically increasing or decreasing and that the lower
bound for one category should match lower bound for the next to within
a tolerance of .002. The values Inf
and -Inf
can be
used where appropriate.
This is a numeric value giving the lower bound for the range for the discritization of the node.
This is a numeric value giving the upper bound for the range for the
An object of class NeticaNode
which is also in the
Pnode
abtract class.
The truename system is designed to implement the name restrictions
inherent in Netica (see IDname) without imposing the
same limits on the Peanut framework. This is done by adding a
Truename
field to the net object and then mangling the actual
name to follow the Netica rules using the
as.IDname
function.
The object should be available from the warehouse via its truename, but it is best to stick to the Netica naming conventions for networks and nodes.
Note that the truename convention is used for node names, but not for state names, which are restricted to Netica conventions.
Russell Almond
RNetica Package:
NeticaNode
,
NewContinuousNode
,
NewDiscreteNode
,
IDname
Peanut Package:
Warehouse
, WarehouseMake
PNetica Pacakge
PnodeWarehouse
sess <- NeticaSession()
startSession(sess)
### This tests the manifest and factory protocols.
netman1 <- read.csv(system.file("auxdata", "Mini-PP-Nets.csv",
package="Peanut"),
row.names=1, stringsAsFactors=FALSE)
## Build the first network (proficiency model)
miniPP <- MakePnet.NeticaBN(sess,"miniPP",netman1[1,,drop=FALSE])
nodeman1 <- read.csv(system.file("auxdata", "Mini-PP-Nodes.csv",
package="Peanut"),
row.names=1,stringsAsFactors=FALSE)
## Discrete Example
phys.dat <- nodeman1[nodeman1$NodeName=="Physics",]
Physics <- MakePnode.NeticaNode(miniPP,"Physics",phys.dat)
## Continuous Example
dur.dat <- nodeman1[nodeman1$NodeName=="Duration",]
Duration <- MakePnode.NeticaNode(miniPP,"Duration",dur.dat)
DeleteNetwork(miniPP)
stopSession(sess)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.