Analyzing Optimal Battery Sizing in Microgrids Based on the Feature Selection and Machine Learning Approaches

: Microgrids are becoming popular nowadays because they provide clean, efﬁcient, and low-cost energy. Microgrids require bulk storage capacity to use the stored energy in times of emergency or peak loads. Since microgrids are the future of renewable energy, the energy storage technology employed should be optimized to provide power balancing. Batteries play a variety of essential roles in daily life. They are used at peak hours and during a time of emergency. There are different types of batteries i.e., lithium-ion batteries, lead-acid batteries, etc. Optimal battery sizing of microgrids is a challenging problem that limits modern technologies such as electric vehicles, etc. Therefore, it is imperative to assess the optimal size of a battery for a particular system or microgrid according to its requirements. The optimal size of a battery can be assessed based on the different battery features such as battery life, battery throughput, battery autonomy, etc. In this work, the mixed-integer linear programming (MILP) based newly generated dataset is studied for computing the optimal size of the battery for microgrids in terms of the battery autonomy. In the considered dataset, each instance is composed of 40 attributes of the battery. Furthermore, the Support Vector Regression (SVR) model is used to predict the battery autonomy. The capability of input features to predict the battery autonomy is of importance for the SVR model. Therefore, in this work, the relevant features are selected utilizing the feature selection algorithms. The performance of six best-performing feature selection algorithms is analyzed and compared. The experimental results show that the feature selection algorithms improve the performance of the proposed methodology. The Ranker Search algorithm with SVR attains the highest performance with a Spearman’s rank-ordered correlation constant of 0.9756, linear correlation constant of 0.9452, Kendall correlation constant of 0.8488, and root mean squared error of 0.0525.


Introduction 1.Background
Microgrids refer to a generation-mix of two or more micro-power sources feeding a local load.They can operate in both grid-connected and isolated modes.In both modes, instant balancing power is certainly required from additional sources like Batteries.In grid-connected mode, while the utility grid supplies the load in sharing with micro-power sources, and it also provides the charging power to the batteries, which could later be used for power balancing during isolated mode.The majority here points out how much the actual size of batteries should be to run the complete microgrid sustainably.In this context, the optimal battery sizing is a worthy problem to work on [1].
The conventional energy systems such as fossil fuels being used are causing environmental pollution and depletion of fossil fuels.Due to the increase in demand for electricity, there is a need for a new energy distribution systems such as batteries.Microgrids can supply load and provide backup when the main supply is insufficient with improved power quality.The different modes of operating in a microgrid use energy storage systems to meet the intermittent nature of load demand.
Battery sizing directly deals with the frame of total cost in a microgrid.The goal is to minimize the size of the battery and regulate the constraints such as voltage, reliability, and frequency to maintain the performance of the microgrid with a much smaller battery bank.For developing an energy storage system in a microgrid, the high cost of batteries is another key limiting factor [2]. Battery sizing should be considered to make the energy storage system economical and affordable to any consumer.Since the role of batteries in daily life is growing, importance is given to develop highly efficient and cost-effective storage devices.Optimal battery sizing would require taking non-invasive measurements of the battery in real time and analyzing the results [3].
Many techniques that aim to assess the optimal size of a battery have been proposed in the literature.Most of these techniques are heuristic-based.In [4], a multiobjective particle swarm optimization algorithm has been used to optimize the battery size using the lifetime of the battery bank parameter, but this method does not follow a data-driven based approach.A bi-level optimization problem based on the Karush-Kuhn-Tucker is proposed in [5] for optimal battery sizing using binary particle swarm optimization.This method is also not based on data-driven techniques.In [6], a multiple-cost function modeling is performed to optimize the power flow in the non-interconnected zone in Columbia.The flexibility of the proposed method is performed using three network topologies.In [7], a multiobjective slap swarm optimization algorithm is used to optimize the integration of hybrid renewable energy sources in a microgrid.

Research Problem Statement
The customer's primary issue with installing batteries is the high cost, where batteries produced by LG Cam, Tesla, and Trojan are the most well-known battery manufacturers, and they have prices ranging between $148 to $158 per kWh.Batteries are more expensive in comparison to distributed generation market demand models (DGENs), but they have a faster response time when it comes to balancing.This offers a scenario for optimal battery sizing in microgrids, where renewable energy (RE) penetration is higher than in traditional grids.As a result, in most cases, a compromised joint venture of batteries and DGENs is used.Although machine learning-based techniques have been proposed earlier yet, to the best of the authors' knowledge, no suitable datasets are available for studying the problem of battery sizing in microgrids.Moreover, there is still room for improvement in the performance of the machine learning based techniques, used to predict the optimal battery size.Furthermore, the selection of relevant features for the prediction of optimal battery size is imperative for optimal prediction of battery size.The proposed methodology uses a new MILP based generated dataset which is suitable for studying the problem of battery sizing in microgrids.The robust feature selection algorithms are employed for mining the most relevant features, from the considered dataset.Onward, the selected feature sets are processed with the SVR model for predicting the optimal battery size.

