Github user srowen commented on a diff in the pull request:
https://github.com/apache/spark/pull/14597#discussion_r75855634
--- Diff:
mllib/src/main/scala/org/apache/spark/ml/feature/ChiSqSelector.scala ---
@@ -91,8 +137,17 @@ final class ChiSqSelector @Since("1.6.0")
(@Since("1.6.0") override val uid: Str
case Row(label: Double, features: Vector) =>
OldLabeledPoint(label, OldVectors.fromML(features))
}
- val chiSqSelector = new
feature.ChiSqSelector($(numTopFeatures)).fit(input)
- copyValues(new ChiSqSelectorModel(uid, chiSqSelector).setParent(this))
+ var model = ChiSqSelectorType.withName($(selectorType)) match {
--- End diff --
I just mean something like
```
val selector = new feature.ChiSqSelector()
ChiSqSelectorType.withName($(selectorType)) match {
case ChiSqSelectorType.KBest =>
selector.setNumTopFeatures($(numTopFeatures))
...
}
val model = selector.fit(input)
...
```
Is that inconsistent with something?
---
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]