Wind power is one of the sustainable ways to generate renewable energy. In recent years, some countries have set renewables to meet future energy needs, with the primary goal of reducing emissions and promoting sustainable growth, primarily the use of wind and solar power. To achieve the prediction of wind power generation, several deep and machine learning models are constructed in this article as base models. These regression models are Deep neural network (DNN), k-nearest neighbor (KNN) regressor, long short-term memory (LSTM), averaging model, random forest (RF) regressor, bagging regressor, and gradient boosting (GB) regressor. In addition, data cleaning and data preprocessing were performed to the data. The dataset used in this study includes 4 features and 50530 instances. To accurately predict the wind power values, we propose in this paper a new optimization technique based on stochastic fractal search and particle swarm optimization (SFS-PSO) to optimize the parameters of LSTM network. Five evaluation criteria were utilized to estimate the efficiency of the regression models, namely, mean absolute error (MAE), Nash Sutcliffe Efficiency (NSE), mean square error (MSE), coefficient of determination (R 2 ), root mean squared error (RMSE). The experimental results illustrated that the proposed optimization of LSTM using SFS-PSO model achieved the best results with R 2 equals 99.99% in predicting the wind power values.