1 Introduction

The prevalence of data-driven decision-making in the energy sector has enabled the service and industrial sectors to make informed strategic decisions [1]. As a result, modern manufacturing systems have undergone significant changes, driven by data-driven processes such as prediction. Accurate prediction of energy usage is necessary to ensure a reliable energy supply and enable end-users to optimize their business performance. Electric utility companies are responsible for generating, transmitting, and distributing power to meet demand and provide uninterrupted electricity supply. To achieve this goal, they need to make precise energy predictions that anticipate fluctuations in demand and adjust energy production and distribution accordingly. Precise energy prediction helps power providers reduce operating costs, maintain an economically efficient power system, and enhance social and economic benefits. Therefore, it is essential to make accurate energy usage estimates to improve the reliability and efficiency of the power supply system.

SC and ML techniques have been proven to be highly effective in solving complex problems in various domains, including energy prediction. The combination of SC and ML techniques can efficiently analyze large datasets and identify patterns, trends, and correlations, allowing for accurate energy predictions. Furthermore, the advanced algorithms used in SC and ML enable computers to learn and adapt to new data, making these techniques ideal for tackling challenges involving vast volumes of data and complex analysis. The computational structures and methods provided by SC and ML techniques can facilitate the optimization of energy systems, and result in improved efficiency, reduced costs, and enhanced performance. Using SC and ML approaches, energy providers and stakeholders can generate more precise and reliable energy forecasts, allowing for better decision-making [2].

Artificial Neural Networks (ANNs) are a powerful example of ML techniques. They consist of a network of linked nodes, or neurons, that perform complex computations and make predictions or classifications by using weighted connections between them. These nonlinear mapping structures are modeled after human neurons and have been effectively used to solve a wide range of problems across different fields. With their ability to learn and adapt from experience, ANNs are a popular tool for tasks such as image and speech recognition, natural language processing, and even financial forecasting [3]. Consequently, previous works have considered the implementation of ANN for electricity projection. For instance, Shukri et al. [4] predicted the electricity obtained from wind energy using an ANN-based model. Chen et al. [5] investigated the use of an ANN model to forecast the electricity demand of an office building by dividing the time horizon into occupancy rate-based segments. The study findings suggest that this approach can improve the accuracy of electricity demand forecasting. Kim et al. [6] evaluated the accuracy of two models - classical linear regression and ANN - for predicting power usage in a campus building based on occupancy rates and weather factors. The study findings provide insights into the strengths and weaknesses of each approach. In another work, Yuan et al. [7] used Japan as a case study to provide an ANN-based prediction model for seasonal hourly power usage across three sections of a university campus. Using Feed-forward ANN trained using Levenberg-Marquardt (LM) back-propagation techniques, the suggested model produced ideal results with Correlation coefficients between 0.95 and 0.99. However, one major drawback of ANN is that they can demand a lot of computing power and time, especially when training big and complicated models. To enhance modeling speed, fault tolerance, and addictiveness, Jang [8] developed the Adaptive Neuro-Fuzzy Inference System (ANFIS) in 1993. ANFIS has a competitive edge over ANN since it merges the strengths of both fuzzy logic and neural networks, enabling the modeling of complex systems with enhanced precision and accuracy, while also being capable of processing both numerical and linguistic data, making it ideal for diverse applications. The ANFIS however, may not always be precise due to the fact that its parameters need to be optimally designed to evade getting stuck at a local point and not reaching its optimal value [9]. Adequately optimizing the parameters of the ANFIS is a difficult task. Hence, the parameters of the ANFIS can be optimized utilizing by employing Evolutionary-based predictive soft computing (EPSC) methods. The fusion of ANFIS and SC techniques is often referred to as hybrid modelling.

