# Real-Time Machine Learning for Human Activities Recognition Based on Wrist-Worn Wearable Devices
## 3 Proposed System
### WISDM Biometrics Dataset  
The \"WISDM Smartphone and Smartwatch Activity and Biometrics Dataset\" dataset was chosen for this implementation. This dataset was introduced and described in [30] and is extensively used for human activity recognition. This dataset was chosen as it is one of the most important and used datasets for human activity recognition based on wearable devices, as also mentioned in [22]. Since it was used in multiple studies, it is a perfect candidate to be used to compare different approaches and to analyze the obtained accuracy rates across multiple different implementations. Since the data collection process was closely supervised by the dataset research creators, to ensure proper data quality and movement consistency, this dataset can be clearly used for the in-depth analysis of any of the available activities. This dataset is even suitable for detecting symmetric activities. Based on the fact that the dataset used is an existing one that is freely available for usage, the research creators handled the appropriate approvals from required entities as it involved human subjects research. The dataset contains many different activities carried out by 51 subjects. We have 18 different activities, each with a length of about 3 min. The monitoring devices used to track the subject's movements are a smartwatch and a smartphone. The smartwatch is placed on the subject's dominant hand and is non-obstructive, due to its relatively small form factor. The smartphone is placed in the pocket, simulating the everyday carrying of this omnipresent device. Both data-gathering devices run a custom-made app designed specifically for this purpose. Both tracking devices gather accelerometer and gyroscope data using a number of four separate sensors, two for each device. Each sensor gathers data with a frequency of 20 Hz, reading a measurement every 50 ms. This is the data polling rate that was set for the operation but the actual polling rate of the sensor data can be delayed if the processor is busy. Accelerometer and gyroscope data folders are present for both smartwatch and smartphone data. In each data sub-directory, there will be a file for each subject, so a total of 51 files will be present in each sub-directory. The naming of the files is standard and uses underlining to delimit different parts of the name components. Each data file contains one sensor reading per line using a comma-separated value data format, as the data format is maintained across the different sensor types and sources. Each line has the following features:  
* Subject-id: a unique identifier for the subject, with a range between 1600 and 1650;
* Activity Code: a unique identifier for the activity, using a single letter from A to S skipping the \"N\" value;
* Timestamp: the sensor reading timestamp in Linux format;
* Sensor value for the x, y, and z axis represented by numeric real values. Each file contains approximately 54 min of readings, based on the expected 3 min for each activity multiplied by the total number of 18 activities; in an ideal case, we would have a total number of 64,800 lines for the file. The data collection process was not perfect, so these borderline values will still fluctuate across the dataset somewhat. The raw total number of samples in this dataset is 15,630,426 and the distribution of data across the sensor types and sources is as follows:  
* Raw phone accelerometer number of data readings: 4,804,403;
* Raw phone gyroscope number of data readings: 3,608,635;
* Raw watch accelerometer number of data readings: 3,777,046;
* Raw watch gyroscope number of data readings: 3,440,342. The smartwatch data-gathering device runs Android Wear 1.5 and the smartphone runs Android 6.0. As shown in [31], this dataset groups all the previously mentioned activities into three main activity categories based on the type of activity and each recorded activity in this dataset has a code assigned.