On the relationship between distance and generalisation