Related Works
Many studies have previously been investigated related to optimal battery sizing in microgrids.Some of them have utilized the concept of MILP-based optimization techniques.In addition, most researchers have introduced the concept of heuristic techniques for the same problem.Certain researchers have been seen to involve the data-driven approach in battery sizing.The detailed literature survey is as follows: The Techno-Economic Method for the optimization of the annual demand forecast and the use of HOMER Pro allowed the researchers to analyze the advantages of renewable systems as compared to conventional grid application [8].The drawback of this work is that it does not include future data and is only valid for one-year data of the plant at a rural site.The pattern search technique for the optimization of the RE hybrid system is done with the MATLAB Simulink Design Optimization with the help following algorithms Latin Hypercube, GA, and Nelder-Mead.It was observed with the help of HOMER Pro software that, following the Nelder-Mead Algorithm, decreases the optimal penetration of DG.The energy consumption and the demand with time are not analyzed in detail.The long-term demand forecasting and the habits of consumption are not analyzed.
The sizing and allocation of the BESS storage system in a microgrid help in regulating the parameters of a microgrid.The PSCAD Grid Modelling Software is proposed by Jagdesh Kumar in his research, where he used the software efficiently to predict the sizing constraints of BESS in isolated Renewable Plants [9].The sizing characteristics of the battery bank were also analyzed with the help of simulations in MATLAB.The drawback of this work is that the battery aging phenomenon which can be considered along with designing strategies of BESS for future research is not considered.Hannan proposed methods and algorithms based on the filter-based battery sizing method, the Discrete Fourier transformbased ESS sizing method, and the Multiperiod decision-making model for optimum sizing.Grey Wolf's optimization algorithm and swarm optimization technique helped in achieving optimization and sizing BESS.The model predictive control algorithm is also considered by Hannan to address and explore the optimum sizing of BESS [10].The work proposes battery sizing for the efficient and cost-effective functionality of microgrids.El-Bidari proposed the Grey Wolf optimizer approach for optimal battery sizing and regulating the constraints in a microgrid by reducing the battery size [11].The Optimizer approach along with the GWO algorithm is used as an efficient tool for battery sizing.GWO provided a high level of robustness and a meta-heuristic algorithm to deal with the issue of frequency deviation.Digsilent/POWERFACTORY software is used as a tool for simulation.
Yang et al. addressed the problem of battery sizing and fluctuations in the renewable systems by using sodium sulphur (NAS) batteries for size optimization and reducing the rate of fluctuations in the renewable system [12].Yang also highlighted that Markov Decision Processes can no longer address this problem of BESS; therefore, there is a need for sensitivity-based optimization theory.An iterative optimization algorithm was developed.Although the research was a big step toward renewables stability, there is still room for many rapid and dynamic iterations to minimize the computational time of the system.Gao performed optimal battery sizing based on algorithmic approaches [13].A model based on autoencoders and extreme learning machine is introduced for optimization of battery size.The work also addressed the use of a single-layer-feed-forward neural network and deep neural networks for optimization purposes.One drawback of the deep learning algorithm is that it requires a large amount of training data.For CNN and RNN models, this drawback of the deep learning algorithm may cause a decrease in training efficiency.
Boonluk in his work proposed GA and PSO for optimizing the size of the battery bank to be used.Fourier Coefficients were used to be processed in the algorithms and simulations were made accordingly on MATLAB and MATPOWER 7.0 [14].It was also highlighted by Boonluk that the lifetime of each algorithm GA and PSO was the same i.e., 8.8 years.PSO in terms of objective function optimization was more efficient than GA.Talent et al. used the MILP and GAMS along with the CPLEX Algorithm for the sizing of the battery [15].One drawback of the research is that it does not consider the temperature profile of the batteries for the calculation of panel efficiencies.Optimal Battery Sizing was done with the help of GA, PSO, and IEEE 30 Test System was used for the implementations for optimal BESS [16].OpenDNS with COM interfaced by the integration of IEEE 30 Test System were used for optimization.
Gupta in his work proposed a technique for battery sizing where he designed a MATLAB algorithm where all the constraints regarding the comfort and need of the user are entered [17].The sizing considerations are calculated, and the output is taken from the algorithm.Loss of Load Probability is also considered an important parameter.Higher reliability factors and economic benefits are considered to be important constraints for optimal battery sizing.In [18], a Genetic Algorithm (GA) was used for optimal sizing of the battery [18].The main objectives of this research were to decrease the Net Present Cost (NPC) of the system and the consideration of the Equivalent Loss Factor for the index amount of reliability.In [19], convex programming, which is a mathematical optimization tool that helps in examining the problem of minimizing convex functions over convex sets, and is used to formulate co-optimization of battery size, energy management, and battery aging.The notion of battery modeling is explored; however, it had one flaw: the battery model was inaccurate, and it ignored critical elements such as state of charge, etc. Peiman Mirhoseini [20] has an MILP framework-based model to utilize and evaluate the operating and trading costs of a battery charging station, which increases the system's reliability.However, because the model concentrates on installing a charging station as an MG and delivering clean electricity to meet its demands, dispatchable units (diesel generators, fuel cells, etc. are omitted.
Sampietro et al. [21] have studied the optimum sizing of batteries and supercapacitors in automobiles to achieve the lowest possible total cost.Dynamic programming is used to determine the best utilization of storage systems and fuel cells.This paper contributed to the investigation of the relationship between battery size and cost.The Terzimehic et al. [22] study is related to battery degradation, by using Support Vector Regression.The paper described how data-driven techniques can be used for battery forecasting.The author used data from various batteries operating at various temperatures and used that data to validate the machine learning results.Wu et al. [23] have researched the Feedforward neural network that is used to mimic the relationship between Remaining Useful Life and the charge curve because of its simplicity and effectiveness.The assessment of RUL for the battery under various charge current rates was neglected.
The operation plan entailed the Harmonious operation of fuel-powered generators and batteries, multi-unit DGen operation constraints, and reserve capacity to limit the number of hours the diesel generators are used.Sidra Kanwal et al. proposed [24] Linear Support Vector Regression and Rational Quadratic are used to train L-SVR, Gaussian Process Regression, and Rational Quadratic in this work.For qualitative examination of trained models, the RMSE is utilized as a critical performance metric.The basic design parameters of the battery are to be addressed to minimize the battery size to improve charge storage capacity in less space-thus making the model much more compact.
Jayashree proposed the approach of Mixed Integer Programming (Mathematical Models) and professional tools like MATLAB for BESS (Battery Energy Storage System) optimization [25].Generic Algebraic Modelling System (GAMS) and CPLEX Optimization Studio were used in the domain of BESS in the research of Jayashree.Decision-making and multiple system simulations were considered the main part of the research to yield results and minimize the size of the battery by regulating the same criteria for a microgrid.Apart from the research done by Jayashree, there is still enough room available in this domain to use more efficient tools and come up with system optimization of BESS and explore multiple applications that include battery banks.
In support vector regression, integrated is used for photovoltaic renewable energy system's ideal size by lowering the Annualized Cost of the System [26].In terms of prediction accuracy, both hybrid SVR algorithms exceeded the single SVR method.Renewable energy resources should be used as much as feasible when generators are running.They also considered the unpredictability of wind speed and clearness index.Ahmed Elnozahy [27] proposed weather unpredictability, a probabilistic technique based on an artificial neural network is used.Complete eco-techno-economic optimization research is integrated with the established choices and strategy.The proposed model to use batteries instead of parallel generators in times of emergency reduces the overall pollution and number of emissions affiliated with the previous 13 models.The aim is to design a model which proves to help balance the system and can act as a backup power source in times of emergency.In [28], optimization of a large photovoltaic array for a single household has been performed while considering various environmental factors and different municipal rules.In [29], a genetic algorithm-based approach is used to assess the optimal size of a battery in an unbalanced distribution system.

