PurposeThe study uses machine learning techniques to cluster regional retail egg prices after 2000 in China. Furthermore, it combines machine learning results with econometric models to study determinants of cluster affiliation. Eggs are an inexpensiv, nutritious and sustainable animal food. Contextually, China is the largest country in the world in terms of both egg production and consumption. Regional clustering can help governments to imporve the precision of price policies and help producers make better investment decisions. The results are purely driven by data.Design/methodology/approachThe study introduces dynamic time warping (DTW) algorithm which takes into account time series properties to analyze provincial egg prices in China. The results are compared with several other algorithms, such as TADPole. DTW is superior, though it is computationally expensive. After the clustering, a multinomial logit model is run to study the determinants of cluster affiliation.FindingsThe study identified three clusters. The first cluster including 12 provinces and the second cluster including 2 provinces are the main egg production provinces and their neighboring provinces in China. The third cluster is mainly egg importing regions. Clusters 1 and 2 have higher price volatility. The authors confirm that due to transaction costs, the importing areas may have less price volatility.Practical implicationsThe machine learning techniques could help governments make more precise policies and help producers make better investment decisions.Originality/valueThis is the first paper to use machine learning techniques to cluster food prices. It also combines machine learning and econometric models to better study price dynamics.