Learn R Programming

banter (version 0.9.6)

predict: Predict BANTER events

Description

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

Usage

predict(object, ...)

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

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

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.

detector.freq

data.frame giving the number of events available for each detector.

validation.matrix

if species is a column in new.data, a table giving the classification rate for each event

Arguments

object

a banter_model object.

...

unused.

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).

Author

Eric Archer eric.archer@noaa.gov

References

Rankin, S. , Archer, F. , Keating, J. L., Oswald, J. N., Oswald, M. , Curtis, A. and Barlow, J. (2017), Acoustic classification of dolphins in the California Current using whistles, echolocation clicks, and burst pulses. Marine Mammal Science 33:520-540. doi:10.1111/mms.12381

Examples

Run this code
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