Similar to other predict methods, this function predicts fitted values from a fitted "RDTClassifier" object.

# S3 method for RDTClassifier
predict(
  model,
  data,
  key,
  features = NULL,
  verbose = NULL,
  block.size = NULL,
  missing.replacement = NULL
)

Format

S3 methods

Arguments

model

R6Class object
A "RDTClassifier" object for prediction.

data

DataFrame
DataFrame containting the data.

key

character
Name of the ID column.

features

character of list of characters, optional
Name of feature columns for prediction.
If not provided, it defaults to all non-key columns of data.

verbose

logical, optional
If TRUE, output all classes and the corresponding confidences for each data point.
Defaults to FALSE.

block.size

integer, optional
The number of rows loaded per time during prediction. 0 indicates load all data at once.
Defaults to 0.

missing.replacement

character, optional
The missing replacement strategy:

  • "feature.marginalized": marginalize each missing feature out independently.

  • "instance.marginalized": marginalize all missing features in an instance as a whole corresponding to each category.

Defaults to "feature.marginalized".

Value

Dataframe
Predicted values, structured as follows.

  • ID, with same name and type as data's ID column.

  • SCORE, type NVARCHAR, predicted class labels.

  • CONFIDENCE, type DOUBLE. Representing the confidence of a class.

Examples

Call the function with a "RDTClassifier" object rfc:


> predict(rfc, data, key = "ID")