User Documentation
 All Files Functions Groups
crf.sql_in File Reference

SQL functions for conditional random field. More...

Go to the source code of this file.

Functions

integer lincrf (varchar source, varchar sparse_R, varchar dense_M, varchar sparse_M, varchar featureSize, integer tagSize, varchar featureset, varchar crf_feature, integer maxNumIterations=20)
 Compute linear-chain crf coefficients and diagnostic statistics. More...
 

Detailed Description

Date
July 2012
See Also
For a brief introduction to conditional random field, see the module description Conditional Random Field.

Definition in file crf.sql_in.

Function Documentation

integer lincrf ( varchar  source,
varchar  sparse_R,
varchar  dense_M,
varchar  sparse_M,
varchar  featureSize,
integer  tagSize,
varchar  featureset,
varchar  crf_feature,
integer  maxNumIterations = 20 
)
Parameters
sourceName of the source relation containing the training data
sparse_RName of the sparse single state feature column (of type DOUBLE PRECISION[])
dense_MName of the dense two state feature column (of type DOUBLE PRECISION[])
sparse_MName of the sparse two state feature column (of type DOUBLE PRECISION[])
featureSizeName of feature size column (of type DOUBLE PRECISION)
tagSizeThe number of tags in the tag set
featuresetThe unique feature set
crf_featureThe Name of output feature table
maxNumIterationsThe maximum number of iterations
Returns
a composite value:
  • coef FLOAT8[] - Array of coefficients, \( \boldsymbol c \)
  • log_likelihood FLOAT8 - Log-likelihood \( l(\boldsymbol c) \)
  • num_iterations INTEGER - The number of iterations before the algorithm terminated

    A 'crf_feature' table is used to store all the features and corresponding weights
Note
This function starts an iterative algorithm. It is not an aggregate function. Source and column names have to be passed as strings (due to limitations of the SQL syntax).

Definition at line 573 of file crf.sql_in.