clamp.crf {CRF} | R Documentation |
Generate clamped CRF by fixing the states of some nodes
clamp.crf(crf, clamped)
crf |
The CRF generated by |
clamped |
The vector of fixed states of nodes |
The function will generate a clamped CRF from a given CRF
by fixing the states of some nodes. The vector clamped
contains the desired state for each node while zero means the state is not
fixed. The node and edge potentials are updated to the conditional
potentials based on the clamped vector.
The function will return a new CRF with additional components:
original |
The original CRF. |
clamped |
The vector of fixed states of nodes. |
node.id |
The vector of the original node ids for nodes in the new CRF. |
node.map |
The vector of the new node ids for nodes in the original CRF. |
edge.id |
The vector of the original edge ids for edges in the new CRF. |
edge.map |
The vector of the new edge ids for edges in the original CRF. |
make.crf
, sub.crf
, clamp.reset
library(CRF)
data(Small)
crf <- clamp.crf(Small$crf, c(0, 0, 1, 1))