Several hybrid models can be found in the literature. For instance, using the Indian electricity market as a case study, Yodav et al. [10] developed a hybrid model for Solar photovoltaic (PV) power. ANFIS was integrated with a genetic algorithm (GA) and evaluated against several models. The suggested GA-based ANFIS, according to the authors, provided the best accurate forecasts. Luo and Oyedele[11] predicted the electricity usage of educational buildings using the combination of the Long short-term memory (LSTM) neural network model and GA. Based on their results, the LSTM-based GA performed better than the LSTM models using grid search, Bayesian optimization, and particle swarm optimization (PSO). Didem[12] worked on the determination of industrial energy demand in Turkey using multiple linear regression (MLR), ANFIS, and PSO-ANFIS. According to their findings, when compared to MLR and ANFIS models, the PSO-ANFIS model delivered greater prediction accuracy with the least amount of estimate error. Emerging Harris Hawks Optimization (HHO) and PSO algorithms were combined with SVR for load demand forecasting and optimal sizing of stand-alone hybrid renewable energy systems in [13, 14]. ANFIS was combined with PSO algorithms by Nou et al. [15] to model the geometric properties of the scour hole of ski-jump spillways. A comparison of simulation results revealed that the proposed model outperformed other methods under some prominent error calculation indices. Souhe et al. [16] presented a hybrid model for predicting electrical consumption based on support vector regression (SVR), Firefly Algorithm (FA), and ANFIS. ANN was combined with the PSO algorithm in forecasting the energy consumption for a multi-campus university in [1]. Their work employed a dataset division of 70% and 30% for training and testing, respectively. The results of their work showed that the ANFIS-based PSO delivered optimal results compared with the standalone ANFIS model.

2 Research gap and motivation

Although previous studies have used hybrid models to predict energy consumption, they have not fully accounted for the impact of hyperparameter tuning and the optimal selection of some key parameters of the hybrid model. It is important to note that these vital parameters are predetermined for the optimal performance of the model. To address these issues, the present study utilizes a state-of-the-art algorithm, namely the genetic algorithm (GA) [17], to optimize the ANFIS structure. The advantage of this proposed approach lies in the fusion of ANN relational structures and learning skills, the intrinsic dynamic qualities of fuzzy logic in decision-making, which are contained in ANFIS, and the parameter-tuning capabilities of evolutionary algorithms, such as GA. Furthermore, meticulous consideration is given to the impact of the core parameter of GA on the accuracy of the proposed hybrid model. The effectiveness of GA is primarily influenced by crossover, followed by mutation rate, population size, re-randomization points, and elite selection, as stated by previous studies [18, 19]. Although some studies have utilized the GA hybrid models, they have overlooked the importance of these key parameters. Considering this, our study investigates the impact of the crossover rate parameter on the proposed hybrid model.

In terms of the clustering approach, the FCM is chosen for the proposed model. FCM is a well-known clustering approach for automatically organizing a broad range of information and obtaining reliable categorization. FCM is preferred over other clustering algorithms because of its fast-processing time and its benefit of allowing items to be part of several groups rather than just one [20]. In addition, the FCM is resilient to ambiguity and has the ability to retain significantly more data than any other hard clustering method [21]. Nevertheless, the number of clusters used for the FCM-clustered neuro-fuzzy model can have diverse effects on the performance, computational complexity, and interpretability of the model. Increasing the number of clusters may lead to overfitting, while having too few clusters can result in underfitting. Therefore, it is important to choose an appropriate number of clusters based on the specific application and the characteristics of the data to ensure optimal performance of the model. Hence, we carried out a variety of experiments in which the number of clusters was varied in order to ascertain the optimum quantity that is appropriate for the GA–ANFIS–FCM model that was proposed.

The main contributions of the study are as follows:

  1. (a)

    The development of a hybrid model which consists of fuzzy c-means clustered adaptive neuro-fuzzy inference system and genetic algorithm (GA), for electricity prediction using weather information, and historical electric loads.

  2. (b)

    Compare overall prediction performances of standalone ANFIS–FCM and GA–ANFIS–FCM, as well as examine the impact of the number of clusters on the developed models under renowned performance evaluation metrics.

  3. (c)

    Investigate the robustness of the optimal model in (b) by comparing it with other GA–ANFIS–FCM sub-models which involved varying the crossover percentage of the GA.

  4. (d)

    Compare the proposed model with other hybrid models.

The rest of the paper is organized as follows: In Sect. 3, we present the data collection and processing. Section 4 contains the methodology. In Sect. 5, we present the results and discussion. Then, we conclude and present future work in Sect. 6.

3 Data collection

Lagos, one of the most populated cities in Africa, is situated in the southwest of Nigeria. It is well-known for being the biggest city in Nigeria and the primary regional center for air, land, and sea transport. It is located on latitude 6° 27′ 55.5192″ N and longitude 3° 24′ 23.2128″ E, respectively. The high-density metropolitan region is made up of 16 of the 20 local government areas (LGA) in the region. The state has two distinct climatic periods: the wet season, which lasts from April to October, and the dry season, which lasts from November to March. This study utilizes electricity consumption data from 10 districts in Lagos during the wet season to develop the model.

