https://medium.com/@monocosmo77/working-with-conditional-likelihood-part2-machine-learning-5ac45a4f691a