banter (version 0.9.3)

predict: Predict BANTER events

Description

Predict species of events for novel data from a BANTER model.

Usage

# S3 method for banter_model
predict(object, new.data, ...)

Arguments

object

a banter_model object.

new.data

a list of event and detector data that has the same predictors as in the banter_model. It must contain elements called events and detectors. The events element must be a data.frame that has a column called event.id and the same predictor columns as the event data used to initialize the banter model (see initBanterModel). The detectors element must be a named list with the same detectors used to build the model (see addBanterDetector).

...

unused.

Value

A list with the following elements:

events

the data frame used in the event model for predictions.

predict.df

data.frame of predicted species and assignment probabilities for each event.

Examples

Run this code
# NOT RUN {
data(train.data)
# initialize BANTER model with event data
bant.mdl <- initBanterModel(train.data$events)
# add all detector models
bant.mdl <- addBanterDetector(
  bant.mdl, train.data$detectors, 
  ntree = 50, sampsize = 2, num.cores = 1
)
# run BANTER event model
bant.mdl <- runBanterModel(bant.mdl, ntree = 1000, sampsize = 1)

# predict test data
data(test.data)
test.pred <- predict(bant.mdl, test.data)
test.pred

# }

Run the code above in your browser using DataLab