Hybrid energy systems (HES) integrating photovoltaic, wind, and storage technologies are emerging as sustainable and reliable energy solutions. Optimal sizing of HES components is critical to their efficiency, costs, and environmental benefits. This paper introduces a novel machine learning (ML)-based framework to rapidly determine HES configurations, reducing the Levelized Cost of Energy while meeting demand. Unlike conventional methods and metaheuristic algorithms, which are computationally intensive, ML models provide efficient solutions. A comprehensive HES database for an Algerian region was developed to train 12 ML regressors, evaluated using R-squared, Mean Absolute Error, Root Mean Square Error, and Median Absolute Error metrics. The best-performing models were compared against HOMER Pro, linear programming, and particle swarm optimization. To ensure generalizability, the framework was tested in diverse locations, including California, Texas, Bangkok, and Nicosia. Results demonstrate that ML models achieve rapid and accurate HES sizing, outperforming traditional methods in both speed and precision.