VRAM is king for AI workloads. If you're at all interested in running LLMs, you want to maximize VRAM. RTX 3090 or 4090 are your options if you want 24GB and CUDA. If you get a 4090, be sure you get a power supply that supports the 12V HPWR connector. Don't skimp on power. I'm a little out of the loop but I think you'll want a PCIe 5.0 PSU. https://www.pcguide.com/gpu/pcie-5-0-psus-explained/
If you're not interested in LLMs and you're sure your machine learning tasks don't/won't need that much VRAM, then yes, the 4070 Ti is the sweet spot.
logicalincrements.com is aimed at gaming, but it's still a great starting point for any workload. You'll probably want to go higher on memory and skew more toward multi-core performance compared to gaming builds, IMO. Don't even think about less than 32GB. A lot of build guides online skimp on RAM because they're only thinking about gaming.