Time Series Classification Using HMM and GMM with Pomegranate Library
摘要
Time series classification plays a crucial role in various fields including finance, healthcare, and voice recognition, where accurate pattern recognition and temporal analysis are essential for decision-making and system automation. This study presents a comprehensive comparative analysis of Hidden Markov Model (HMM) and Gaussian Mixture Model (GMM) for time series classification using the Pomegranate library, a modern probabilistic modeling framework that offers enhanced computational efficiency and flexibility. We develop a systematic methodology for preprocessing, feature extraction, and model evaluation on the CBF (Cylinder-Bell-Funnel) dataset from the UCR Time Series Archive, a widely recognized benchmark for time series classification algorithms. Our preprocessing pipeline incorporates z-score normalization, outlier detection, and temporal smoothing, while feature extraction employs both statistical measures and temporal characteristics tailored to each model’s strengths. The experimental evaluation reveals that GMM achieves superior performance with 66.67% accuracy compared to HMM’s 53.12% accuracy, while requiring significantly less training time (12.7s vs 45.3s). Through detailed analysis of class-wise performance, computational complexity, and statistical significance testing, we demonstrate that GMM’s distribution-based approach is more effective than HMM’s sequential modeling for the CBF dataset. Our findings provide valuable insights into the effectiveness of probabilistic graphical models for time series classification tasks, offering practical guidelines for model selection based on data characteristics and application requirements. The study contributes to the growing body of knowledge in time series analysis by highlighting the trade-offs between sequential and distribution-based approaches in temporal pattern recognition.