Question vertical pod autoscaler algorithm/customize

Hi everyone!

Does anyone know where I can find exact what algorithm the vertical pod autoscaler uses for calculating recommendations? And how does the VPA utilize historical metrics from Prometheus (if available)? Is it possible to make changes to the algorithm used?

Any answers would be highly appreciated! Thank you! ^^