Transient stability prediction is essential for maintaining the reliability and integrity of power systems. In recent studies, deep learning models have been proposed and extensively utilized in predicting the transient stability for both off-line and online purposes with less emphasis on the quality of training datasets used in their methods. However, the use of machine learning-based classifiers to predict the transient stability of power systems necessitates carefully chosen datasets for training, since the prediction accuracy of the classifiers strongly depends on the quality and class distribution of these datasets. In most cases, the datasets generated for training the classifiers are unbalanced, because power systems are usually planned to be operating securely against most of the credible contingencies. Therefore, the imbalance between the stable and unstable instances generated for those operating conditions results in mispredictions of the unstable instances to a larger extent. In this study, the class balance of datasets generated for two test systems of different scales is investigated, and a novel method is proposed for improving the balance qualities of these datasets. The method is compared with the most commonly used approaches for data imbalance problems, including the adaptive synthetic sample generation approach (ADASYN), and the synthetic minority oversampling technique (SMOTE). It is shown that the stability prediction performance of the recurrent neural network-based classifiers, such as long short-term memory (LSTM), gated recurrent unit (GRU), and echo state network (ESN), are improved when they are trained using the proposed sampling method.