Contribution
The traditional way of calculating battery size is by using battery autonomy.Battery autonomy is based on the energy provided by the battery in the given time interval.Since data are required for the computation of battery autonomy, it makes sense to utilize datadriven techniques to compute the battery size.Data-driven techniques are becoming popular because they are flexible and incremental i.e., the battery size prediction model can be updated with new data.Data-driven techniques employ data from a microgrid's home load to automatically compute the battery size.The solution involves taking noninvasive measurements of the battery in real-time and combining these readings with regression-based machine learning algorithms to provide an accurate estimate of battery size without the use of any physical mechanism.A full dataset is utilized as an input to generate correct estimations by employing the essential variables and applying machine learning techniques.The proposed methodology can help in computing the optimal size of the battery for cost-effective implementation and a reliable microgrid battery system that can provide backup for a longer period.
To the best of the authors' knowledge, there is no publicly available dataset for assessing the optimal battery size in microgrids.Furthermore, the feature selection for selecting the most relevant attributes for assessing the optimal battery size in microgrids in a machine learning based-technique is not explored in a manner as presented in this study.The major contributions of this work are:

•
A dataset for the residential load of a microgrid with 24,000 instances and 40 attributes per instance is generated using the mixed integer linear programming (MILP) technique.It permits to assess the optimal battery size in microgrids.

•
The robust feature selection algorithms are utilized to identify the attributes that are more relevant and have a higher impact on assessing the optimal battery sizing in microgrids.

•
A machine learning-based approach is used to process the selected features sets for an automated decision of the optimal battery sizing in microgrids.
The remainder of the paper is structured as follows: Section 2 describes the MILP technique and how the dataset is formulated.Section 3 describes the proposed feature selection-based methodology for predicting the optimal battery size in microgrids.Evaluation criteria and experimental results are presented on subjective IQA databases in Section 4 followed by conclusions in Section 5.

