All projects
Project P-03 · Dublin City University coursework
Time-series features
This project recognises activities from time-series data collected by accelerometers. It extracts features from segmented data and uses machine learning models for classification, turning raw sensor data into insight about human movement.
- Credit
- Solo
- Stack
- Python · pandas · NumPy · scikit-learn
01 What it is
The script expects data in a folder named data inside the project. It reads every CSV file in its subfolders; each file holds accelerometer readings (X, Y and Z axes) and a column named type with the activity for each data point.
02 Method
- Concatenation. All data points from the CSV files are merged into a single pandas DataFrame.
- Standardisation. A
StandardScalerputs the X, Y and Z axes on a common scale for better model performance. - Segmentation. The data is divided into fixed-length windows of accelerometer readings.
- Feature extraction. For each segment and axis: mean, standard deviation, median, minimum, maximum, range and interquartile range (IQR).
- Feature storage. Features go into a list named
segments; the activity of each segment’s first element goes intolabels. - Feature DataFrame.
features_dfis built fromsegments, withlabelsadded as thetypecolumn.
03 Models
- Random Forest Classifier. An ensemble method known for its effectiveness and robustness in classification problems.
- Linear Support Vector Classifier (SVC). A linear classifier that separates data points into distinct classes, a strong candidate for activity recognition.
04 Tools
05 Credits
Author: Catalin Bondari. Dublin City University coursework.
Next project
Daft.ie data analysis app