Measure Distance between data points in Machine Learning