The use of base station (BS) sleep modes is one of the most studied approaches for the reduction of the energy consumption of radio access networks (RANs). Many papers have shown that the potential energy saving of sleep modes is huge, provided the future behavior of the RAN traffic load is known. This paper investigates the effectiveness of sleep modes combined with machine learning (ML) approaches for traffic forecast. A portion of an RAN is considered, comprising one macro BS and a few small cell BSs. Each BS is powered by a photovoltaic (PV) panel, equipped with energy storage units, and a connection to the power grid. The PV panel and battery provide green energy, while the power grid provides brown energy. This paper examines the impacts of different prediction models on the consumed energy mix and on QoS. Numerical results show that the considered ML algorithms succeed in achieving effective trade-offs between energy consumption and QoS. Results also show that energy savings strongly depend on traffic patterns that are typical of the considered area. This implies that a widespread implementation of these energy saving strategies without the support of ML would require a careful tuning that cannot be performed autonomously and that needs continuous updates to follow traffic pattern variations. On the contrary, ML approaches provide a versatile framework for the implementation of the desired trade-off that naturally adapts the network operation to the traffic characteristics typical of each area and to its evolution.