MyNixOS website logo
Description

BioAcoustic eveNT classifiER.

Create a hierarchical acoustic event species classifier out of multiple call type detectors as described in Rankin et al (2017) <doi:10.1111/mms.12381>.

CRAN version CRAN last day downloads CRAN last week downloads CRAN last month downloads CRAN total downloads
R-CMD-check

banter

Description

banter is a package for creating hierarchical acoustic event classifiers out of multiple call type detectors.

Installation

To install the latest version from GitHub:

# make sure you have devtools installed
if(!require('devtools')) install.packages('devtools')

# install package from GitHub
devtools::install_github('ericarcher/banter')

For a complete tutorial, run banterGuide().

Quick Tutorial

The BANTER (Bio-Acoustic eveNT classifiER) model is initialized with a data frame of events. There is one row per event and it must have a column called event.id which is a unique id for each event, and a column called species which assigns each event to a given species. Every other column in the data.frame will be used as a predictor variable for the events.
In the package, an example data.frame is in the train.data example data list as the $events element.

data(train.data)
bant.mdl <- initBanterModel(train.data$events)

Next, detector data is added to the initialized BANTER model object. Each detector is a data.frame with a column called event.id that associates the detected call with an event that the model was initialized with, and a call.id column that provides a unique identifier for each call. Every other column will be used as a predictor variable for the calls.
In the package, example data.frames for three detectors are provided in the $detectors element of the train.data example data list. Here is an example of adding the burst pulse (bp) detector.

bant.mdl <- addBanterDetector(
  bant.mdl, 
  data = train.data$detectors$bp, 
  name = "bp",
  ntree = 10, 
  sampsize = 1
)

The addBanterDetector function can be called repeatedly to add additional detectors. Alternatively, if the detectors are all in a named list, they can be added at once:

bant.mdl <- addBanterDetector(
  bant.mdl, 
  data = train.data$detectors, 
  ntree = 10, 
  sampsize = 1
)

Once all of the detectors have been added, then the full BANTER model is run:

bant.mdl <- runBanterModel(bant.mdl, ntree = 5000, sampsize = 3)

The model can be easily summarized:

summary(bant.mdl)

The actual randomForest model can be extracted for the event or detector models:

# extract event Random Forest model
event.rf <- getBanterModel(bant.mdl, "event")

# extract burst pulse (bp) Random Forest model
bp.rf <- getBanterModel(bant.mdl, "bp")

These can then be visualized using other tools, such as those in the rfPermute package:

library(rfPermute)
plotVotes(event.rf)

To predict novel data, it must be in a list with the event data in the $events element, and the detector data in a named list called $detectors:

data(test.data)
predict(bant.mdl, test.data)

Contact

Reference

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. Mar Mam Sci, 33: 520-540. doi:10.1111/mms.12381

version 0.9.6 (devel)

  • changed behavior of addBanterDetector() to provide a warning instead of an error if a detector didn't have enough detections of a species and add all detectors that were valid.

version 0.9.5 (on CRAN)

  • add subsampleDetections() to draw a random number of detections per event
  • fixed predict() so that species names in new.data are modified using make.names() like they are in constructing the initial banter model.
  • added run timestamps to all models and changed summary() to display a matrix of all.
  • fixed trace and inbag plots in summary() and plotDetectorTrace().

version 0.9.4

  • Detector names and detector predictor column names submitted to addBanterDetector() are now first checked to make sure they are syntactically valid and unique by comparing them with the results from make.names().
  • Detector names and detector predictor column names in new.data submitted to predict() are first checked to make sure at least one detector from model is present.
  • Detectors missing in new.data for predict() will automatically have all species detector probabilities and detector proportions set to 0.
  • Added validation option to predict() if species column exists in new.data
  • Default value for num.cores has been set to 1.
  • Added banterGuide()

version 0.9.3

  • Initial CRAN release.
Metadata

Version

0.9.6

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows