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.

Code
Repository on GitHub
Credit
Solo
Stack
Python · pandas · NumPy · scikit-learn
Illustrative image: dense line charts of a noisy signal.

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 StandardScaler puts 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 into labels.
  • Feature DataFrame. features_df is built from segments, with labels added as the type column.

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

  • Python
  • pandas
  • NumPy
  • Matplotlib
  • scikit-learn

05 Credits

Author: Catalin Bondari. Dublin City University coursework.

Next project

Daft.ie data analysis app