Short-term traffic flow prediction is an important basis of intelligent transportation systems. Its accuracy directly affects the performance of traffic control and induction. To improve prediction accuracy, in this paper, a traffic flow prediction model is proposed by combining hierarchical agglomerative clustering (HAC), standardized Euclidean distance (SED), and a long short-term memory network (LSTM). The proposed model is called the CHS-LSTM model. In this model, HAC is used to carry out cluster analysis on the original traffic flow data sample set of target detection sections. Based on the results of cluster analysis, traffic flow data are divided into several categories. For different categories of traffic flow, SED is used to calculate the spatial correlation of the road network where the target sections are located, and the K sections most relevant to the target detection sections are used in the construction of an input data matrix for LSTM. The prediction result with the minimum root-mean-square error is regarded as the final prediction result. The electronic toll collection data of Taiwan are used as the fundamental data in this paper to verify the performance and effectiveness of the CHS-LSTM model. The experimental results indicate that the CHS-LSTM model can effectively improve the prediction accuracy of LSTM. Moreover, compared with well-known models generally used for predicting the intensity of traffic flow, our proposed model also shows its superiority.