To unlock the full potential of PSCs, machine learning (ML) was implemented in this research to predict the best combination of mesoporous-titanium dioxide (mp-TiO2) and weight percentage (wt%) of phenyl-C61-butyric acid methyl ester (PCBM), along with the current density (Jsc), open-circuit voltage (Voc), fill factor (ff) and energy conversion efficiency (ECE). Then, the combination that yielded the highest predicted ECE was selected as a reference to fabricate PCBM-PSCs with nanopatterned TiO2 layer. Subsequently, the PCBM-PSCs with nanopatterned TiO2 layers were fabricated and characterized to further understand the dual effects of nanopatterning depth and wt% of PCBM on PSCs. Experimentally, the highest ECE of 17.336% is achieved at 127 nm nanopatterning depth and 0.10 wt% of PCBM, where the Jsc, Voc and ff are 22.877 mA/cm2, 0.963 V and 0.787, respectively. The measured Jsc, Voc, ff and ECE values show consistencies with the ML prediction. Hence, these findings not only revealed the potential of ML to be used as a preliminary investigation to navigate the research of PSCs, but also highlighted that nanopatterning depth has a significant impact on Jsc, and the incorporation of PCBM on perovskite layer influenced the Voc and ff, which further boosted the performance of PSCs.