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_r389673662
##########
File path: mllib/src/main/scala/org/apache/spark/ml/feature/ChiSqSelector.scala
##########
@@ -245,14 +266,16 @@ object ChiSqSelector extends
DefaultParamsReadable[ChiSqSelector] {
@Since("1.6.0")
final class ChiSqSelectorModel private[ml] (
@Since("1.6.0") override val uid: String,
- private val chiSqSelector: feature.ChiSqSelectorModel)
+ @Since("3.1.0")val selectedFeatures: Array[Int])
extends Model[ChiSqSelectorModel] with ChiSqSelectorParams with MLWritable {
import ChiSqSelectorModel._
- /** list of indices to select (filter). */
- @Since("1.6.0")
- val selectedFeatures: Array[Int] = chiSqSelector.selectedFeatures
+ var prev = -1
Review comment:
Doesn't matter, but you can write
`require(selectedFeatures.sliding(2).forall(l => l(0) < l(1)), ...)`
----------------------------------------------------------------
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]