MADlib  1.4.1
User Documentation
 All Files Functions Variables Groups
crf.sql_in File Reference

SQL functions for conditional random field. More...

Functions

float8[] lincrf_lbfgs_step_transition (float8[], float8[], float8[], float8[], float8, float8, float8[])
 
float8[] lincrf_lbfgs_step_merge_states (float8[] state1, float8[] state2)
 
float8[] lincrf_lbfgs_step_final (float8[] state)
 
float8 internal_lincrf_lbfgs_converge (float8[] state)
 
lincrf_result internal_lincrf_lbfgs_result (float8[] state)
 
aggregate float8[] lincrf_lbfgs_step (float8[], float8[], float8[], float8, float8, float8[])
 
aggregate anyarray array_union (anyarray)
 
integer compute_lincrf (varchar source, varchar sparse_R, varchar dense_M, varchar sparse_M, varchar featureSize, integer tagSize, integer maxNumIterations)
 
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...
 
integer lincrf (varchar source, varchar sparse_R, varchar dense_M, varchar sparse_M, varchar featureSize, integer tagSize, varchar featureset, varchar crf_feature)
 

Detailed Description

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

Function Documentation

aggregate anyarray array_union ( anyarray  )
integer compute_lincrf ( varchar  source,
varchar  sparse_R,
varchar  dense_M,
varchar  sparse_M,
varchar  featureSize,
integer  tagSize,
integer  maxNumIterations 
)
float8 internal_lincrf_lbfgs_converge ( float8[]  state)
lincrf_result internal_lincrf_lbfgs_result ( float8[]  state)
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).
integer lincrf ( varchar  source,
varchar  sparse_R,
varchar  dense_M,
varchar  sparse_M,
varchar  featureSize,
integer  tagSize,
varchar  featureset,
varchar  crf_feature 
)
aggregate float8 [] lincrf_lbfgs_step ( float8  [],
float8  [],
float8  [],
float8  ,
float8  ,
float8  [] 
)
float8 [] lincrf_lbfgs_step_final ( float8[]  state)
float8 [] lincrf_lbfgs_step_merge_states ( float8[]  state1,
float8[]  state2 
)
float8 [] lincrf_lbfgs_step_transition ( float8  [],
float8  [],
float8  [],
float8  [],
float8  ,
float8  ,
float8  [] 
)