[SPARK-2199][mllib] minor refactoring