crf

fun crf(sequences: Array<Array<Tuple>>, labels: Array<IntArray>, ntrees: Int = 100, maxDepth: Int = 20, maxNodes: Int = 100, nodeSize: Int = 5, shrinkage: Double = 1.0): CRF(source)

Fits a first-order linear conditional random field.

Return

the CRF model.

Parameters

sequences

the observation attribute sequences.

labels

sequence labels.

ntrees

the number of trees/iterations.

maxDepth

the maximum depth of the tree.

maxNodes

the maximum number of leaf nodes in the tree.

nodeSize

the number of instances in a node below which the tree will not split.

shrinkage

the shrinkage parameter in (0, 1] controlling the learning rate.


fun crf(sequences: Array<Array<Tuple>>, labels: Array<IntArray>, options: CRF.Options): CRF(source)

Fits a first-order linear conditional random field with given hyperparameters.

Return

the CRF model.

Parameters

sequences

the observation attribute sequences.

labels

sequence labels.

options

the CRF hyperparameters.


fun <T> crf(sequences: Array<Array<T>>, labels: Array<IntArray>, ntrees: Int = 100, maxDepth: Int = 20, maxNodes: Int = 100, nodeSize: Int = 5, shrinkage: Double = 1.0, features: (T) -> Tuple): CRFLabeler<T>(source)

Fits a first-order linear conditional random field labeler for generic observation objects.

Return

the CRF sequence labeler.

Parameters

sequences

the observation sequences.

labels

sequence labels.

ntrees

the number of trees/iterations.

maxDepth

the maximum depth of the tree.

maxNodes

the maximum number of leaf nodes in the tree.

nodeSize

the number of instances in a node below which the tree will not split.

shrinkage

the shrinkage parameter in (0, 1] controlling the learning rate.

features

the feature extraction function converting each observation item to a Tuple.

Type Parameters

T

the data type of observations.


fun <T> crf(sequences: Array<Array<T>>, labels: Array<IntArray>, options: CRF.Options, features: (T) -> Tuple): CRFLabeler<T>(source)

Fits a first-order linear conditional random field labeler for generic observation objects with given hyperparameters.

Return

the CRF sequence labeler.

Parameters

sequences

the observation sequences.

labels

sequence labels.

options

the CRF hyperparameters.

features

the feature extraction function converting each observation item to a Tuple.

Type Parameters

T

the data type of observations.