Imported from https://github.com/evfro/kdd2018