Dataset Generation Using Mixed Integer Linear Programming (MILP)
MILP is a linear optimization problem extensively used while solving optimal sizing and selection problems of DERs and energy storage in microgrids.The problem is solved by the power balance of different DERs and energy storage as compared to the total load.Random sizes are entered into respective matrices to form a generation mix, and each generation mix is then compared to fully satisfy the load demand.Mathematically, it can be expressed as in [30], where P is the power in kW extracted from ith DER, and W is the instantaneous power extracted from the jth energy storage at any instant.P L corresponds to the total load demand obtained using MILP.
Figure 1 shows the microgrid model under consideration.The data set for a residential microgrid with 24,000 samples and 40 parameters has been self-extracted using a MILPbased microgrid model as presented in [31].The extracted parameters and their description is presented in Appendix A. The dataset has also been made available online.

Proposed Methodology
Figure 2 shows the two-step methodology proposed for optimal battery sizing of microgrids.The input to the system is power generation source factors and external parameters.In the first step, a feature selection algorithm is applied to the input to select the most relevant factors and parameters for optimal battery sizing in microgrids.The feature selection is performed using various search methods that try to navigate different combinations of attributes in the dataset to arrive at a shortlist of chosen features by keeping battery parameters as the target value.Many feature selection algorithms were evaluated but six top-performing search methods are considered here, which include ranker search, harmony search, evolutionary search, PSO search, genetic search, and linear forward search.In the second step, the selected features by the respective feature selection algorithm are given as input to the support vector regression (SVR) to predict the battery autonomy.

Feature Selection
The input features are subjected to feature selection.Various feature selection algorithms were analyzed, but the performance of only six top feature selection algorithms is reported in this work.Feature selection algorithms select the most relevant features for optimal battery sizing.The details of each feature selection algorithm are given below.

Harmony Search (HS)
Harmony Search (HS) is an optimization algorithm that utilizes the metaheuristic method.HS offers the advantage of search efficiency, algorithm simplicity, and it converges quickly to the optimal solution.The resolution time for the method is generally low [32].HS has been used on numerous engineering problems and has shown great application adaptations leading to the different versions of the algorithm being adopted.In most engineering optimization problems, there is consideration for the nonlinear and in some cases nonconvex functions that have intense equality.This has led to the increasing difficulties that arise from the solving of optimization problems using the traditional methods.HS is better suited for complex optimization problems.The HS method tries to search for the perfect harmony that is analogous to the optimal solution.This has led to harmonious improvisation: where x new is the new harmony vector, x bold is the old harmony vector, and b ω is a constant.The random walk adjustment from the pitch can be illustrated in, where x old is the fixed variable for the pitch, and b is constant for the pitch displacement.

Evolutionary Search (ES)
Evolutionary search utilizes the mechanisms that are inspired by nature for the solution of various problems through processes that emulate the various behaviors of living things.The mechanisms used for the development of the algorithm would therefore use biological terms and evolution like reproduction and recombination.The main working principle of the algorithm is the use of solutions that eliminate the weakest links and preserve the strong links i.e., the Darwin-based model.This helps in achieving a more viable solution [33].The major benefits of the algorithm include increased flexibility, better optimization bandwidth, and unlimited solutions: where F(k i ) is a function of random variables.

Genetic Search (GS)
The algorithm uses a set of terms named fitness function, initial population, mutation, selection, and crossover.The algorithm uses Darwin's model with genetic operators that form a key part of the problem-solution finding [34].Some of the key benefits of the algorithm are the complex problems solving approach and its parallelism application.The diversification of the optimization is able to deal with functions that are stationary.It can also deal with random noise.The ability of the algorithm to investigate various directions simultaneously in feature space makes it appropriate for the scientific field [32].However, given its dynamism, the algorithm is widely used in optimization that involves nonlinear data computations.The genetic search algorithm can be considered as a probability function for the chosen selector operator.In the case of chromosome, (C), the algorithm would be where f (C) is the function for the chromosome, and (N) is the total number of outcomes which depict the nominal value.

Linear Forward Search
The method would use the sequential method that is key for finding the desired element in the list from a group.Upon the successful location of the searched item, the index would often be returned.The movement is in the forward direction when the search is performed [25].The application for the linear search is mainly for the discrete values of data that would involve many elements.In n models, the function for the linear standard regression model can be written as where Q is the regression constant, and θ is the variable for the regression.The error is used to make up for the second-order differential equation.The main assumption is that the variance (σ 2 ) is additive.This means we can obtain the parameter, θ, through the least square method [25].

