Weather forecasting is the scientific procedure of determining the state of the atmosphere considering both time frames and locations. This article devises a novel magnetic feedback artificial tree algorithm-based deep long-short-term memory (MFATA-based deep LSTM) classifier with time-series data. MFATA is the combination of the magnetic optimization algorithm MOA with the feedback artificial tree FAT algorithm for weather forecasting. Here, the feature selection is processed using a Moth Flame Optimization based Bat (MFO-Bat). Then, based on the clustered result, the forecasting process is accomplished using a deep LSTM classifier. Finally, the Taylor series model is used to generate the final forecast result. The proposed method achieved mean square error, root mean square error, mean absolute scaled error and symmetric mean absolute percentage error values of 4.12, 2.03, 0.602 and 56.376, respectively. The approach developed in this study has the potential to be used as an efficient and reliable weather forecasting method.