Machine Learning: Python KNeighborsRegressor(): weights = 'uniform' vs weights = 'distance'?

Hi Codecademy,

I just recently finished the K Nearest Neighbor Regression Module. I have a question regarding the ‘weights’ parameter in the ‘KNeighborsRegressor()’

In the real work setting, when do we use the ‘weights = uniform’ and when to use the other? Since from the exercise I did in the module, the two methods of calculation could generate two different numbers.

I would appreciate any of your support on this matter.

Kind Regards,