Particle Swarm Optimization (PSO)
This is an optimization tool used for finding the optimal solutions to the specific parameters for a design requirement with a consideration of the lowest possible cost, optimization.The application is vast in various scientific fields.Since its introduction in 1995, the method has quickly gained several useful applications in various fields [8].The adoption of the algorithm was based on social behavior, especially the bees and insects that move in a swarm (group).In nature, it is a stochastic novel-based population and is key in solving complex nonlinear optimization problems [9].PSO uses three parameters i.e., the number of dimensions, and lower and upper boundaries.The function can be elaborated as a function, where the minimum function can be seen below: where (f (x)) is the function for the variable (x), subject to several inequalities.
where g m is the inequality function.
where n h is the final value of equality.The algorithm mainly adopts five main principles.First, proximity means the ability for the space and time computational adjustments incorporated into the model.Next, the quality refers to the swarm's ability to sense the changing quality of the environment and hence an appropriate response.Thirdly, the diverse response is the ability of the swarm to change considerably and not in a narrow manner.Stability refers to the swarm not being able to change with all aspects of change but rather a controlled environment.Finally, adaptability refers to the change that is most suitable and hence the worthy adjustment [9].

Ranker Search
This is a search algorithm that uses the evaluation metrics to be able to retrieve the information mainly from various data sources.For instance, Google uses a ranger search algorithm; PageRank ranks the various URL pages depending on the importance of the various web pages.Thus, the main function is the frequency that is considered by the search algorithm for the ranking of the web pages.The case study into the Google search engine can be used as the benchmark of the operations of the ranker search algorithm.
The algorithm would work in the three-stage process namely crawling, indexing, and serving.In the crawling stage, the use of other information gathering techniques like the bots will be used to obtain the updated changes to the various URL.Next, at the indexing stage, the categorical ranking of the various web pages is based on the content of either the images or the various texts.This is done by the identification of the various headers and the tags.Finally, at the serving stage also known as the ranking stage, the various URL will be listed based on the most relevant to the search parameter that is obtained for the search.The use of a similar concept is adopted by the various search engines with a few minor adjustments to the attributes of search like the price in some cases or the frequency of visits in some (inbound traffic) [10].In the case of the ranker algorithm, the basic ranker search can be formulated as where A, B, and C and web pages that are lined together, and L() is the outbound link.
The various probability functions of the pages can be used.The overall function would define PR, The notation B u is the set that contains all links to the URL page u, and L(v) the number of links to URL v. the damping factor is also considered for the algorithm.
The SVR uses tools like sparse solution [26].The use of the SVR will consider a Hyperplane; this is a separation that aids in the prediction of the target value.The Kernel in an SVR model would be a function that would be suitable for the mapping of the data points into a higher dimension.The commonly used kernels are the sigmoidal, polynomial, and Gaussian radial basis function kernels.Finally, the boundary line margin that separates the hyperplane for the data points [26].The illustration can be seen below for the SVR.The normal vector's magnitude relative to the surface can be estimated as where w are the weights, and the error is compensated in the constraints by constraints, where y i is the initial y constraints for the variable, and x i is the initial x constraints for the variable.

Data Set and Evaluations' Parameters
The dataset is one of the basic requirements for the quantitative evaluation of a system.The data set is of the residential load of a microgrid.It is self-developed by using MILP.The data set has 24,000 samples and 40 features.The 40 features are presented in Appendix A. Each row in the data set presents generation sources, external factors, and battery parameters.Add some details about the time, duration topology, etc.

Spearman Ranked Correlation Coefficient (SROCC)
This is a nonparametric measure of the strength and direction of association that can be established between two variables.The assumptions used for SROCC are mainly three.The first assumption is that the two variables under study should be measured on an ordinal, interval, or ratio scale.The second assumption is that the two variables should present paired observation-based criteria.The last assumption is that there should be a monotonic relationship between the two variables [11].The SROCC score is given as where x i is the ith value of x, x is the mean value of x, y i is the ith value of y, and ȳ is the mean value of y.A value close to 1 for SROCC signifies better performance and represents that the predicted battery autonomy using the proposed model is close to the original battery autonomy, whereas a value close to 0 for SROCC signifies poor performance and represents that the predicted battery autonomy does not match the original battery autonomy.

Kendal Correlation Constant
The KCC is used for the measurement of the ordinal association between two measured quantities.The correlation would test for the similarities in the ordering of data when it is ranked by quantities.The coefficient value of 1 means that the elements in the two sets are ordered in a similar manner i.e., high correlation.The coefficient value being −1 (τ = −1) means that the two sets are ordered oppositely.Finally, when τ = 0, it means there is no relationship between the two sets [12].The rank correlation can be expressed by where n c is the number of concordant pairs, n d is the number of discordant pairs, and n is the total number of pairs.A value close to 1 for KCC signifies better performance and represents the fact that the predicted battery autonomy using the proposed model is close to the original battery autonomy.However, a value close to 0 for KCC signifies poor performance and represents that the predicted battery autonomy does not match the original battery autonomy.

