Github user mpjlu commented on a diff in the pull request:

    https://github.com/apache/spark/pull/14597#discussion_r75286500
  
    --- Diff: 
mllib/src/main/scala/org/apache/spark/mllib/feature/ChiSqSelector.scala ---
    @@ -171,14 +177,47 @@ object ChiSqSelectorModel extends 
Loader[ChiSqSelectorModel] {
     
     /**
      * Creates a ChiSquared feature selector.
    - * @param numTopFeatures number of features that selector will select
    - *                       (ordered by statistic value descending)
    - *                       Note that if the number of features is less than 
numTopFeatures,
    - *                       then this will select all features.
      */
    -@Since("1.3.0")
    -class ChiSqSelector @Since("1.3.0") (
    -  @Since("1.3.0") val numTopFeatures: Int) extends Serializable {
    +@Since("2.1.0")
    +class ChiSqSelector @Since("2.1.0") () extends Serializable {
    +  private var numTopFeatures: Int = 50
    +  private var percentile: Double = 10.0
    +  private var alpha: Double = 0.05
    +  private var selectorType = ChiSqSelectorType.KBest
    +  private var chiSqTestResult: Array[ChiSqTestResult] = _
    +
    +  @Since("1.3.0")
    +  def this(numTopFeatures: Int) {
    +    this()
    +    this.numTopFeatures = numTopFeatures
    --- End diff --
    
    This is not necessary, because the default selectorType is KBest


---
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]

Reply via email to