Modified SO code, Numpy 1.7 compatible, fix issue with strings not compatible with sklearn classifiers