LCC: Linear Correlation Constant
LCC is a measure of the strength of the linear relationship between two variables.The LCC values, r xy , show the strength of the relationship between two variables.A value close to 1 for LCC signifies better performance and represents that the predicted battery autonomy using the proposed model is close to the original battery autonomy.However, a value close to 0 for SROCC signifies poor performance and represents that the predicted battery autonomy does not match the original battery autonomy [35].The formulation of the linear coefficient can be seen below: where x i is the ith values for the x variable, and y i is the ith value of the y variable.

RMSE: Root Mean Square Error
The RMSE is a tool that is used for the prediction error (residual).The residuals are the measure of how far predicted data points are from the original values [35].The use of the RMSE is vital for statistical data to illustrate data relationships and establish the variation of the data.The RMSE can be formulated as follows: where P is the predicted value in the observations, and O is the observed value for the observations with a sample size n.A value close to 0 for RMSE signifies better performance and represents that the predicted battery autonomy using the proposed model is close to the original battery autonomy.However, a high value for RMSE signifies poor performance and represents that the predicted battery autonomy does not match the original battery autonomy.

Performance Analysis
Table 1 shows the number of features selected by each feature selection algorithm.The total number of features is 40.Ranker search selects 29 and particle swarm optimization selects 14 features.However, six features are selected by linear forward selection and eight features are selected by the harmony search algorithm.Evolutionary search and genetic search algorithms select 12 and 11 features, respectively.It can be observed that the ranker search feature selection algorithm selects the largest number of features i.e., 29, whereas the linear forward features selection algorithm selects the least number of features i.e., 6, particle swarm optimization algorithm selects the second largest number of features i.e., 14.The third least number of features is selected by harmony search i.e., 8. Figure 3 shows the comparison of all the feature selection algorithms in terms of SROCC, LCC, KCC, and RMSE in the form of a bar graph.It can be observed that the feature selection algorithms help in better prediction of battery autonomy and improve the performance of the proposed methodology.Figure 3 shows that the battery autonomy prediction capability of the proposed methodology improves greatly when feature selection is applied, and it can be observed that the SROCC score is 0.2893, LCC score is 0.3760, KCC score is 0.2165, and RMSE score is 0.2152 when all 40 features are utilized.Feature selection helps in improving the capability of the system to predict the battery autonomy which is depicted by an improvement in SROCC score to 0.9452, LCC score to 0.9756, KCC score to 0.8488, and RMSE score to 0.0525 when the ranker search feature selection algorithm is applied.Aforementioned values close to 1 for SROCC, LCC, and KCC signify that the predicted battery autonomy correlates highly with the original battery autonomy, and hence the predicted values of battery autonomy are close to the original values of battery autonomy.Furthermore, the value of RMSE close to zero shows that the difference between the values of predicted battery autonomy and original battery autonomy is minimal.Hence, the feature selection algorithms have a significant impact on improving the battery autonomy prediction capability of the proposed system.It can be observed that the height of the bar graphs is lower when all the features and the height increases for all six feature selection algorithms and when a subset of the most relevant and optimal features is used for predicting the battery autonomy.The results shown in Figure 3 can be verified using Table 2.The performance analysis for the battery autonomy capability of the proposed methodology in terms of SROCC, LCC, KCC, and RMSE is shown in Table 2.It can be observed that the performance of the proposed methodology improves when feature selection algorithms are utilized.
The system shows a capacity for battery autonomy prediction when all the 40 features are utilized in terms of SROCC, LCC, and KCC score to be 0.2893, 0.3764, and 0.2165, respectively.The capacity for predicting battery autonomy in terms of SROCC, LCC, and KCC increases to 0.9452, 0.9756, and 0.8488 when the ranker search feature selection algorithm is applied.In terms of RMSE, a value close to 0 signifies better battery autonomy prediction capability and, therefore, the performance in terms of RMSE improves from 0.2152 when all the features are utilized to 0.0525 when ranker search is used.Ranker search is ranked at the top with an SROCC, LCC, KCC, and RMSE score of 0.9452, 0.9756, 0.8488, and 0.0525, respectively.PSO is ranked second with a SROCC, LCC, KCC, and RMSE score of 0.9252, 0.9645, 0.7983, and 0.0608, respectively.Genetic search is ranked third with a SROCC, LCC, KCC, and RMSE score of 0.9237, 0.9640, 0.7959, and 0.0613, respectively.Evolutionary search is ranked fourth with a SROCC, LCC, KCC, and RMSE score of 0.9229, 0.9639, 0.7954, and 0.0613, respectively.Harmony search is ranked fifth with an SROCC, LCC, KCC, and RMSE score of 0.9076, 0.9528, 0.7685, and 0.0701, respectively.Linear forward selection is ranked sixth with an SROCC, LCC, KCC, and RMSE score of 0.8846, 0.9443, 0.7369, and 0.07518, respectively.Figure 4 shows the box plot of the SROCC scores over 1000 iterations for the proposed methodology when using all features and utilizing the top-performing six feature selection algorithms.A box plot shows the five-number summary of a set of data i.e., minimum, first quartile, median, third quartile, and maximum.The interquartile range is defined as the distance between the upper and lower quartiles.A larger interquartile range shows a higher deviation in the data.A lower interquartile range is desirable for our case, which indicates consistent results over the given iterations.The test and train samples are selected at random for each iteration.It is ensured that the test and train sets for each iteration are disjoint sets i.e., the training samples are not present in the test samples.It can be observed that the median value for the box plot of ranker search is the largest, which shows that it performs best.It can also be observed that the box plot for the ranker search is more compact i.e., it has a lower interquartile range in comparison to when all the features are utilized, evolutionary search, genetic search, and harmony search.This shows that there is a lower standard deviation between SROCC values in the case of ranker search.A lower value of standard deviation shows that the results are more consistent over the 1000 iterations.The performance comparison of the proposed methodology in terms of RMSE with state-of-the-art techniques in literature is shown in Table 3.A value close to zero for RMSE exhibits better performance, whereas a higher value of RMSE represents poor performance.The proposed methodology with ranker search has the least value of RMSE i.e., 0.0525 when compared to other state-of-the-art methods, i.e., it is ranked at the top, and it signifies the better performance of the proposed methodology in comparison to state-of-the-art methods.Support Vector Regression integrated with Harris-Hawks Optimization [27] is ranked second with an RMSE score of 0.1961, K-means clustering [24] based technique is ranked third with a RMSE score of 0.7170, which is much higher in comparison to the proposed methodology.

