Skip to main content
. 2018 Oct 9;18(10):3363. doi: 10.3390/s18103363
Algorithm 1 Prediction algorithm
  • Input: AccelerometerData (Ax,Ay,Az) in CSV file

  • Output: prediction of true or false of a fall

  • slidingWindow=750 ms

  • consecutiveCount=0

  • prediction=false

  • for allAccelerometerData in slidingWindow do

  •   Compute Ares, ΔS, Smin, Smax

  •   Write to CSV file

  • end for

  • Initialize the prediction interval (i.e., which data sample in the CVS file to start the prediction)

  • traditionModel = the trained NB or SVM fall detection model

  • for allinstance in predictionInteval do

  •   label = traditionalModel.classifyInstance(instance)

  •   if (label==Fall) then

  •     ++consecutiveCount

  •   else if (3<=consecutiveCount<=50) then

  •     prediction=true

  •     consecutiveCount=0

  •   else

  •     consecutiveCount=0

  •   end if

  • end for

  • returnprediction