Learn R Programming

fastTextR (version 1.0)

predict.supervised_model: Predict using a Previously Trained Model

Description

Predict values based on a previously trained model.

Usage

# S3 method for supervised_model
predict(object, newdata = character(),
  newdata_file = "", result_file = "", k = 1L, prob = FALSE, ...)

Arguments

object

an object inheriting from 'fasttext'.

newdata

a character vector giving the new data.

newdata_file

a character string giving the location of to the new data.

result_file

a character string naming a file.

k

an integer giving the number of labels to be returned.

prob

a logical if true the probabilities are also returned.

...

currently not used.

Value

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.

Examples

Run this code
# NOT RUN {
predict(object, newdata)
# }

Run the code above in your browser using DataLab