TLBC-package: Two-Level Behavior Classification

Description Details Author(s) See Also Examples

Description

Contains functions for training and applying two-level random forest and hidden Markov models for human behavior classification from raw tri-axial accelerometer and/or GPS data.

This code works with csv data from Actigraph accelerometers (please export in RAW format, without timestamps), and/or with GPS data processed by the PALMS GPS cleaning software.

The TLBC classifier uses six behavior labels:

Function classify uses a pre-learned TLBC model to classify accelerometer and/or GPS data with behavior labels. Pre-trained models that have been trained on three UCSD datasets are available for download.

Function trainModel trains a TLBC model from annotated accelerometer and/or GPS data.

Function calcPerformance computes the accuracy of predictions made on a given dataset.

Function looXval performs leave-one-out cross-validation on a dataset.

Details

Package: TLBC
Type: Package
Version: 1.0
Date: 2015-05-29
License: GPL-2

Author(s)

Katherine Ellis <kellis@ucsd.edu>

See Also

randomForest, HMM

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
## Not run: 

# train a new model
myAnnotations="~/myStudy/annotations.csv"
myAccel="~/myStudy/HipGT3X+"
myGPS="~/myStudy/GPS.csv"
WS=60
myModel="~/myStudy/myModel.RData"
trainModel(annotations=myAnnotations, accelerometers=myAccel, GPS=myGPS, winSize=WS, 
modelName=myModel)

# classify using a model computed yourself
myAccel="~/myStudy/HipGT3X+"
myGPS="~/myStudy/GPS.csv"
myModel="~/myStudy/myModel.RData"
myPredictions="~/myStudy/myModelPredictions"
classify(accelerometers=myAccel, GPS=myGPS, modelName=myModel, saveDir=myPredictions)

# compute the performance of a model on a dataset
myAnnotations="~/myStudy/annotations.csv"
myPredictions="~/myStudy/myModelPredictions"
WS=60
calcPerformance(annotations=myAnnotations, predictions=myPredictions, winSize=WS)

# perform leave-one-out cross-validation on a dataset
myAnnotations="~/myStudy/annotations.csv"
myAccel="~/myStudy/HipGT3X+"
WS=60
myPredictions="~/myStudy/looXvalPredictions"
looXval(annotations=myAnnotations, accelerometers=myAccel, winSize=WS, saveDir=myPredictions)


## End(Not run)

TLBC documentation built on May 1, 2019, 8:44 p.m.