© 2022, Gazi Universitesi. All rights reserved.The ionosphere may play an essential role in the atmosphere and earth. Solar flares due to coronal mass ejection, seismic movements, and geomagnetic activity cause deviations in the ionosphere. The main parameter for investigating the structure of the ionosphere is Total Electron Content (TEC). TEC values obtained from GPS stations are a powerful technique for analyzing the ionospheric response to earthquakes and solar storms. This article analyzes the relations between earthquakes and TEC data to detect earthquakes. Our goal is to propose a prediction model to detect earthquakes in previous days. The ionospheric variability during moderate and severe earthquake events of varying strengths for 2012-2019 is discussed in this paper. The proposed models use LSTM-based (Long Short-Term Memory) deep learning models to classify earthquake days by analyzing TEC values of the last days. The LSTM-Based prediction models are compared against the SVM (Support Vector Machine), LDA (Linear Discriminant Analysis) classifier and Random Forest classifier to evaluate the proposed models based on earthquake prediction. The results reveal that the proposed models improve in detecting the earthquakes at an accuracy rate of about 0.82 and can be used as a successful tool for detecting earthquakes based on the previous days.