Imported from https://github.com/fukatani/stacked_generalization