zhengruifeng commented on code in PR #40097:
URL: https://github.com/apache/spark/pull/40097#discussion_r1114323509


##########
mllib-common/src/main/scala/org/apache/spark/ml/attribute/attributes.scala:
##########
@@ -339,7 +338,7 @@ class NominalAttribute private[ml] (
   override def isNominal: Boolean = true
 
   private lazy val valueToIndex: Map[String, Int] = {
-    values.map(Utils.toMapWithIndex(_)).getOrElse(Map.empty)
+    values.map(_.zipWithIndex.toMap).getOrElse(Map.empty)

Review Comment:
   here partially revert 
https://github.com/apache/spark/commit/9cae423075145d3dd81d53f4b82d4f2af6fe7c15 
to avoid directly depending on spark-core



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to