Change the output format of mlogregr - Python solution