Imported from https://github.com/felixleopoldo/trilearn