predict: Predict BANTER events

predictR Documentation

Predict BANTER events

Description

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

Usage

predict(object, ...)

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

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

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

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

Note

At least one detector in the model must be present in new.data. Any detectors in the training model that are absent will have all species proportions and the the detector propoprtion set to 0. If a column called species is in new.data, columns for the original species designation and if that matches predicted (correct) will be added to the predict.df data.frame of the output.

Author(s)

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

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


EricArcher/banter documentation built on Feb. 1, 2024, 1:36 p.m.