[SPARK-2839][MLlib] Modifications made according to review