Imported from https://github.com/cair/regression-tsetlin-machine