The experiment utilizes a real dataset of electricity consumption for ten districts, acquired from the Eko Electricity Distribution Company (EKEDC), for the wet months of 2020, which encompass May to October 2020. Figure 1 shows a varying electricity consumption pattern for the wet months. The data consist of 31 records per month for each wet month, except for May and September, which have a different number of records consisting of 30 days each. The climatic information, including maximum temperature, minimum temperature, humidity, wind speed, and dew, was acquired from the Visual Crossing Weather Data stations in accordance with the study area. Electricity consumption is the output of the model, measured in MWh. The statistical properties of the input and output data are presented in Table 1. The total amount of data collected was split into three categories for the model’s development: training (70%), testing (15%), and validation (15%).

Fig. 1
figure 1

Daily consumption of the study area during the season

Table 1 Statistical properties of the input and output data

4 Methods

4.1 Adaptive neuro-fuzzy inference system (ANFIS)

In 1993, Jang [8] introduced the Adaptive Neuro-Fuzzy Inference System (ANFIS). This unique composite model employs both neural network and fuzzy logic characteristics in its structure, which complement each other. In other words, ANFIS is an adaptive hybrid multi-layer feedforward network that leverages the dual learning capabilities of ANN and FIS to emulate the process by which humans arrive at intelligent decisions [22]. The Takagi-Sugeno fuzzy system, which forms the basis for the ANFIS modelling approach can be divided into two categories: antecedents and consequences. The ANFIS conceptual framework consists of five levels, namely the fuzzy, product, normalization, defuzzification, and summation layers, arranged in ascending order from layer 1 to layer 5. It consists of a learning approach that optimizes model parameters via methods such as back-propagation gradient descent and least squares techniques. As illustrated in Fig. 2, the basic ANFIS model comprises five layers, each of which employs fuzzy IF-THEN rules to create a nonlinear map linking the input and output. In the first layer, two inputs are received, x and y, and each node’s output is determined by the generalized Gaussian membership function (µ). These stages are presented as Eqs. (1)–(3) below [8]:

$$ {\text{O}}_{{{\text{1i}}}} = \upmu _{{A_{i} }} \left( x \right),\quad i = {\text{1,2}}, $$
(1)
$${\text{O}_\text{1i}} = {\upmu }_{{\text{B}}_{i-2}}\left(y\right)\quad i = 3,4,$$
(2)
$$\upmu \left(\text{x}\right) = \text{e}^{-{\left(\frac{{\text{x} - \uprho }_\text{i}}{{\upalpha }_{i}}\right)}^{2},}$$
(3)

\(\text{A}_\text{i}\) and \({\text{B}}_\text{i}\) represent the membership values; \(\upmu\) represents the Gaussian MF; \({\upmu }_{\text{A}_\text{i}}\) and \({\upmu }_{\text{B}_\text{i}}\) represents the membership degree; \({\uprho }_\text{{i}}\) and \({\upalpha }_\text{i}\) represent the premise parameter set.

During the subsequent phase of ANFIS, the output of each node in the second layer, also known as the firing strength of a rule, is determined by using Eq. (4) [8]:

$$ {\text{O}}_{{{\text{2i}}}} = \upmu _{{\text{A}_\text{i} }} \left( {\text{x}} \right) \times \upmu _{{\text{B}_{{\text{i} - 2}} }} \left( {\text{y}} \right) $$
(4)

Equation (5), which is also known as the normalized firing strength, describes the output of the third layer node as follows [8]:

