### Classification of Electricity Consumption Feature  
The above characteristics can be normalized, and thus, the labels for each user based on different electricity consumption quarters and user clustering categories can be obtained, which can form the users' electricity consumption behavior dataset. The labels are shown in Table 7. Then, 15,000 new sample data from the measurement data that did not participate in the above cluster analysis were selected. After data preprocessing, multiple feature values were calculated. These formed a test dataset of the classification model. Since the classification performance of LSTM needs to be evaluated, the sampling period and users' type of the test sample in this case were known. The specific settings of the LSTM classification model were the following: the number of input channels was 1; the input dimension was 9; the output dimension was 6; and the numbers of neurons in the first and second hidden layers were 25 and 10, respectively. The neuron excitation function adopted a sigmoid function; the model learning rate was 0.001; and the execution environment was designated as the GPU. The gradient threshold was 1; the number of trainings per batch was set to 300; and the sequence length was specified as the longest. The accuracy of the classification model under different optimization algorithms and different hidden layer nodes is shown in Figure 9. It can be seen that Adam was superior to other algorithms. When the Adam algorithm was used to train the network, the learning step size of each iteration parameter had a certain range, and the large gradient did not cause an excessive learning step size. Therefore, the parameter update was more stable, and the convergence speed was faster. \begin{table}
\begin{tabular}{c c c c} \hline \hline
**User Type** & **Label** & **Quarter** & **Label** \\ \hline
1 & 001 & 1 & 001 \\
2 & 010 & 2 & 010 \\
3 & 100 & 3 & 100 \\
4 & 101 & 4 & 101 \\
5 & 111 & & \\ \hline \hline \end{tabular}
\end{table} 
Table 7: User-type label. Figure 9: Classification accuracy with different optimization functions. Based on the feature dataset, the users' electricity consumption behavior in SY city was classified. During the training process, the classification accuracy changed when the network selected different initial learning rates and different iteration times, as shown in Figure 10. When the initial learning rate was 0.001 and the number of iterations was 50, the corresponding training dataset accuracy rate curve and loss curve changed, as shown in Figure 11.  
Figure 11: Training set accuracy rate curve and loss function curve. Figure 10: Accuracy with different learning rates. Due to certain differences in input features, the classification accuracy in the early days of network training varied greatly. As the iteration continued, the loss curve gradually approached zero, and the model training was completed. LSTM can give the characteristic sequence a certain timing correlation, and has a good time dependence on the input electricity consumption characteristics of different quarters. The test data were input into the network, and the classification accuracy rate was 96.71%. In order to further evaluate the network performance, precision, recall, and F1-score were also introduced, and the evaluation values of some classification models, such as SVM, KNN, ELM, and BP, were compared. The comparison results are shown in Table 8.  
It can be concluded from the above analysis that the combination of LSTM and k-means clustering cannot only set cluster labels for complex and irregular original electricity consumption data, but also automatically classify new users' electricity consumption characteristics, which can carry out analysis of the users' electricity consumption behavior based on the existing massive electricity big data. After preliminary clustering analysis of electricity consumption data, the scattered electricity characteristics can be divided into typical categories, and labels can be set for each user.