predict.CRF.Rd
Similar to other predict methods, this function predicts fitted values from a fitted "CRF“ object.
# S3 method for CRF
predict(model, data, used.cols = NULL, thread.ratio = NULL)
S3
methods
R6Class object
A "CRF" object for prediction.
DataFrame
DataFrame containting the data.
list of characters, optional
This parameter specifies the three columns used for training a conditional random field model.
Namely, one column should correspond to Document ID, another column should correspond to
word position, and a 3rd column corresponds to word.
If not NULL, this parameter should be specified in two ways:
(1) used.cols = list("document.id" = "xxx", "word.pos" = "yyy", "word" = "zzz")
(2) used.cols = list("xxx", "yyy", "zzz")
In case (2), "xxx", "yyy" and "zzz" must be the column data of document ID, word position
and word respectively.
Defaults to the first three column names of data if not provided.
double, optional
Controls the proportion of available threads that can be used by this
function.
The value range is from 0 to 1, where 0 indicates a single thread,
and 1 indicates all available threads.
Values between 0 and 1 will use up to
that percentage of available threads.Values outside this
range are ignored.
Defaults to 0.
DataFrame
Prediction result, structured as follows:
1st column: document ID
2nd column: word position
3rd column: label
Call the function with a "CRF" object cf:
> predict(cf, data)