fixed issue with python 2.6 where random.choice is not available. Instead of using it directly, we use the random util of sklearn.