This function predicts the class of the events (rows) based on a classification model previously trained and returns the row indexes of the positive class.

predict_cl(
  df,
  model = model,
  alg = c("RF", "XGB"),
  features = features,
  label = label
)

Arguments

df

An object of class data.frame.

model

Object of class train that contains the model to be used for classification of the new data.

alg

A character vector with the name of the classification algorithm used to train model.

features

A character vector with the features used to train model (also known as predictors).

label

A character vector with the name of the positive class. (e.g. 'beads')

Value

Returns a numeric vector with the row indexes of the positive class.