@nitrosito
Many photographers would welcome this to be sure, however, things are more complicated that some think.
First, there is no universally agreed use of HF focusing. I personally make use of a blur spot approach that encompasses diffraction.
Second, what blur spot, eg CoC, should one use. I personally decide on viewing distance as well as the sensor.
Then you have the real problem of establishing a zero/datum, as many lenses use a floating focus ring, ie it rotates without a hard stop.
I have, without ML, programmed another controller to not only move to the correct HF point, but also undertake a non-macro focus set, eg three focusing points at, say, 3, 6 and 10 ft.
I accomplished this by over driving the lens to one end, say, infinity, and then moving the lens back to the required positions, derived through calibration.
I did this for 'fun' and the focusing process is slow.
In the end, as I tend to use wide angle, manual primes, I simply calibrated the lens and marked the required HF point on the lens barrel, or a few focus stacking points on the barrel, ie manual primes tend to have fixed focus rings that hold their calibration.
Just some feedback relative to your suggestion.
I'm sure others will have different views :-)