looXval: Function to perform leave-one-out cross-validation

Description Usage Arguments Author(s) See Also Examples

Description

Performs leave-one-out cross-validation

Usage

1
2
looXval(annotations, accelerometers=NULL, GPS=NULL, winSize=60, saveDir, names=NULL, 
strat=TRUE)

Arguments

annotations

Path to a file containing bout-level annotations (or directory of files containing bout-level annotations). Should be csv format with fields: identifier,StartDateTime,EndDateTime,behavior.

Or, path to a directory containing instance-level annotations, i.e., created by the function annotationsToLabels.

accelerometers

(Optional) Path to a directory (or list of directories) containing actigraph accelerometer data files. Accelerometer data files should be csv files output in "raw" format by ActiLife (without timestamps), and named by the participant identifier, e.g., Participant01.csv.

Or, path to a directory (or list of directories) containing previously computed accelerometer features, i.e., computed by the function sensorsToFeatures.

GPS

(Optional) Path to a PALMS-processed GPS data file (or a directory containing GPS data files). GPS data files should be in csv format with the following fields: identifier, dateTime, speed, ele, elevationDelta, lat, lon, nsatView, snrView. identifier should be the participant identifier, e.g. Participant01. If GPS is a path to a directory, each file in the directory should correspond to a participant, and the file name should be the participant identifier, e.g., Participant01.csv.

Or, path to a directory containing previously computed GPS features, i.e., computed by the function sensorsToFeatures.

winSize

Window size in seconds.

saveDir

Path to a directory where predictions will be saved. Predictions will be saved in files named <identifier>.csv with two fields: timestamp,prediction.

names

(Optional) List of participant identifiers to use.

strat

logical: use stratified sampling for the random forest?

Author(s)

Katherine Ellis

See Also

trainModel,classify

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## Not run: 

# perform leave-one-out cross-validation on a dataset
myAnnotations="~/myStudy/annotations.csv"
myAccel="~/myStudy/HipGT3X+"
winSize=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.