Skip to content

yifdai/Biostat-626-mid1

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Biostat 626 midterm 1

Tasks

The first task is to build a binary classifier to classify the activity of each time window into static (0) and dynamic (1), where static postural transitions are coounted as static (0). The second task is build a refined multi-class classifier to classify walking (1), walking_upstairs (2), walking_downstairs (3), sitting (4), standing (5), lying (6), and static postural transition (7).

Session information

For binary classificaton task, require R version 4.1.3, and following packages:

dplyr         * 1.0.9  
e1071         * 1.7-13  
rpart         * 4.1.1  
tidytext      * 0.4.1  
tidyverse     * 1.3.2  
ipred         * 0.9-14  

The complete R session info can be found here

For multi-class task, the running environment is as follows: OS info: Windows-10-10.0.22000-SP0 Python version: 3.10.9 | packaged by conda-forge | (main, Jan 11 2023, 15:15:40) [MSC v.1916 64 bit (AMD64)] The package requirements are listed in requirements.txt.

Reproduction

Note: To get training_data.txt, you need to unzip /data/training_data.zip first.

In linux OS, you can use following commands:

cd ~/Biostat-626-mid1/data
unzip training_data.zip

In Mac OS, you can use following commands:

unzip train_data.zip -d ~/Biostat-626-mid1/data

In Windows OS, you can use any unzip software(e.g. Bandzip), to unzip the file under /data.

binary classfication

For binary classfication, please access to mid1_binary.Rmd

multi-classfication

As I'm using jupyter notebook, you can simply get accesses to the result as it has already been saved.(But for the model you need to re-run it.)
For the best performed model, please access to mid1_multiclass-o.ipynb
For the last submitted model, please access to mid1_multiclass.ipynb

Data descrption

Experiment design and data collection

A group of volunteers, aged between 19 and 48, are recruited to participate in the experiment. They performed a protocol consisting of six activities: three static postures (standing, sitting, lying) and three dynamic activities (walking, walking downstairs, and walking upstairs). The experiment also recorded postural transitions that occurred between the static postures. These are: stand-to-sit, sit-to-stand, sit-to-lie, lie-to-sit, stand-to-lie, and lie-to-stand. All participants wore a smart device on the waist during the experiment. It captured 3-axial linear acceleration and 3-axial angular velocity at a constant rate of 50Hz using the embedded accelerometer and gyroscope of the device. In this context, the activities are considered outcomes, and the signals measured by the smart device are considered features.

Data pre-processing and description

The sensor signals (accelerometer and gyroscope) were pre-processed by applying noise filters and then sampled in fixed-width sliding windows of 2.56 sec and 50% overlap (128 readings/window). The sensor acceleration signal, which has gravitational and body motion components, was separated using a Butterworth low-pass filter into body acceleration and gravity. The gravitational force is assumed to have only low-frequency components. Therefore a filter with a 0.3 Hz cutoff frequency was used. From each window, a vector of 561 features was obtained by calculating variables from the time and frequency domain. The details of the 561 features are described in files data_dictionary.txt and feature_info.txt.

Data files

Two tab-delimited text files training_data.zip and test_data.txt are provided. The training data (labeled activity information included) should be used to construct and test your ML algorithms. Apply your algorithm to the test data (containing only feature information) and predict the activity corresponding to each time window.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published