Test thousands of combinations quickly
Algorithm

You seem to essentially be doing linear regression with a least absolute deviations optimisation criterion. There are various standard approaches, although I'm not entirely sure about their applicability.

Problem: the task implemented by this code is not well specified. The precision variable serves to quantise the gradient and intercept of the line, but it's impossible to tell from the given specification and comments whether this quantisation is inherent to the problem domain or whether it's there to control the runtime of the search.

If the quantisation is inherent then some of the standard techniques will give starting points but you'll need to test the four nearest valid parameters (rounding each parameter up and down).

Given the size of your data, the approach which tries all lines through two points is probably going to be the most efficient, but again I'm not sure whether the real scenario has a larger dataset.



Code


start_time = datetime.now()
...
print("That run took:", datetime.now() - start_time)



I believe that timeit is the standard way of doing this in Python.




for adder in range(int(max_adder / precision)):
    for multiplier in range(int(max_multiplier / precision)):
        ...
                result[0] * (multiplier*precision) + (adder*precision) - result[1])



It took some thought to decipher the intent here, especially since precision's meaning is not documented. It would be clearer to use numpy.arange or to implement something similar.




print("adder: {:0.3f}".format(1 / (best_setting[1] * precision) if best_setting[1] else 0))
print("multipliertiply: {:0.3f}".format(1 / (best_setting[2] * precision) if best_setting[2] else 0))



Huh? Where did those reciprocals come from? Also, you seem to have started changing multiply to multiplier and got distracted part-way through.