Technique RMSE Score
Multi-Layer Perception [36] 6.3000 Linear Support Vector Regression [37] 2.4090 K-means clustering [24] 0.7170 Support Vector Regression integrated with Harris Hawks Optimization [27] 0.1961 Neural Network [26] 0.4240 Proposed method (P ranker ) 0.0525 Figure 5 shows the scatter plots of the proposed methodology using all features and with feature selection algorithms.The horizontal axis of each scatter plot represents the original values of battery autonomy computed using MILP and the vertical axis represents the predicted values of battery autonomy.The ideal case, i.e., the best result would be if the data points of the scatter plot are aligned along the positive diagonal.Figure 5a shows the scatter plot of the original vs. predicted values when all features are used.It can be observed that the data points are not aligned along the diagonal, hence the performance of the system is not optimal.Figure 5b shows the scatter plot of the original vs. predicted values when an evolutionary search feature selection algorithm is used.It can be observed that the data points are better aligned along the diagonal in comparison to when all features are used.It is also validated by the higher SROCC score of 0.9639.Figure 5c shows the scatter plot of the original vs. predicted values when the genetic search is used to select features.It can be observed that the data points are better aligned along the diagonal in comparison to when all features are used.It is also validated by the higher SROCC score of 0.9640.Figure 5d shows the scatter plot of the original vs. predicted values when harmony search is used to select features.It can be observed that the data points are better aligned along the diagonal in comparison to when all features are used.It is also validated by the higher SROCC score of 0.9528.Figure 5e shows the scatter plot of the original vs. predicted values when linear forward selection is used.It can be observed that the data points are better aligned along the diagonal in comparison to when all features are used.It is also validated by the higher SROCC score of 0.9443.Figure 5f shows the scatter plot of the original vs. predicted values when particle swarm optimization is used to select features.It can be observed that the data points are better aligned along the diagonal in comparison to when all features are used.It is also validated by the higher SROCC score of 0.9645.Figure 5g shows the scatter plot of the original vs. predicted values when ranker search is used for feature selection.It can be observed that the data points here are best aligned along the diagonal in comparison to all others.It is also validated by the highest SROCC score of 0.9756.
The results from different feature selection algorithms affect the battery sizing in microgrids or the performance.The feature selection algorithm with the least RMSE score and the highest SROCC, LCC, and KCC score assess the optimal size of the battery.The feature selection algorithm with the highest RMSE score and lowest SROCC, LCC, KCC score does not effectively predict the optimal size of the battery.

