make.features {CRF} | R Documentation |
Make CRF features
Description
Make the data structure of CRF features
Usage
make.features(crf, n.nf = 1, n.ef = 1)
Arguments
crf |
The CRF |
n.nf |
The number of node features |
n.ef |
The number of edge features |
Details
This function makes the data structure of features need for modeling and training CRF.
The parameters n.nf
and n.ef
specify the number of node and edge features,
respectively.
The objects node.par
and edge.par
define the corresponding
parameters used with each feature. node.par
is a 3-dimensional arrays,
and element node.par[n,i,f]
is the index of parameter associated with the
corresponding node potential node.pot[n,i]
and node feature f
.
edge.par
is a list of 3-dimensional arrays, and element
edge.par[[e]][i,j,f]
is the index of parameter associated with the
corresponding edge potential edge.pot[[e]][i,j]
and edge feature f
.
The value 0 is used to indicate the corresponding node or edge potential
does not depend on that feature.
For detail of calculation of node and edge potentials from features and parameters,
please see crf.update
.
Value
This function will directly modify the CRF and return the same CRF.
See Also
crf.update
, make.par
, make.crf