Microgrids are becoming popular nowadays because they provide clean, efficient, and low-cost energy. To use the stored energy in times of emergency or peak loads, microgrids require bulk storage capacity. Since microgrids are the future of renewable energy, the energy storage technology employed should be optimized to generate electricity. Batteries play a variety of essential roles in daily life and are used at peak hours and during a time of emergency. There are different types of batteries i.e., lion batteries, lead-acid batteries, etc. Optimal battery sizing of microgrids is a challenging problem, that limits modern technologies such as electric vehicles, etc. It is important to know different battery features such as battery life, battery throughput, and battery autonomy to get optimal battery sizing for microgrids. 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 introduced in this work. Support vector machine (SVM) is the machine learning application used to estimate the optimum battery size. The impact of feature selection algorithms on the proposed machine learning-based model is evaluated. The performance of the six best-performing feature selection algorithms is analyzed. The experimental results show that the feature selection algorithms improve the performance of the proposed methodology. Ranker search shows the best 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.