$$ {\text{O}}_{{{\text{3i}}}} = \bar{w}_{i} = \frac{{\omega _{i} }}{{\sum\nolimits_{{\left( {i - 1} \right)}}^{2} {\omega _{1}^{'} } }} $$
(5)

where \(\overline{{w}_{i}}\) is the normalized firing strength from the third layer.

The adaptive node located in the fourth layer receives the output \({\text{O}}_{3i}\) from the third layer and proceeds to calculate its own output in the following manner [8]:

$$ {\text{O}}_{{{\text{4i}}}} = \bar{w}_{i} f_{i} = \bar{w}_{i} \left( {p_{i} x + q_{i} y + r_{i} } \right) $$
(6)

where \({p}_{i}\), \({q}_{i}\) and \({r}_{i}\) is the consequent parameters of the node \(i\). The last layer of the ANFIS model consists of a single node, and the output of this layer is computed as follows [8]:

$${O}_{5} = \sum _{i}\overline{{w}_{i}}{f}_{i}$$
(7)
Fig. 2
figure 2

ANFIS model architecture

4.2 Fuzzy c-means (FCM) clustering technique

By employing FCM for clustering, data points can belong to multiple clusters with different degrees of membership, rather than being rigidly assigned to a single cluster. FCM functions by iteratively partitioning data into clusters according to their similarity to one another. The degree of membership of each object to each cluster is represented by a fuzzy membership value ranging from 0 to 1. The procedure begins by randomly setting the centers of the clusters and then iteratively adjusting them depending on the objects’ relative membership in each cluster. A complete clustering solution is reached after all object membership values have stabilized. The capacity of FCM to deal with overlapping and ambiguous data has led to its widespread use in a variety of domains, including pattern identification, picture segmentation, data mining etc. In addition, its unsupervised data processing and model creation make it useful in image analysis, medical diagnosis, astronomy, chemistry, and agricultural engineering [23]. Using FCM for ANFIS has several advantages. Firstly, FCM can help determine the initial parameters for the ANFIS model. The clustering process of FCM can assign initial membership degrees and centroid values to the fuzzy sets in the ANFIS model, resulting in improved accuracy and speed of the learning process. Moreover, FCM’s ability to clarify the connection between input and output variables may enhance the interpretability of the ANFIS model. By dividing the input space into fuzzy areas, FCM simplifies the identification of input variables that are most relevant to the model’s predicted output. The expression given in Eq. (8)[24] is used to determine the ideal distance center to each datum for every fuzzy group n and vector \({x}_{i}\), where\(i\)= 1, 2 …\(n\).

$$ E = \sum\limits_{{i - 1}}^{N} {\sum\limits_{{k = 0}}^{n} {U_{{ij}}^{m} \left\| {x_{i} - c_{j}^{2} } \right\|} } $$
(8)

where \(m\) represents the weighting exponent in the range of \(\left(1\le m\le \infty \right)\), the degree of membership is denoted by \({U}_{ij}^{m}\)\(\in\) (0, 1), the data point is represented as \({x}_{i}\), the centroid of clusters is depicted as \({c}_{j}\), and the number of clusters is denoted as \(C\). The \({U}_{ij}\) of the data point in the \(j\) cluster at any iteration is given as [24]:

$$ \text{U}_{\text{ij}} = \left( {\sum _{{k = 1}}^{C} \left( {\frac{{\left\| {\text{x}_\text{i} - \text{c}_\text{j} } \right\|}}{{\left\| {\text{x}_\text{i} - \text{c}_\text{j} } \right\|}}} \right)^{{\frac{2}{{m - 1}}}} } \right)^{{ - 1}} $$
(9)

4.3 Genetic algorithm-ANFIS

Holland [17] is credited with the invention of the first genetic algorithm (GA). It is a well-known evolutionary algorithm that simulates how nature works by selecting the strongest individuals to survive in accordance with Darwinism. The GA optimization technique is one of the most renowned EA-based state-of-the-art algorithms that has been extensively researched and shown to be very successful in a variety of industrial applications. A substantial amount of interest in the method may also be attributed to the fact that GA, which is a search-based algorithm, has the ability to address optimization challenges that arise in machine ML. The search for the best possible solution is carried out in three stages—population initialization, GA operators, and evaluations—using probabilistic transition rules rather than deterministic ones in GA optimization approaches [25]. Selection, crossover, and mutation are three operators used by the GA to offer an optimal solution with a reduced local minimum convergence. The fact that error function derivatives are unneeded is a key advantage of the GA approaches, making them suitable for continuous and discrete optimization problems. The optimization of the Sugeno-based FIS membership function may be improved upon using GA in conjunction with ANFIS, which results in an increase in prediction accuracy and a reduction in error rates [26]. Figure 3 describes the flowchart for the hybrid GA–ANFIS. The parameter settings for the proposed GA–ANFIS are presented in Table 1. The first step is initialization and the generation of the initial population. Fitness evaluation of each population member and selection of a membership pair from the population string for breeding come next. In addition to that, a ranking of the individuals in the population based on their level of fitness is carried out. The next step is to give each pair a place in the passing population. This process is continued until all the slots for the temporary population have been filled. In the next stage, individuals of the outgoing population and a subset of the current population are integrated into the existing population to form the new whole. Using the population’s ideal value, the ANFIS parameters are adjusted and terminate GA–ANFIS. This process keeps on till the predetermined endpoint is reached. Otherwise, the process returns to the assignment and determination of the fitness of each member of the population.

Fig. 3
figure 3

GA–ANFIS model

4.4 Performance evaluation

Performance metrics may be used to evaluate the model’s predictions’ precision and accuracy. By contrasting the model’s output with the actual data, it is possible to assess how effectively the ANFIS model can represent the underlying connections between the inputs and outputs. Moreover, the comparison of many models to see which one performs better in terms of accuracy and precision is made possible by the use of statistical performance indicators. This is thought to be vital for choosing the optimum model to be utilized in real-world applications, where precise predictions are thought to be critical. Therefore, this study employ some common performance indicators such as mean absolute percentage error (MAPE), mean absolute error (MAE), coefficient of root mean square (CVRMSE), and root mean square error (RMSE). Their descriptions are as follows:

$$MAPE = \frac{1}{N}\sum _{\varvec{k}=1}^{\varvec{N}}\frac{\left|{y}_{k}-{\widehat{y}}_{k}\right|}{{y}_{k}} \times 100\text{\%} $$
(10)
$$MAE=\frac{1}{N}{\sum }_{k=1}^{N}\left|{y}_{k}-{\widehat{y}}_{k}\right| $$
(11)
$$RMSE=\sqrt{\frac{1}{{N}_{s}}\sum _{i=1}^{{N}_{s}}{\left({y}_{k}-{\widehat{y}}_{k}\right)}^{2}}$$
(12)
$$CVRMSE= \frac{100}{\stackrel{-}{Y}}\sqrt{\frac{\sum _{k=1}^{N}{\left({y}_{k}-{\widehat{y}}_{k}\right)}^{2}}{N}} $$
(13)

where \({y}_{k}\) and\({\widehat{y}}_{k}\) are the actual and predicted values; \(k\) is the sample index; \(\stackrel{-}{Y}\) is the average of the actual values.

5 Results and discussion

In this section, we present and discuss the summary of the experimental and statistical findings. The models were implemented on a Microsoft Windows 10 operating system, utilizing an Intel (R) CPU @3.20 GHz and 16 GB of RAM. The performance of the model was statistically evaluated based on the 30% hold-out data. As mentioned, the cluster of choice in this work has been the FCM clustering technique due to its outstanding performance in previous works. To start with, different cluster sizes were used to conduct several trials for each model. The purpose of these trials is to assess the accuracy of the models for varying cluster sizes and to determine the cluster size that would produce the most optimal results. Multiple sub-models utilizing a different cluster size are developed as a result of the trials. The performance of these sub-models are then thoroughly evaluated using the same framework to compare their accuracy. The sub-model with the highest accuracy is identified, and the optimal number of clusters for each model is selected through this evaluation process. The bold fonts in Tables 38 indicate the best results. Table 2 shows the parameters of the proposed models.

Table 2 Parameter settings of the proposed models

The performance of the standalone ANFIS model was examined by varying the number of clusters in the model. The ANFIS model was evaluated using five sub-models, which were trained and tested with different numbers of clusters. The number of clusters determines how the input data is partitioned, and this affects the model’s ability to capture patterns in the data. As a result of this investigation, five sub-models were developed, and their performance was evaluated. The results are presented in Table 3. From the table, it was found that ANFIS-FCM1, which used 2 clusters, was the best model during the testing phase. The statistical measures MAPE, MAE, CVRMSE, and RMSE yielded values of 8.2698, 754.4429, 10.5766, and 1.0147e + 03, respectively. The accuracy of the best model was 91.7% (MAPE = 8.2698), which suggests a good match between the observed and expected electricity use. As observed in Table 3, the model’s accuracy decreased as the number of clusters increased from 3 to 4. This shows that using more clusters in the ANFIS model did not necessarily lead to better accuracy, and a smaller number of clusters may produce better results. Figure 4 shows the graphical representation of both observed and expected electricity consumption, along with their corresponding error plots.

Fig. 4
figure 4

ANFIS-FCM1 optimal sub-model

Table 3 Results of the ANFIS-FCM submodels

The performance of the GA-tuned ANFIS is presented in Table 4. With respect to the testing phase, the best sub-model was exhibited by GA–ANFIS–FCM3 which made use of 4 clusters by having the optimal values of the MAPE (7.6345), CVRMSE (9.4913), and RMSE (918.6518). The MAPE value of 7.6345 signifies a prediction accuracy of 92.4%. This suggests that the observed energy use and the expected energy consumption are reasonably comparable to one another. That said, GA–ANFIS–FCM4 with 5 clusters had a better MAE value. Still, GA–ANFIS–FCM4 provided the best general best performance. Figure 5 illustrates the observed and forecasted power usage test plot. It shows that actual and expected power use have a similar pattern. The model prediction result shows some under and over-predictions, reflected by marginal variations in chosen test samples. The model’s sensitivity and reactivity to severe and unexpected climatic conditions on the subsequent days may explain these mispredictions.

Fig. 5
figure 5

GA–ANFIS–FCM3 optimal sub-model

Table 4 results of the GA–ANFIS–FCM submodels

Table 5 shows the comparison between the two optimal sub-models. Regarding the testing phase, the performance of GA–ANFIS–FCM3 outscored that of the standalone ANFIS–FCM1 in the four statistical metrics. This further reiterated the advantage of hybrid models over standalone prediction models as stated in previous studies.

Table 5 comparison between the best models

Because of the capabilities of the GA, the GA–ANFIS was able to perform much better than the standalone ANFIS. The capacity of the GA to pick optimum parameters for the ANFIS is a critical factor in determining the optimal performance of the GA–ANIFIS model. So far, this work has reiterated the findings of [28], as reported in [18] that, “GAs can find good solutions within a large, ill-defined search space, and can be readily adapted to a wide variety of search problems.” However, selecting the appropriate control parameters for a GA in order to get the results that are desired has been a problem for a very long time. Previous studies that were presented in [18, 19] indicated that the most important factor that influences the efficacy of GA is the crossover, followed by mutation rate and population size, then re-randomization points, and finally elite selection. Hence, it may be essential to conduct multiple experiments to determine the optimal number of clusters for a given model. Consequently, this work further examined the impact of different crossover rates on the proposed GA–ANFIS model. The crossover percentage (\({P}_{c}\)) was varied at the range 0.2–0.6. The ideal number of clustered items, which was determined to be 2, as well as the clustering technique (FCM), will be carried over into this session.

Table 6 comparison between GA–ANFIS–FCM models using different crossover rate values

As seen in Table 6, the GA–ANFIS–FCM-\({P}_{C3}\) maintained the best performing model as recorded in previous session. It can be inferred from the result that it may not always be the case with GA–ANFIS–FCM that increasing the mutation percentage improves performance. As a result, it may be necessary to carry out multiple experiments in order to determine the mutation percentage that is best suited for a specific model.

To reveal the competence and reliability of the optimal model (GA–ANFIS–FCM-\({P}_{C4}\)), as indicated in Table 6, a comparative analysis was conducted with other hybrid models developed using well-known algorithms, including differential evolution (DE) [29], particle swarm optimization (PSO) [30], pathfinder algorithm (PFA) [31], biogeography-based optimization (BBO) [32], and teaching learning based optimization (TLBO) [33]. Some of these algorithms have been utilized in previous works. For instance in PSO was used to optimize the ANN in [34, 35] for predicting municipal solid waste generation and prioritizing water distribution pipelines rehabilitation. Similarly, the TLBO was applied to optimize the NN for water supply pipe condition prediction in [36]. However, this present study considered using the aforementioned algorithm for optimizing the ANFIS structure for energy prediction. The hybrid algorithms are compared with the optimal model reported in Table 6. The purpose of this comparison was to gauge the accuracy and efficiency of the model in comparison to others. Table 7 shows the parameters of the algorithms used in the comparative study.

Table 7 Parameters settings for the algorithms

As demonstrated in Table 8, the superiority of the optimal model was maintained by achieving the highest prediction accuracy of 92.4%, surpassing all other models, including PFA–ANFIS (82.8%), TLBO–ANFIS (84.5%), BBO–ANFIS (85.8%), DE–ANFIS (85.1%), and PSO–ANFIS (91.7%). Furthermore, similar trends in terms of Mean MAE, CVRMSE, and RMSE were observed in the optimal model’s performance, validating that the selected parameter is most suited for energy prediction. In addition, the capability of the GA in fine-tuning the optimal parameters of the ANFIS structure was exhibited, resulting in a more robust and accurate optimal model. Overall, the results provide evidence that GA–ANFIS–FCM-\({P}_{C4}\) is the most reliable and efficient model for energy prediction.

Table 8 further comparison between optimal models and other algorithms

Previous studies have established the criticality of meteorological parameters on electricity consumption. For instance, using data from high-resolution smart meters, Kang et al. [37] investigated the correlations between meteorological factors and home power use. In another study, Yas and Eman [38] worked on the monitoring of the effect meteorological parameters on electrical energy generation by solar cells. Meteorological parameters, particularly temperature, have a direct impact on electricity consumption as they affect the usage of air conditioning, heating, fans, and potentially lead to outages. However, while other factors such as population density, economic growth, and technological advancements also influence electricity consumption, the impact of meteorological parameters is highly essential as considered in this study. To enhance the predictive accuracy of electric consumption, the scope of the developed hybrid model can be broadened by incorporating additional factors. This expansion allows for more extensive research into predicting electric consumption.

6 Conclusion

Energy forecasting is a crucial task for efficient energy management and planning in modern power systems. Accurate energy forecasting can help optimize energy usage, reduce costs, and improve energy efficiency. In recent years, ML has emerged as a powerful tool for energy forecasting, particularly in combination with MAs. Consequently, this study compared the performance of a hybrid model (GA–ANFIS–FCM) and a standalone ANFIS–FCM model for predicting electricity consumption, using Lagos districts, Nigeria, as a case study. The minimum and maximum temperatures, humidity, wind speed, and average dew were the inputs for this study, while the output was the electricity consumption. Furthermore, 70% of the data set was employed to train the model, with the remaining 30% used to verify its accuracy and competence. The FCM clustering method was employed in both models with varying numbers of clusters. The proposed GA–ANFIS–FCM3 delivered the best model with the smallest values of the MAPE, MAE, CVRMSE, and RMSE. The strength of the proposed model is found in its combination of the competence of ANN’s relational structures and learning abilities with those of fuzzy logic’s inherent dynamic properties in decision-making as found in ANFIS, and the ability to tune parameters provided by evolutionary algorithms. The GA–ANFIS–FCM3 (with 4 clusters) model that was utilized in this research produced commendable results, which portrayed it as a valuable tool that the power industry in Nigeria may use to make choices and prepare for matters linked to electricity consumption. In addition, the robustness of the optimal model was investigated by carrying out a number of tests in which the core parameter of the GA was subjected to a range of different values (mutation percentage). The GA–ANFIS–FCM3 maintained its top-notch performance throughout the evaluation. The following are some major inferences drawn from this study:

  • The study under consideration suggests that by utilizing the genetic algorithm (GA) for optimizing the Adaptive Neuro-Fuzzy Inference System (ANFIS) structure, one can accurately forecast electricity consumption. Moreover, the study also investigates the impact of the number of clusters on the hybrid model by using the fuzzy c-means (FCM) technique.

  • Furthermore, the research findings indicate that the choice of GA parameter significantly affects the performance of the model. Therefore, it is crucial to carefully select appropriate parameters for optimal performance. The study highlights the significance of the proposed GA–ANFIS–FCM model and compares it with other hybrid models. The results show that the GA–ANFIS–FCM model outperforms the other models, thereby reaffirming its competence in electricity consumption prediction.

  • Overall, the study provides valuable insights into the effectiveness of the GA–ANFIS–FCM hybrid model in predicting electricity consumption, demonstrating the importance of proper parameter selection and cluster analysis in model optimization. These findings can have significant implications for enhancing energy management systems and promoting energy efficiency.

The current study focused solely on the FCM clustering technique. Future research should explore the effects of other well-known clustering techniques on the hybrid approach. Moreover, the study utilized a medium-term forecast based on the data collected. However, for a more robust model, future research should consider increasing the experimental data and input variables. Although the number of datasets used in this study is comparable to that of other researchers, incorporating more data would result in more accurate outcomes.

In addition, future studies could investigate recent computational algorithms like the Osprey Optimization Algorithm (OOA), Energy Valley Optimizer (EVO), Growth Optimizer (GO), Gannet optimization algorithm (GOA), and Fire Hawk Optimizer (FHO). Furthermore, the impact of other key parameters such as mutation rate and population size of the GA in the hybrid GA–ANFIS–FCM approach could also be explored.