← Back to the chapter · Next detail →
Technical detail · Mobile Sensing: Features and Deployment
Compare sequences and reduce dimensions
Sequence and classifier choices should match the evidence boundary. Dynamic time warping (DTW) can compare motion-window shapes when timing varies. It aligns two time series with dynamic programming, nonlinearly stretching or compressing one motion against a reference motion, then accumulates the point-to-point Euclidean distances along the selected path. The useful DTW path should stay monotonic and continuous; its ordinary one-dimensional running time is O(n^2), while naive higher-dimensional versions become impractical because the search grows with the number of dimensions. In multi-sensor motion work, teams often calculate DTW per corresponding dimension, average the distances, and weight dimensions when some streams, such as gyroscope axes, carry more classification evidence than magnetometer axes.
Principal component analysis (PCA) or another dimensionality-reduction step can expose dominant feature directions before a compact model is trained. PCA projects a high-dimensional dataset onto new axes so that the first component explains the largest possible variance in the original data, and each subsequent component explains the next largest remaining variance while staying orthogonal to the earlier components. That ordering is why PCA can highlight pertinent motion structure, reduce noise, and lower the cost of downstream comparisons such as DTW. The projected components still need scaling, provenance, and deployment-time reproducibility. Common first-pass classifiers for this kind of sensor stream include Naive Bayes, k-nearest neighbours, decision trees, logistic regression, multilayer perceptrons, and SVMs; hidden Markov models or other sequence models become useful when the transition pattern between activities is part of the claim. The review record should name the feature set, scaling step, model family, sequence assumption, and validation split together so the result is not just a list of algorithms.