Learn R Programming

CRF (version 0.3-8)

clamp.crf: Make clamped CRF

Description

Generate clamped CRF by fixing the states of some nodes

Usage

clamp.crf(crf, clamped)

Arguments

crf
The CRF generated by make.crf
clamped
The vector of fixed states of nodes

Value

  • The function will return a new CRF with additional components:
  • originalThe original CRF.
  • clampedThe vector of fixed states of nodes.
  • node.idThe vector of the original node ids for nodes in the new CRF.
  • node.mapThe vector of the new node ids for nodes in the original CRF.
  • edge.idThe vector of the original edge ids for edges in the new CRF.
  • edge.mapThe vector of the new edge ids for edges in the original CRF.

Details

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.

See Also

make.crf, sub.crf, clamp.reset

Examples

Run this code
library(CRF)
data(Small)
crf <- clamp.crf(Small$crf, c(0, 0, 1, 1))

Run the code above in your browser using DataLab