27
Data Science in #mHealth @neal_lathia @Cambridge_Uni @emotionsense

Data Science in #mHealth

Embed Size (px)

Citation preview

Page 1: Data Science in #mHealth

Data Science in #mHealth

@neal_lathia@Cambridge_Uni@emotionsense

Page 2: Data Science in #mHealth

Many data science applications deal with some kind of behaviour.

Page 3: Data Science in #mHealth

Data science: making sense from & putting big data sets of small behaviours to use.(e.g., ratings � #recsys)

Page 4: Data Science in #mHealth

Many health settings relate to one or more of our behaviours.

Page 5: Data Science in #mHealth

Improving health: changing our small, momentary, cumulative behaviours.(e.g., one cigarette � smoking cessation)

Page 6: Data Science in #mHealth

How can we capture our small, momentary, cumulative behaviours?

Page 7: Data Science in #mHealth

AccelerometerMicrophoneCameraGPSCompassGyroscopeWi-FiBluetoothProximityNFCLight

Page 8: Data Science in #mHealth
Page 9: Data Science in #mHealth
Page 10: Data Science in #mHealth
Page 11: Data Science in #mHealth

For the user, Emotion Sense is about psychological wellbeing, ref lection, momentary assessment, and contextual feedback.

Page 12: Data Science in #mHealth

What can we learn from the data?This talk: unsupervised Learning + viz, R + python

Page 13: Data Science in #mHealth

angry anxious lonely

relaxedenthusiasticcalm

@EmotionSense has multiple assessments for mood and life satisfaction

Page 14: Data Science in #mHealth

AccelerometerMicrophoneLocationWi-FiCall LogsSMS Logs

* all anonymised, pre-processed

Page 15: Data Science in #mHealth

Happiness Metric:Many moments of positive feelings, high satisfaction with life

Page 16: Data Science in #mHealth

Accelerometer Data

● 109,054,559 samples collected in f irst 12(ish) months of public deployment from 14,810 users

● What 'emergent' behaviours exist in this data? How does it characterise the users?

● How do these behaviours relate to external data we have collected from the same users (i.e., mood)?

Page 17: Data Science in #mHealth
Page 18: Data Science in #mHealth

Accelerometer Samples � Matrix

● Extract features from accelerometer samples● Each sample has 3 axes (x, y, z)● Each axis is a time series of data● Various features can be extracted:

– Statistical– Temporal– Signal

Page 19: Data Science in #mHealth

from sklearn.cluster import KMeans

c = KMeans(init='k-means++', n_clusters=4)

c.fit(data)

result = method.labels_

Page 20: Data Science in #mHealth

plot(X, Y, col=grey(.5), type="l", axes=F, xlab="Time of Day", ylab=ylab, main=title, ylim=c(0,1))

axis(1, labels=seq(from=0,to=24,by=1), at=seq(from=0,to=24,by=1))

axis(2)

box()

grid()

f <- rep(1/4, 4)

y_lag <- filter(Y, f, sides=2)

lines(X, y_lag, col="red", lwd=2)

Page 21: Data Science in #mHealth

Week day, k = 2

Visualising CentroidsExample (Non-f inal) Result

Week end, k = 2

Page 22: Data Science in #mHealth

Visualising by heat mapExample (Non-f inal) Result

Week day

Week end

Page 23: Data Science in #mHealth

Visualising by heat map (python)plt.figure()

fig, ax = plt.subplots()

ax.set_xticks(np.arange(data.shape[1])+0.5, minor=False)

ax.set_xticklabels([i for i in xrange(0, 24)], minor=False)

ax.xaxis.set_tick_params(width=0)

ax.xaxis.tick_bottom()

ax.set_yticks([])

ax.set_yticklabels([])

plt.xlabel('Time of Day')

plt.title(p_title)

plt.grid(False)

ax.pcolormesh(data, cmap=plt.cm.hot)

savefig(filename+'.pdf')

Page 24: Data Science in #mHealth
Page 25: Data Science in #mHealth

Conclusions● Tools

– Android, R, Python (multiprocessing), MongoDB– https://github.com/nlathia/research-util – https://github.com/xsenselabs

● What's haven't I talked about?– Supervised learning (“what are you doing now?”)– Other sensors

● Next Gen:– Levels of behaviour that were never possible to

observe before; scale without wearables– Potential to catch people “in the moment”– Time to redesign behavioural interventions?

Page 26: Data Science in #mHealth

Conclusions

Page 27: Data Science in #mHealth

Data Science in #mHealth

@neal_lathia@Cambridge_Uni@emotionsense