Conclusions
Microgrids are becoming more popular with each passing day, but microgrids require bulk storage capacity to provide the stored energy in times of emergency or peak loads.Mixed-integer linear programming (MILP) is an established technique for the integration and optimization of different energy sources and parameters for optimal battery sizing.A new MILP-based dataset is studied in this work.Furthermore, a machine learning-based approach using the Support Vector Regression (SVR) is evaluated in this work for optimal battery sizing.Results have shown that the performance of the SVR, when all the features of the MILP formation are used, requires improvement.Hence, feature selection algorithms have been utilized that help in selecting the most relevant features that have a high impact on battery sizing.The performance of six top-performing feature selection algorithms is analyzed.The Ranker Search feature selection algorithm attained the highest performance with SVR by securing a Spearman's rank-ordered correlation constant of 0.9756, linear correlation constant of 0.9452, Kendall correlation constant of 0.8488, and root mean squared error of 0.0525.The particle swarm optimization achieved the second best performance, genetic search is the third, evolutionary search is the fourth, harmony search is ranked fifth, and linear forward selection is ranked sixth.The performance of the proposed approach is compared with state-of-the-art counterparts.Results confirm a comparable or better performance of the devised method.In the future, the performance of devised method will be analyzed for other potential datasets and applications.Investigating the feasibility of incorporating the other machine and deep learning based regression models is another axis of future research.Ranker search shows the best performance and selects 29 features, so let us discuss the importance of these features one by one.The first selected feature is distributed generation market demand.It is important because the future market demands of energy affect battery autonomy.The second selected feature is Hoppecke 6 OPzS 300.It defines the battery and thus it is important for battery autonomy.The third feature is the converter, and it helps in computing battery autonomy because it gives the power inversion of an operation inverter.The fourth selected feature is total capital cost, and it is important because cost plays a vital role in optimal battery sizing and computing battery autonomy.The fifth selected feature is unmet load fraction, and it helps in battery sizing because it helps in determining the portion of the total load that went unserved.The total net present cost is the sixth selected feature, and it helps in battery sizing since the total net present cost has a significant impact on the size of the battery to be utilized.The seventh selected feature is the total emissions, and they impact the battery size because the allowable emissions will help in determining the battery size.Total annual capital cost is the next selected feature and the total annual cost will help in determining the size of the battery to be used.The tenth selected feature is total operations and maintenance cost and since the batteries may require maintenance so it is important for determining the battery size.The next selected feature is AC primary load served, and it helps in battery sizing because the size of the battery also depends on the AC load to be served.The twelfth selected feature is the renewable factor and knowing the fraction of load being served by the renewable energy will impact the battery size.The next selected feature is a capacity shortage and knowing the energy capacity shortage can help us in determining the size of the battery to reduce the capacity shortage.The fourteenth and fifteenth selected features are unmet load and unmet load fraction, respectively, and they can help in determining the size of the battery to minimize the effects of insufficient generation.Excess electricity is the next selected feature, and it can help in battery sizing because the excess power may be stored in batteries for use at a later time when more energy is required.The seventeenth selected feature is diesel and the volumetric use of diesel in a system has an impact on the size of the battery to be used in the system.The next three selected features are carbon dioxide, carbon mono oxide, and unburned hydrocarbons emissions, respectively, and, with global warming, checks are being put in place for carbon emissions.The limit of allowable carbon emissions for a system will impact the size of the battery being utilized.The next three selected features are particulate matter, sulfur dioxide, and nitrogen oxide emissions as effluent into the air, respectively, and, since they can cause serious health issues, therefore we would want these emissions to be minimized and an appropriate battery size can help in doing so; therefore, these emissions will impact the battery size.The next selected feature is distributed generation market demand fuel and, since the distributed generation of fuel for a system is affected by the battery size, thus, vice versa, the battery size will be affected by the distributed generation fuel.The next selected feature is distributed generation market demand hours, and the battery size will be affected by the number of hours the distributed generation model is active.If it remains active for a longer time, we may require larger batteries, and, if it remains active for a shorter time, we may require smaller batteries.Distributed generation market demand model stats/years is the next selected feature, and, since it gives the statistics of the system, it will help in determining the size of the battery.The next selected feature is distributed generation market demand model life, and, since it analyzes the working life of the distributed generation power system, it may therefore be used to determine the size of the battery.The next selected feature is battery throughput, which is the lifetime of a battery in years, and it directly affects the battery size because, if a lifetime is smaller for a battery, we will require a larger battery and, if the lifetime is larger, we may require a smaller battery.The last selected feature of the battery is battery life, which defines the estimated working life of a battery, and, since it is a direct parameter of the battery, it will affect the battery size.It can be observed that excess electricity, distributed generation market demand model hours, distributed generation market demand model life, battery throughput, and battery life are selected by all the six feature selection algorithms, whereas operating cost, deferrable load served, and nitrogen oxide emissions are selected by four feature selection algorithms each.The total annual replacement cost, renewable fraction, carbon mono oxide emissions, and distributed generation market demand model life are selected by three feature selection algorithms each.

Figure 2 .
Figure 2. Proposed methodology for optimum performance.

Figure 3 .
Figure 3.The performance comparison of feature selection algorithms in terms of LCC, SROCC, KCC, and RMSE scores.

Figure 4 .
Figure 4. Box plots for the performance comparison in terms SROCC score between six feature selection algorithms for predicting battery autonomy.

46 P
r e d i c t e d B a t t e r y A u t o n o m y Original Battery Autonomy P r e d i c t e d B a t t e r y A u t o n o m y P r e d i c t e d B a t t e r y A u t o n o m y d i c t e d B a t t e r y A u t o n o m y

Table 1 .
Number of features selected by each feature selection algorithm.

Table 2 .
Performance comparison of feature selection algorithms.

Table 3 .
Performance comparison of proposed methodology with state-of-the-art techniques.