The energy yield of photovoltaic installations depends critically on panel orientation, yet most
installations in developing regions rely on fixed tilt angles chosen by rule of thumb. This study
develops and compares classical machine learning and deep learning models for predicting the
optimal hourly tilt angle of solar panels using multi-year meteorological measurements from the
Kano region of Nigeria. A timestamped dataset of global horizontal irradiance, direct normal
irradiance, diffuse horizontal irradiance, module temperature, wind speed, and relative humidity
was cleaned, deduplicated, and enriched through feature engineering, including derivation of the
clearness index from extraterrestrial irradiance, a fixed surface albedo of 0.23, solar zenith angle
computation from site geometry, and specific humidity estimation from the Tetens relation. The
target tilt angle was defined from the solar zenith angle. Four regression models were trained with
cross-validation: linear regression, decision tree, random forest, and XGBoost. Hyperparameter
tuning with randomized search showed XGBoost (RMSE 1.94) and random forest (RMSE 3.06)
far outperforming linear regression (RMSE 564.25). A stacked long short-term memory network
with 128 and 64 units, trained on 120-hour input windows with early stopping, achieved the best
performance with an RMSE of 0.24, and test-set residuals largely fell within plus or minus 5
degrees. Predicted tilt profiles reproduced physically expected behaviour: diurnal peaks near
solar noon, a seasonal cycle peaking at about 3.1 degrees in June and July and falling to about
1.7 degrees in December and January, and a consistent intra-month decline of roughly 4 degrees
in January following the December solstice. The results demonstrate that sequence-based deep
learning can capture both the orbital and atmospheric dynamics governing panel orientation and
provide a foundation for intelligent, low-cost solar tracking in high-irradiance developing regions.