added learnMahalanobis version from 2nd article