Predict values based on a previously trained model.
ft_predict(
model,
newdata,
k = 1L,
threshold = 0,
rval = c("sparse", "dense", "slam"),
...
)
NULL
if a 'result_file'
is given otherwise
if 'prob'
is true a data.frame
with the predicted labels
and the corresponding probabilities, if 'prob'
is false a
character vector with the predicted labels.
an object inheriting from 'fasttext'
.
a character vector giving the new data.
an integer giving the number of labels to be returned.
a double withing [0, 1]
giving lower bound
on the probabilities. Predictions with probabilities
below this lower bound are not returned. The default
is 0
which means all predictions are returned.
a character string controlling the return value, allowed
values are "sparse"
, "dense"
and "slam"
.
The default is sparse, here the values are returned as a data.frame
in a format similar to a simple triplet matrix (sometimes refereed to as the
coordinate format). If rval
is set to "dense"
, a matrix
of the probabilities is returned. Similarly if rval
is set to
"slam"
, a matrix in the simple triplet sparse format from the
slam package is returned.
currently not used.
if (FALSE) {
ft_predict(model, newdata)
}
Run the code above in your browser using DataLab