Github user jkbradley commented on a diff in the pull request:
https://github.com/apache/spark/pull/10146#discussion_r49392781
--- Diff:
mllib/src/main/scala/org/apache/spark/mllib/stat/test/ChiSqTest.scala ---
@@ -109,7 +109,9 @@ private[stat] object ChiSqTest extends Logging {
}
i += 1
distinctLabels += label
- features.toArray.view.zipWithIndex.slice(startCol, endCol).map {
case (feature, col) =>
+ val featureArray = features.toArray
+ (startCol until endCol).map { col =>
+ val feature = featureArray(col)
--- End diff --
Converting to Breeze should be an O(1) operation, using a reference copy,
not a deep copy. Breeze uses binary search on the indices, so it should be
fairly efficient. I think it's better than converting to a dense array.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]