CeO2 nanostructures have been utilized for various biomedical, sensor, and catalysis applications owing to their unique defect structure, enabling them to have regenerative oxidative properties. Defect engineering in CeO2 nanostructures has major importance, enabling them to be utilized for specific applications. Despite various synthesis methods, it is challenging to have precise and reversible control over defect structures. Against this backdrop, in the current work, we have explored machine learning (ML) enhanced defect engineering of CeO2 nanofilms. In our earlier work [J. Vac. Sci. Technol. A 39, 060405 (2021)], we have developed an atomic layer deposition process for CeO2 using in situ ellipsometry measurements. In the current work, data collected through in situ spectroscopic ellipsometry and ex situ XPS have been correlated using two ML algorithms (gradient boost and random forest regressor) to exert better control over the chemical properties. Defect structures are one of the desired properties in CeO2 nanomaterials, characterized by the Ce3+/Ce4+ oxidation state ratio leading to its regenerative properties. We have shown that the defect structure of the CeO2 nanofilms can be predicted using in situ ellipsometry data in real time using a trained ML algorithm using two different methods. The first method involves an indirect approach of thickness prediction using an ML algorithm (k-nearest neighbors) followed by Ce3+/Ce4+ estimation using an experimental calibration curve. The second method with a more direct approach involves Ce3+/Ce4+ prediction using real-time ellipsometry data (amplitude ratio ψ and phase difference Δ) using gradient boost and random forest regressor.