We develop a random forest regressor (RFR) machine learning model to trace the coronal evolution in two highly variable active galactic nuclei (AGNs) IRAS 13224-3809 and 1H 0707-495 observed with XMM-Newton, by probing the X-ray reverberation features imprinted on their power spectral density (PSD) profiles. Simulated PSDs in the form of a power-law, with similar frequency range and bins to the observed data, are produced. Then, they are convolved with relativistic disc-response functions from a lamp-post source before being used to train and test the model to predict the coronal height. We remove some bins that are dominated by Poisson noise and find that the model can tolerate the frequency-bin removal up to \(\sim 10\) bins to maintain a prediction accuracy of \(R^{2} > 0.9\). The black hole mass and inclination should be fixed so that the accuracy in predicting the source height is still \(> 0.9\). The accuracy also increases with the reflection fraction. The corona heights for both AGN are then predicted using the RFR model developed from the simulated PSDs whose frequency range and bins are specifically adjusted to match those from each individual observation. The model suggests that their corona varies between \(\sim~5 - 18~r_{\rm g}\), with \(R^{2} > 0.9\) for all observations. Such high accuracy can still be obtained if the difference between the true mass and the trained value is \(\lesssim 10\%\). Finally, the model supports the height-changing corona under the light-bending scenario where the height is correlated to source luminosity in both IRAS 13224-3809 and 1H 0707-495.