# A Predictive Model Using Long Short-Time Memory (LSTM) Technique for Power System Voltage Stability
## 3 Results and Discussion of Machine Learning and Deep Learning Algorithm  
The proposed scheme was experimentally implemented using the Python programming language in a Jupyter Notebook environment. The Microsoft Windows 11 operating system operates the LSTM on a personal computer (PC) with an Intel Core i7 processor at a frequency of 2.2 GHz. In addition, the PC has a memory capacity of 16 GB. The cross-correlation of all features present in the dataset was evaluated. The figures below show significant correlation between the characteristics. In machine learning, classification is a type of supervised learning. The aim is to predict the class labels of the test data using patterns obtained from the training data. There are several classification algorithms, including support vector machines (SVMs), Naive Bayes, K nearest neighbor (KNN), long short-term memory (LSTM), convolutional neural networks (CNNs), and TabNet. The algorithms can be evaluated using the accuracy metric, which quantifies the ratio of accurately classified instances to the total number of instances. The efficiency of these algorithms was measured in terms of their precision. The long short-term memory model (LSTM) has been trained and validated to anticipate the VS of the system, as shown in Figure 5.  
In this case, the graphic shows how accurate the LSTM classifier can be, with an amazing degree of 0.9995 (99.95%). Over time, clear patterns and connections emerged between the input factors and the target outcome, which explains the extraordinary result. The LSTM algorithm excels at integrating data from previous time steps to improve its predictive capabilities. Due to this feature, the model can capture long-term temporal correlations and make more accurate predictions. However, an accuracy of 0.9995 shows that the model may have just memorized the training data rather than properly applying its knowledge to unknown data, which is evidence of overfitting. The generalizability of a model can be established by testing it on data that were not used to create it. Overfitting-related problems can be remedied by experimenting with regularization strategies such as failure or weight loss. Figure 6 shows the loss curves of the LSTM model during both the training and validation on the VS dataset. The voltage stability dataset was analyzed using the proposed LSTM algorithm. Figure 7 displays the resulting confusion matrix and Figure 8 visually depicts the remarkable accuracy of the CNN algorithm of 0.9610 in predicting the variable VS.  
Figure 5: Accuracy in training and validation of long short-term memory. This study demonstrates the successful application of CNN models, typically used for image recognition and processing tasks, in tabular data classification. Given the circumstances, it is likely that the CNN model utilizes the fundamental spatial relationships in the  
Figure 8: CNN model training and validation accuracy for the IEEE 33-bus system was observed. Figure 6: Loss of long short-term memory training and validation. Figure 7: Confusion matrix of the LSTM algorithm for forecasting VS.  
input features. This enabled the development of the model to identify significant patterns and appearances, resulting in a significant improvement in accuracy. Non-linear activation functions, such as ReLU, introduce non-linearity to augment the capabilities of the model. Furthermore, the pooling of layers decreased the size of the output, thereby reducing the number of parameters and preventing overfitting. This study used a one-dimensional convolutional neural network (1 DCNN) to accurately forecast VS using a particular dataset. Figure 9 displays the loss curves for the CNN model. The results show that the system model performed admirably, with a total loss of the CNN model of 0.0962 and a training set accuracy of 0.9604. The model had a loss of 0.1078 and a precision of 0.9570 and performed well on the validation set. Figure 10 shows a visual description of the confusion matrix.