Top Banner
Mining Smartphone Data (with Python) @neal_lathia PyData London 2016
32

Mining Smartphone Data (with Python)

Jan 13, 2017

Download

Data & Analytics

Neal Lathia
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Mining Smartphone Data (with Python)

Mining Smartphone Data (with Python)

@neal_lathiaPyData London 2016

Page 2: Mining Smartphone Data (with Python)
Page 3: Mining Smartphone Data (with Python)

Smartphones have sensors!

● Accelerometer (acceleration)● Gyroscope (orientation)● GPS, Wi-Fi (location)● ...

● Microphone (sound)● Bluetooth (co-location)

Page 4: Mining Smartphone Data (with Python)

Smartphones have sensors!

● Accelerometer (acceleration)● Gyroscope (orientation)● GPS, Wi-Fi (location)● ...

● Microphone (sound)● Bluetooth (co-location)

Page 5: Mining Smartphone Data (with Python)

This talk

● Collecting accelerometer data● A peek at the raw data● Magnitude data● Applications● Feature extraction● Focus on classifcation● https://github.com/nlathia/pydata_2016

Page 6: Mining Smartphone Data (with Python)

Collecting Data

Page 7: Mining Smartphone Data (with Python)

Collecting Data

Page 8: Mining Smartphone Data (with Python)

Collecting Data

Page 9: Mining Smartphone Data (with Python)

The raw data

Page 10: Mining Smartphone Data (with Python)

Raw: Standing

Page 11: Mining Smartphone Data (with Python)

Raw: Walk

Page 12: Mining Smartphone Data (with Python)

Raw: Run

Page 13: Mining Smartphone Data (with Python)

Raw: Stairs

Page 14: Mining Smartphone Data (with Python)

Raw: On a Train

Page 15: Mining Smartphone Data (with Python)

The magnitude vector

● We don't know how the phone is oriented● We want to capture what is happening in the 3

axes in a single time series

Page 16: Mining Smartphone Data (with Python)
Page 17: Mining Smartphone Data (with Python)

Applications

● Step counting– Brajdic, Harle. “Walk detection and step counting on

unconstrainted smartphones.” ACM Ubicomp '13.

● Unsupervised learning (profling)– Lathia et al. “Happy People Live Active Lives.” Under

Submission.

● Activity classifcation

Page 18: Mining Smartphone Data (with Python)

Unsupervised learning

Page 19: Mining Smartphone Data (with Python)

Activity Classifcation

Page 20: Mining Smartphone Data (with Python)

Activity classifcation: overview

● Get the time series data into some way to traina classifer

● Train a classifer● Predict activities● ??● Proft

Page 21: Mining Smartphone Data (with Python)

Related Problem

Page 22: Mining Smartphone Data (with Python)

Windowing

● Extract features from each window

Page 23: Mining Smartphone Data (with Python)

Extract features from windows

● Statistical (mean, std dev)● Time-series (jitter, kurtosis)● Signal (frequency)

Reading: Hemminki, Nurmi, Tarkoma.“Accelerometer-based Transportation ModeDetection on Smartphones.” ACM Sensys '13.

Page 24: Mining Smartphone Data (with Python)

Extract features from windows

Page 25: Mining Smartphone Data (with Python)

Extract features from windows

Page 26: Mining Smartphone Data (with Python)

Extract features from windows

Page 27: Mining Smartphone Data (with Python)

Extract features from windows

Label Features

Page 28: Mining Smartphone Data (with Python)

Data is ready.. classify

Page 29: Mining Smartphone Data (with Python)

Data is ready.. classify

Page 30: Mining Smartphone Data (with Python)

Further thoughts

● Collecting data effciently– Background processes use loads of battery

● Real data is messier– This was one person, one phone

● Feature engineering– This was just an example.

● Other favours of classifcation– Binary: “Is this walking?”– Personalized vs. global models

Page 31: Mining Smartphone Data (with Python)

Conclusion

● Collecting accelerometer data● A peek at the raw data● Magnitude data● Applications● Feature extraction● Focus on classifcation

Page 32: Mining Smartphone Data (with Python)

Mining Smartphone Data (with Python)

@neal_lathiaPyData London 2016

https://github.com/nlathia/pydata_2016