Determinants of Renewable Energy Production in Egypt New Approach: Machine Learning Algorithms

The production of renewable energy has become one of the important elements in the pursuit of sustainable and environmentally friendly economic development, and countries of the world are increasingly adopting renewable energy sources to reduce the carbon footprint and mitigate the effects of climate change. As a result, the goal of this paper is to use different machine learning methods (Random Forest, Gradient Boosting, Support Vector Machine, Naïve Bayes and K-nearest neighbors) to establish which of these algorithms is the most accurate in predicting the values of Egypt’s renewable energy production on the one hand, and recognizing the main determinants of this renewable energy production on the other. The paper proved that the Gradient Boosting model is the most accurate machine learning method. It also showed that the main determinant of Egypt’s renewable energy production is Governance indicators (60%), then GDP per capita growth by (13%) and Population growth by (10%). As for the rest of the other variables, such as the price of oil, CO 2 emissions, Renewable energy technical innovation, Renewable energy adaptation and Energy imports they have no effect. This paper recommends expanding the use of machine learning methods in macroeconomic models.


INTRODUCTION
In its history of 4.5 billion years, the earth has witnessed dramatic changes, some of which were called the ice age, while others were in a rise in temperatures and the emergence of the tropics.The following figure shows some of these changes in some of these time periods (Barriopedro et al., 2011).
There is no doubt that the climate changes shown in the Figure 1, because of their enormous effects on all developing and developed economies, are of interest to decision-makers in order to try to take decisions that mitigate the effects of these changes on the one hand and work to adapt and confront them on the other hand.One way to adapt to it is to rely on renewable energy sources (Mostafa, 2021;Mostafa and Selmey, 2022;Alhendawya et al., 2023).
Energy represents the backbone of the contemporary economies.It can be said that modern civilization owes its current level of development to the evolution of various energy sources.Scientists usually define energy as the ability to do work.Our modern civilization is possible because we have learned how to transform energy from one form to another and how to use it to do work.
In fact there are many forms of energy such as heat, light, motion, electrical, chemical, etc. and these energy forms can be transformed from one type to another.For example, the stored chemical energy in natural gas or the kinetic energy of water flows This Journal is licensed under a Creative Commons Attribution 4.0 International License can be transformed to electrical energy, which can be transformed to light and heat (EIA, 2022).
From the different forms of energy sources our modern civilization has depended heavily on the fossil fuels, that is coal, oil, and natural gas.Although fossil fuels generate huge amounts of energy, they have two major disadvantages; the first is that they pollute environment and the second is that they are nonrenewable energy sources.These two disadvantages have forced the world to seek other clean and renewable sustainable energy sources.A great effort has been made since the nineties of the last century to produce and use more clean energy.Despite these global efforts, most countries still depend heavily on fossil fuels.The available data confirms that fossil fuels constituted 82.7% from the world energy supply in 1990, 77.9% in 2010, and 79.2% in 2021, while the renewable energy share has increased slightly from 8.5% in 1990 to 11% in 2010 then to 12.5% in 2021 (EIA, 2022).
For Egypt, like other countries, the share of renewable energy still limited.The renewable energy generated in Egypt was about 10% compared with 90% energy generated from fossil fuels in 2020 (EIA, 2022).
Although Egypt can develop more of renewable energy resources considering its solar potential and high wind speeds, the renewable energy share still low in Egypt, and lower than the world average, why?Answering this question is the main purpose of this article, in which we will investigate the different determinants of renewable energy production in Egypt.Doing that we may realize the different obstacles for developing more renewable energy in Egypt, which may enable us to predict potential renewable energy production in the future.
In contrast to many traditional economic forecasting models, machine learning models mainly deal with pure prediction (Varian, 2014).Machine learning algorithms, which may generate predictions without previous assumptions or expectations, are more flexible than traditional economic models.As a consequence of technological improvements, machine learning models are now widely employed in a variety of fields.Indeed, (Plakandaras et al.,2015) shown in the context of forecasting US housing values, machine learning algorithms outperform traditional econometric models.Furthermore, machine learning models have been shown to make accurate predictions when applied to very low-frequency data sets (Medeiros et al., 2021;Yoon, 2021).
Machine learning methods for predicting future econometric trends and econometric data have received a lot of attention in the research community.So, Machine learning methods have been used in a number of studies.(Biau and D'Elia, 2010) used a random forest model to forecast euro area GDP data and found that the machine learning model was more accurate than a traditional autoregressive model (Jung et al., 2018).Using machine learning models to forecast real GDP growth in the United States, the United Kingdom, Germany, Spain, Mexico, the Philippines, and Vietnam.(Tifn, 2016) forecasted Lebanon's GDP growth using learning machine models such as forest models.(Emsia and Coskuner, 2016) utilised support vector regression to estimate Turkey's GDP growth.(Lin, 2022) used empirical mode decomposition to improve deep learning for forecasting US GDP data.(Longo et al., 2022) also propose a supervised learning method for forecasting future US GDP growth.With a Generalized Autoregressive Score, we combine a Recurrent Neural Network (RNN) and a Dynamic Factor model that accounts for time-variation in the mean (DFM-GAS).
This paper is distinguished by comparing the performance of machine learning models on renewable energy production predictions in Egypt, which has not been applied before.Also, this study differs from others in that it uses machine learning methods that have not been used before in other economic studies such as Support Vector Machine, Naïve Bayes and K-nearest neighbors.
As a result, the goal of this paper was to determine which learning machine algorithm is the most accurate and apply it to our output.Furthermore, the main determinants of Egypt's renewable energy production will be recognized.For this purpose, this study has been divided into Three sections as follows: Section 1: Introduction.Section 2: Literature Review, Section 3: Methodology and models.Section (4): Empirical results and last section is the conclusion.

LITERATURE REVIEW
The major renewable energy sources are wind, solar, aerothermal, geothermal, hydropower, hydrothermal and ocean energy, biomass, landfill gas, and biogases.The growth of renewable energy production depends on various factors; Many different studies have indicated that the key factors determining the production of renewable energy may include production costs, economic growth, population growth, political instability, electricity generation from oil, gas, and coal, hydroelectric power generation, and energy imports.
Initially, renewable energy production costs were very high, so it required significant subsidies in order to compete with fossil fuels.But due to increasing research and development and more focus on sustainability considerations, renewable energy costs have significantly decreased in the last decade (Dhabi, 2020).
Most studies agree that economic growth is one of the essential determinants of renewable energy production and consumption  (Da Silva et al., 2018).A recent study concluded that renewable energy sources, based on wind, water, and sunlight (abbreviated as WWS; not including biomass), could provide all new energy globally by 2030, and replace all current non-renewable energy sources by 2050 (Delucchi and Jacobson, 2012).Reducing reliance on energy imports reduces the impact of fossil fuel energy prices.
In other words, it strengthens countries against external shocks and constraints imposed on the economy due to the limitations of fossil fuel reserves (Da Silva et al., 2018).Marques and Fuinhas (2011) founded negative effects for fossil fuel and nuclear contribution to electricity generation and positive effects of energy imports.Investment in the renewable energy sector is very sensitive to the country's institutions' quality (Becker and Fischer, 2013).Theoretically, weak institutions have various harmful impacts on energy-sector policies, in particular, the electricity sector.Accordingly, (Gutermuth,2000) considers that the legal and institutional framework is of great importance in the transition to clean energies.The findings reveal that political stability is a key determining factor of renewable energy production.
Based on previous studies, the determinants of renewable energy production can be identified in general as follows:

GDP Per Capita Growth
The production of renewable energy has become one of the important elements in the pursuit of sustainable and environmentally friendly economic development, and the countries of the world are increasingly adopting renewable energy sources to reduce the carbon footprint and mitigate the effects of climate change.The state to invest in and expand renewable energy infrastructure (Sadorsky, 2009).
In light of the growth of the per capita GDP growth associated with the comprehensive economic development of any country, this leads to an increase in the demand for energy, and given that countries may witness economic growth and prosperity, accompanied by an increase in industrial activities, urbanization and an improvement in living standards, thus the demand for electricity escalates.and energy-intensive commodities.Fossil fuels have been the primary source of energy to meet this growing demand due to their relatively low cost and well-established infrastructure.(Lin et al., 2016;Salim and Rafiq, 2012;Marques et al., 2010) In addition, we find that with the global focus shifting towards sustainable development and mitigating the effects of climate change, many countries of the world have adopted renewable energy sources to replace or complement fossil fuels, due to the many advantages provided by renewable energy, such as reducing greenhouse gas emissions.Thermal, energy security, and long-term cost savings.However, the transition to renewables requires significant investments in infrastructure and research and development, which is why per capita GDP growth is critical.This is supported by (Elmassah, 2021), which found a long-term relationship between renewable energy and GDP.Similarly, (Abanda et al., 2012) showed a positive relationship between GDP and renewable energy production in African countries.(Yazdi and Shakouri, 2017) found a long-term relationship between per capita GDP growth and renewable energy production per capita in Iran.In the same way, (Ankrah and Lin, 2020;De Silva et al., 2018) indicated that economic development (per capita gross domestic product) and increased energy use help in developing renewable energy production.
The role of per capita GDP growth in the production of renewable energy is shown by: • The ability to invest: The high per capita GDP allows the state to allocate a larger part of its budget to renewable energy projects.These investments can be used to establish renewable energy stations, support clean energy technologies, and create favorable policies and incentives for the adoption of renewable energy.(Jamasb and Pollitt, 2008;Nehoff, 2005) • Research and Development: Economic growth enables countries to fund research and development initiatives aimed at improving the efficiency and affordability of renewable energy technologies.This promotes innovation and facilitates the integration of renewable energy into traditional energy systems.For more information, see (Vaona, 2012;Yildirim et al., 2012).• Infrastructure development: Increasing GDP growth rates facilitates the development of the necessary infrastructure for renewable energy production, including building wind farms, solar parks, hydroelectric power plants, and investing in smart grids to efficiently manage and distribute renewable energy (Mitrova and Melnikov, 2019;Wong and ElMassah, 2018).

Population Growth
The world population continues to increase rapidly, and this leads to an ever-increasing demand for energy consumption.
Given that traditional fossil fuels contribute to environmental degradation and climate change, the transition to renewable energy sources becomes inevitable and necessary.Because population growth greatly affects the energy situation, affecting both energy demand and the availability of resources to invest in renewable energy production.This is supported by studies such as (Mac Domhnaill and Rayan, 2018;Akar, 2016;Seetharaman et al., 2019;Elmassah, 2021) concluded that there is A positive and significant effect of population growth on the production and consumption of renewable energy.Because population growth is directly related to an increase in energy consumption, so with the increase in the population in a country or aregion, the demand for electricity and energy-intensive goods and services increases, and the high population density in urban areas in particular leads to the concentration of energy needs, this increasing demand if Fulfilled only by traditional fossil fuels, it exacerbates greenhouse gas emissions and accelerates climate change.
In contrast (De Silva et al., 2018) showed that population growth impedes the development and production of renewable energy.
Population growth can affect renewable energy production through a number of channels, including: • Investment Opportunities: Rapid population growth presents countries with economic opportunities and challenges, and the presence of a larger workforce and expanding markets may lead to increased investments in renewable energy projects, as governments realize the potential for economic growth through the production of sustainable energy (Lin et al., 2016).• Access to energy and equity: Population growth often occurs alongside urbanization and rural development.Expanding access to electricity and energy services in these areas becomes a priority to improve living standards.Renewable energy can play an important role in providing clean and affordable energy to disadvantaged populations (Bourcet, 2020).• Political will: According to (Vona and Patriarca, 2011) Growing populations are more likely to demand sustainable and environmentally friendly policies from their governments.
With increasing awareness of climate change and environmental issues, the political will to invest in renewable energy production may increase accordingly.• Technological developments: According to (Polzin et al., 2015;Mengova, 2019) study Rising energy demand, driven by population growth, promotes technological progress in renewable energy production, and governments and industries are more inclined to invest in research and development to enhance the efficiency and scalability of renewable technologies.

CO 2 Emissions
The rise in global carbon dioxide (CO 2 ) emissions due to burning fossil fuels has become an urgent concern for climate change and environmental degradation, and while the world is searching for sustainable energy solutions, renewable energy sources play an important role in mitigating carbon dioxide emissions, and the level of carbon dioxide emissions is working As an important determinant in shaping the adoption and production of renewable energy technologies.Many previous studies have concluded that carbon dioxide emissions have a positive and significant impact on the production of renewable energy, such as the study (Aguirre and Ibikunle, 2014;Omri and Nguyen, 2014;Popp et al., 2011).
Fossil fuels such as coal, oil and natural gas have been primary energy sources for a long time, and their combustion releases large amounts of carbon dioxide into the atmosphere, and these emissions are a major driver of climate change, which leads to a rise in global temperatures and the presence of some weather phenomena.extremes, and other environmental challenges.
According to (Mac Domhnaill and Rayan, 2018) carbon dioxide emissions from fossil fuels represent unpriced externalities, which makes renewable energy relatively uncompetitive, due to the fact that the early stages of deploying a new technology to generate renewable energy in a country are Renewable energy is usually more expensive compared to conventional fossil fuels.
Although results on the impact of coal, oil and natural gas prices on renewable energy production have been mixed in relevant studies, such as those (Lin et al., 2016;Salim and Rafiq, 2012).However, this may be due to the fact that the models used in the studies may not be well prepared to achieve a stable effect on prices, as these effects tend to be over a longer period of time than is allowed in the models.(Aguirre and Ibikunle, 2014).
Also, renewable energy sources generated from solar energy, wind energy, hydropower, geothermal energy, and biomass provide a sustainable and low-carbon alternative to fossil fuels, which is the conclusion of the Marques et al., (2010) study, which believes that the production of renewable energy provides countries with an opportunity to develop energy supplies Domestic appliances thus increase energy security, because they emit little or no carbon dioxide during their operation, reducing their overall greenhouse gas footprint.Transitioning to renewable energy is also essential to achieving climate change goals and meeting international commitments such as the 2016 Paris Agreement.
In this context, we find that public awareness is required in order to promote and develop awareness of environmental risks.This is the conclusion of a study (Van Ruijven and Van Vuuren, 2009), which found that in the absence of a climate policy, the preferred alternative energy source for natural gas in the electricity sector is coal, which produces large amounts of carbon dioxide.
Carbon dioxide emissions affect renewable energy production through several factors, including: emissions intensifies, financial institutions and investors may be more inclined to support renewable energy projects due to the potential for carbon offsets and environmental benefits (Popp et al., 2011).• In the end, although previous studies differed on the results of including carbon dioxide emissions on the production of renewable energy, they ultimately find that it has a negative and positive impact, and that it replaces environmental concerns, even if its results are not yet clear.And because that reflects the fact that in many countries there is an almost zero sum game between fossil fuel production and renewable energy production in the energy mix.

Governance Indicators
Effective governance is a factor that has a significant impact on the country's ability to shift towards renewable energy production, as governance promotes a favorable policy and regulatory environment, encourages investments, and ensures the successful implementation of renewable energy projects.Governance refers to the way a country is run and the systems in place to make and implement decisions, and includes factors such as transparency, rule of law, regulatory quality, political stability, and government effectiveness.These governance indicators directly affect the form of renewable energy in the country (Saba and Biyase, 2022).
With governance indicators playing a pivotal role in shaping the policy and regulatory environment for renewable energy development, countries are likely to develop clear policies, longterm strategies, and supportive frameworks that attract investments in renewable energy (Saba and Ngepah, 2022).
Effective governance instills confidence in investors and stakeholders, which leads to increased investments in the renewable energy sector.This is due to investors' preference for stable political environments and clear regulatory frameworks, as they reduce the uncertainty and risks associated with long-term renewable energy projects (Apergis and Pinar, 2021).
Also, inclusive decision-making processes include the participation of local communities in project planning and development, leading to greater public acceptance and support for renewable energy initiatives.

Oil Price
The oil price greatly affects the global energy scene and plays a major role in determining the attractiveness and competitiveness of renewable energy sources.Oil prices fluctuate due to geopolitical events, supply and demand dynamics, and global economic conditions.As oil prices rise or fall, they affect the feasibility of renewable energy production and the adoption of clean energy alternatives.
Also, the volatility of oil prices affects the cost of generating electricity from fossil fuels, especially in oil-dependent regions.
When oil prices rise, the cost of producing electricity from fossil fuels also increases, making renewable energy sources more economically competitive.We find that the higher share of fossil fuels in the energy supply prevents the development of renewable energy (Aguirre and Ibikunle, 2014).This reflects the negative correlation between the share of fossil fuels and the share of renewable energy, as the increase in the share of renewable energy must reduce the share of other energy sources.And that the effect of fossil fuels, which measures the accumulated share of coal, oil and natural gas in electricity production on the share of renewable energy, is significantly significant and negative among countries.
Where we find that renewable energy technologies, such as solar energy, wind energy and hydropower, have relatively stable operating costs compared to fossil fuels.In areas where oil prices are high, renewables often become more cost-effective for generating electricity, which encourages increased investment and production.Fluctuations in oil prices affect investment decisions in the energy sector.High oil prices can motivate governments and investors to allocate resources to renewable energy projects as a way to reduce dependence on expensive fossil fuels.This is supported by (Reboredo, 2015) which concluded that high oil prices led to the development of the renewable energy sector, which would lead to an increase in energy production.
Although there are other studies that found a negative impact of high oil prices on the production of renewable energy, such as (Omri and Nguyen, 2014), fluctuations in oil prices can lead to changes in energy policy.Governments need to implement or strengthen policies that promote the adoption of renewable energy with the aim of enhancing energy security and reducing dependence on volatile oil markets.
The relationship between oil prices and renewable energy production is interdependent through market competition, and as oil prices rise, renewable energy becomes more competitive, which leads to increased investments in renewable infrastructure (Vona et al., 2012).
As a future outlook, future oil price trends will continue to influence the development of renewable energy, and as the world moves to a more sustainable energy future, the stability of renewable energy costs makes it an important option compared to fossil fuels.

Energy Imports
Energy imports, which are mostly based on fossil fuels, have always been an important factor in shaping the overall energy profile of a country.However, according to (Huang et al., 2007) dependence on energy imports may lead to economic weakness in many times and the presence of geopolitical tensions as well as environmental concerns.In this sense, renewable energy sources may provide a viable solution to reduce dependence on energy imports and the associated disadvantages.It is generally accepted that energy imports are inversely related to the capacity of conventional energy sources, and thus have negative repercussions on industrial choices and strategies that can be pursued in relation to renewable energy production (Kahia et al., 2017).
Although there is a consensus on the existence of a negative correlation between energy imports and renewable energy production, as indicated by (Marques et al., 2010), this relationship is not consistently proven in practice.(Mengova, 2019) concluded that the theoretical assumption that the more a country relies on energy imports, the higher the level of investment in renewable energy sources necessary to ensure energy security in that country, has been confirmed in practice, and all alternative traditional sources of electricity production in every Statistically significant country and has a negative sign in the specifications of each model.This indicates that traditional sources were alternatives to renewable energy sources in the production of electricity.
Energy imports affect renewable energy production through two channels, including: • Economic Incentives: Countries facing high energy import costs are more incentivized to invest in renewable energy technology.A shift to renewable energy can help stabilize energy prices, reduce the trade deficit, and boost domestic economic growth through investments in the renewable energy sector.Marques and Fuinhas (2012) has indicated that incentives or subsidies (including tariffs) and policy processes that define strategies and articulate specific programs are catalysts for renewable energy production.Policies that take into account market conditions and technological development are needed.To increase investment, these policies must include economic incentives for new and emerging technologies (Georgatzi et al., 2020;Ouyang et al., 2019).• Energy security: Reducing dependence on energy imports through the production of renewable energy enhances energy security in the country.By utilizing domestic renewable resources, countries can mitigate risks associated with geopolitical tensions or supply disruptions from energyexporting countries.Because from an energy security perspective, renewable energy production can be motivated by the desire to diversify energy sources in order to reduce risks to national security (Augutis, 2014).

Renewable Energy Technical Innovation
Technological innovation in the field of renewable energy plays a pivotal role in driving the growth and expansion of renewable energy production.Technological developments in various renewable energy sources have greatly improved efficiency, reduced costs, and increased the feasibility of integrating renewable energy into existing energy systems.The results of (Shi, 2014) study showed that research and development activities are positively related to the production of renewable energy, because research and development activities reduce the cost of technology through innovations, and the existence of a market-based national policy tool increases the share of renewable energy in energy production.In the same context, (Vural, 2021) came to prove that technological innovation has a positive and significant impact on the production of renewable energy per capita.
In addition, innovative research and development has led to significant improvements in the efficiency of renewable energy technology.For example, modern solar panels can convert sunlight into electricity more efficiently, while advances in wind turbine design have increased energy capture and generation capacity.
Technological innovation has played an important role in reducing the costs associated with producing renewable energy.Economies of scale, improved manufacturing processes and new materials have reduced cost, making renewable energy more economically viable than fossil fuels in many areas (Downing and White 1986).
There are other studies that see the opposite, such as (Marques and Fuinhas, 2012), which analyzed the relationship between energy sources and economic growth, and showed that the result of deploying renewable energy to replace energy generation using natural resources from local sources has an impact on income, as the main costs associated with subsidizing Renewable energy production puts an excessive burden on the economy, due to high electricity tariffs.
Also, although renewable energy technological innovation has focused on energy storage solutions and grid integration, such as batteries and pumped hydraulic storage, which addresses the intermittent nature of renewables and enhances grid stability and reliability.However, (Marques and Fuinhas, 2012) also showed that non-renewable energy sources constrain motivation towards renewable energy, and the development and growth of renewable energy can be prevented by interest groups, including trade unions associated with the fossil and nuclear energy sectors, which can increase the percentage fossil and nuclear energy.The ease with which fossil resources can be stored may justify a delay in renewable energy production.

METHODOLOGY AND MODELS
This paper used Random forest, (SVM), logistic regression, naive Bayes (KNN), and gradient boosting models.All models have monitored machine learning models, which means that they analyze data using training data and then create a data prediction function.
I depend on the six models to determine their accuracy and depend on the accuracy model for renewable energy production prediction and extract the main determinants of renewable energy production value.
The World Bank database, Unictad database and reports of Ministry of electricity will be used as a source of data.The data used will cover the period from 2013/2014 to 2021/2022.The machine learning algorithms utilized in this study were written in Python language using the Scikit-Learn package.

Random Forest
A random forest is made up of numerous different decision trees.Instead of a serial number, we employ a classificationstyle decision tree to predict a binary outcome variable.At each decision point, these two types of decision trees divide the data into two groups similarly.A yes or no decision is made at each node.Is x >5, for example, yes or no?The data is then partitioned based on the answer.The data is then partitioned again, this time with the addition of more explanatory variables.The first explanatory variable chosen is the one that can account for the greatest significant data separation.The model's prediction for that smaller bucket is the mean value of the separated bucket of data.
When a decision tree contains too many partitions, overfitting can occur, resulting in the model performing poorly in out-of-sample predictions since it was trained too closely to the in-sample data.A limit on the number of variables and decision nodes is advisable when out-of-sample prediction is a substantial problem (Rajkumar, 2017).
The random forest methodology aims to avoid overfitting without pruning the tree or restricting the number of divisions permitted By creating several trees for multiple.To reduce the variation of the forecast, the outcomes of the trees are averaged.Additionally, The random forest selects a variable from a random subsample of the variables to partition the data at each node.As a result, the same variables are not available at each tree's nodes.
In most cases, overfitting the in-sample data isn't a problem (Tiffin, 2016).The following Equation is the basic random forest model (Tiffin, 2016): where γ indicates the expected value, and y i indicates to the observed value

Support Vector Machine (SVM)
An independent and identically distributed data set for the training (iid) is found in classification applications using a distinct machinery learning approach.This discriminating function can anticipate new occurrence labels reliably.A data point x is inserted into an algorithm for discriminating categorization.In contrast to generative techniques to machine learning, including computations of probability distributions, it assigns it to one of the numerous classes in classification tasks.Discriminatory methods that are less successful and are often employed when outlines are essential need fewer resources, particularly in multidimensional fields.When just later chances are necessary, to discover a multidimensional surface equation that best differentiates many classes.Contrary to evolutionary algorithms or perceptrons frequently used in machine learning classification, SVM always offers the same optimum space value as the convex optimization issues are analytically solved.The initialization and termination requirements for perceptrons are quite substantial (Awad and Khanna, 2015).
Vapnik proposed the SVM regression model as a non-parametric technique (1995).The SVM linear function looks like this: W indicates to weight vector, x is the input or feature vector, and b denotes the bias, intending to keep the function as flat as feasible, i.e., a small WW.Minimizing the usual, i.e., w2, is one technique to do this (Richardson et al., 2018).Defined the function as a convex optimization problem (Richardson et al., 2018;): In another way, LSSVM is a machine learning method presented by Suykens and Vandewalle (1999) that turns quadratic programming into linear equations by using equality constraints instead of inequality constraints.y , where ω T is the weight, ϕ (x) is the nonlinear function, mapping input into a highdimensional feature space, and is the bias.For a given training set , in which x i is the input, y i is the output corresponding to x it and/is the size of the training set, LSSVM is defined as follows (Zhu et al., 2022): where ω ∈ Rn, error ei ∈ R, regularization γ > 0. Introducing the Lagrange multiplier, we can obtain (Zhu et al., 2022): where α i is the Lagrange multiplier.According to Karush-Kuhn-Tucker conditions, we get the following (Zhu et al., 2022): Through elimination, the linear equations are obtained (Zhu et al., 2022): and/is a first-order unit matrix.Ω is a nonnegative definite matrix of /×l, which meets the Mercer condition that  1 2  is a kernel function.After obtaining and , the LSSVM predictor is defined as follows (Zhu et al., 2022):

Logistic Regression
Logistic regression is a mathematical technique that can be used to describe the relationship between a set of independent variables and a binary dependent variable.Logistic regression models are a special case of generalized linear models, as these models are sometimes called logit models, and they are used to predict the existence of a particular trait or property based on the values of a variable or a group of other independent variables that are related to the dependent variable just as in the case in General regression models.In addition, it posits that the return to explanatory variables decreases as the likelihoods approach zero or one.This rise in the separate variable will lead to an enormous output change when the output is close to one-half than when it is closer to zero or one end (Sperandei, 2014;Rajkumar,2017).
The model is created when we use the logit transformation when the probability of a particular event is a linear function in a set of ρ independent variables, and the logistic regression function is in the following simple form: That is, where Y i follows the Bernoulli distribution, the form of the function is as follows: Using the logistic function of probability π i we get the corresponding logistic regression model as follows: In x

Naïve Bayes
Reverend Thomas Bayes, a British scientist, invented the Naive Bayes classifier, using probability and statistical approaches.In many complex real-world circumstances, Naive Bayes works far better than one may assume.Because Naive Bayes' simplicity allows all attributes to contribute equally towards ultimate choice, it is a standard model in machine learning applications.Due to its simplicity which corresponds to computational efficiency, the Naive Bayes approach is attractive and appropriate for different areas.The three major parts of the Naive Bayes Classification are prior, posterior, and class conditional probability.(Nugraha,2019).
The formula for the Bayes Theorem is given by: X refers to Unknown class information, refers to hypothesis (X) as a specific class, P(Φ|X) refers to The probability of the (Φ) hypothesis refers to (X), P(X|Φ) refer to Probability (X) in the hypothesis(Φ), P(Φ) refer to Probability of the hypothesis (Φ), and P(X) refers to Probability (X).
To know the theorem Naive Bayes, it is essential to recognize that the classification process uses several indications to identify the sample-based class (Nugraha,2019).This transformed the theorem of Bayes into: The Φ variable represents class, or variable X1 … Xn indicates the features of the required instructions for the classification process.

K-nearest Neighbors
The closest neighbor is one of the most often utilized algorithms in master study research (kNN).KNN is based on the labeling of k examples closest to the data, given that the label of an instance matches its kNN instances.It may also be described as an individual case.In terms of prediction accuracy, the basic principle is that kNN is a simple to create, obvious technique.kNN does not make any data distribution assumptions.As incremental learning is a learning approach based on instances that do not require any training before generating predictions, these advantages make it easy to apply.KNN is usually used in classification and regression supervised learning tasks (Kang, 2021).

Gradient Boosting (Gb Model)
Gradient enhancement is a way of producing an advanced preview from a range of models of low quality.In most situations, these approaches start with applying a loss function to an initial model in the target variable.A new model will be shown after the loss function is applied to the residues of the prior models.This process goes on to a certain extent (Richardson et al., 2018).At a high level, we're iterating through the stages below (Richardson et al., 2018): In Fm(x), when the new mapping x shows the target, Fm−1(x) specifies the preceding model.The term ∆ m (x) signifies the low learner, and ν represents the reduction parameter.

EMPIRICAL RESULTS
In this section, we present the main results of our study and determine the accuracy model.
From Table 1, it is clear that the Gradient Boosting model is the most accurate with a percentage of 100%, followed by support vector machine and random forest with a percentage of 0.962%, and finally Logistic Regression, Naïve Bayes, and K-nearest neighbors with a percentage 0.930%.Despite all of the model's  In October 2016, lands of about 7,600 km 2 were allocated in several regions for the New and Renewable Energy Authority to be used in renewable energy projects, by Republican Decree No. 116 of 2016 for wind and solar energy projects.About 75% of these areas have been allocated to wind energy projects, and the rest (5%) to photovoltaic projects (Habib, 2022).
In addition, Investment Law No. 72 of 2017 and its implementing regulations issued pursuant to Prime Minister's Resolution No. 2310 of 2017 provided incentives and tax cuts for renewable investment.The incentives are divided into three categories: reduced customs duties, discounts according to project costs, tax deductions, and value-added tax exemptions.Also, according to the Prime Minister's Resolution No. 183 of 2019, he announced the feed-in tariff for electric power produced from biomass projects, and the feed-in tariff for electric power generated from technology that uses municipal solid waste and biogas from landfills is higher than the tariff imposed on sewage plants.The contract extends over 25 years (Habib, 2022).
In the end, we find that the value of the RMSE test indicates the quality of the model, as its value is about 0.0006 It is known that the low of this value indicates that the actual value is close to the estimated value, as it is calculated based on the following equation 2 1 where yˆt is the real data (verification); y t is the prediction data.

CONCLUSION
Energy is the mainstay in the development of many sectors, and one of the measures of the progress and well-being of people and societies, but the global environmental systems are deteriorating as a result of the increased consumption of the main resources of energy, and the increase in gas emissions resulting from this consumption, which raises concerns about the unavailability of these resources in the future, so Its consumption must be reduced to reduce these emissions, and to reduce global warming.
With the population increase in Egypt, the consumption of these resources will increase, and the demand for energy and related services to meet basic human needs will increase, and then gas emissions will increase, which poses great challenges to maintaining a stable and permanent supply of energy, and in light of the crisis that the global economy is going through starting from In 2020, as a result of the spread of Covid-19, the trend must be made towards a more environmentally friendly economy, which is the green economy, by exploiting clean energy sources that reduce pollution and preserve the climate, and the share of future generations of these resources.From here, the importance of this research emerged in that it talks about the production of renewable energy in Egypt.
The findings of this study demonstrated that using machine learning to macroeconomic forecasting has a high predictive  ).We also concurred that gradient boosting is a more accurate model for predicting Egypt renewable energy production than other algorithms.We also confirmed the most important independent variables that were utilised to explain the dependent variable are Governance indicators (60%), then GDP per capita growth by (13%) and Population growth by (10%).As for the rest of the other variables, such as the price of oil, CO 2 emissions, Renewable energy technical innovation, Renewable energy adaptation and Energy imports they have no effect, as their effect as a whole does not exceed 1%.
Figure 1: Climate changes to intercept, β 1 and indicates the effect of explanatory variables (C, I, G, (X-M) on the dependent variable (G.D.P).

Table 1 : Machine Learning algorithms performance (data from 2010 to 2022)
Source: python results by author.

Table 2 : Gradient boosting prediction for actual renewable energy production
Source: Python results by author accuracy being very excellent, I will depend on gradient boosting for renewable energy production prediction as shown in Table2.Based on Table2, we find that the predicted values using gradient boosting are almost identical to the actual values of the Egyptian renewable energy production, indicating the accuracy and high quality of the forecast.Table3shows that that the most important independent variables used to explain the dependent variable.SOThe table shows that the most important determinants of renewable energy production in Egypt are Governance indicators (60%), then GDP per capita growth by (13%) and Population growth by (10%).As for the rest of the other variables, such as the price of oil, CO 2 emissions, Renewable energy technical innovation, Renewable energy adaptation and Energy imports they have no effect, as their effect as a whole does not exceed 1%.There is no doubt that the decisions that were issued successively since 2014 until now, which led to an increase in the production of renewable energy, supported that the government and the laws issued are the main of the production of renewable energy in Egypt.2014 was a remarkable year for renewable energy in Egypt.In January, a new constitution was approved after a referendu.Article 32 of the constitution stipulates the following: The state shall work to make optimal use of renewable energy sources, stimulate investment in them, and encourage scientific research related to them.The state encourages the manufacture of raw materials and increases their added value according to economic feasibility(ARE,  2014).Republican Decree No. 135 of 2014 aimed at amending Law No. 102 of 1986 regarding the establishment of the New and Renewable Energy Authority.The new decree added provisions that allow it to: (1) carry out projects for the production and use of new and renewable energy.(2) the operation and maintenance of the stations of the projects set forth in the preceding clause and all works related to these purposes; Whether by itself or jointly with others.(3) Establishing a joint stock company on its own or with other partners after the approval of the Minister of Electricity and Renewable Energy (NREA, 2022).In December 2014, Renewable Energy Law No. 203 of 2014 was issued, with the aim of creating a supportive environment to attract investment. in renewable energy.

Table 3 : Feature importances indicators
By nowcasting Egypt renewable energy production values, we evaluate the performance of machine learning algorithms, including Random forest, support vector machine(SVM), logistic regression, nave Bayes, and k-nearest neighbours (KNN Source: Python results by author value.