How machine learning is transforming retail both online and offline