What you do is you compute a lot of simulations with the expensive method. Then you train using neural neural networks (well any regression method you like).
Then you can use the trained method on new arbitrary structures. If you've done everything right you get good, or good enough results, but much much faster.
At a high level It's the same pipeline as in all ML. But some aspects are different, e.g. unlike image recognition you can generate training data on the fly by running more DFT simulations