- Notifications
You must be signed in to change notification settings - Fork1
SWFSC/banter
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
banter is a package for creating hierarchical acoustic event classifiers out of multiple call type detectors.
To install the latest version from GitHub:
# make sure you have devtools installedif(!require('devtools')) install.packages('devtools')# install package from GitHubdevtools::install_github('SWFSC/banter')
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 calledevent.id which is a unique id for each event, and a column calledspecies 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 thetrain.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 calledevent.id that associates the detected call with an event that the model was initialized with, and acall.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 thetrain.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)
TheaddBanterDetector 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 actualrandomForest model can be extracted for the event or detector models:
# extract event Random Forest modelevent.rf<- getBanterModel(bant.mdl,"event")# extract burst pulse (bp) Random Forest modelbp.rf<- getBanterModel(bant.mdl,"bp")
These can then be visualized using other tools, such as those in therfPermute 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)
- submit suggestions and bug-reports:https://github.com/SWFSC/banter/issues
- send a pull request:https://github.com/SWFSC/banter/
- e-mail:eric.ivan.archer@gmail.com
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
- move package to SWFSC GitHub site
- 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. - minor bug fixes and edits for CRAN
- add
subsampleDetections()to draw a random number of detections per event - fixed
predict()so that species names innew.dataare modified usingmake.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()andplotDetectorTrace().
- 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 frommake.names(). - Detector names and detector predictor column names in
new.datasubmitted topredict()are first checked to make sure at least one detector from model is present. - Detectors missing in
new.dataforpredict()will automatically have all species detector probabilities and detector proportions set to 0. - Added validation option to
predict()ifspeciescolumn exists innew.data - Default value for num.cores has been set to 1.
- Added
banterGuide()
- Initial CRAN release
About
banter is a package for creating hierarchical acoustic event classifiers out of multiple call type detectors.
Topics
Resources
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Uh oh!
There was an error while loading.Please reload this page.
Contributors3
Uh oh!
There was an error while loading.Please reload this page.