predict.supervised_model {fastTextR}R Documentation

Predict using a Previously Trained Model

Description

Predict values based on a previously trained model.

Usage

## S3 method for class '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

## Not run: 
predict(object, newdata)

## End(Not run)

[Package fastTextR version 1.0 Index]