srowen commented on a change in pull request #27841: [SPARK-31077][ML] Remove
ChiSqSelector dependency on mllib.ChiSqSelectorModel
URL: https://github.com/apache/spark/pull/27841#discussion_r389673912
##########
File path: mllib/src/main/scala/org/apache/spark/ml/feature/ChiSqSelector.scala
##########
@@ -270,10 +293,10 @@ final class ChiSqSelectorModel private[ml] (
val func = { vector: Vector =>
vector match {
case SparseVector(_, indices, values) =>
- val (newIndices, newValues) = chiSqSelector.compressSparse(indices,
values)
+ val (newIndices, newValues) = compressSparse(indices, values)
Vectors.sparse(newSize, newIndices, newValues)
case DenseVector(values) =>
- Vectors.dense(chiSqSelector.compressDense(values))
+ Vectors.dense(selectedFeatures.map(i => values(i)))
Review comment:
does it work to just `.map(values)`?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]