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

    https://github.com/apache/spark/pull/1733#discussion_r15854415
  
    --- Diff: mllib/src/main/scala/org/apache/spark/mllib/stat/Statistics.scala 
---
    @@ -89,4 +90,76 @@ object Statistics {
        */
       @Experimental
       def corr(x: RDD[Double], y: RDD[Double], method: String): Double = 
Correlations.corr(x, y, method)
    +
    +  /**
    +   * :: Experimental ::
    +   * Conduct the Chi-squared goodness of fit test of the observed data 
against the
    +   * expected distribution.
    +   *
    +   * Note: the two input RDDs need to have the same number of partitions 
and the same number of
    +   * elements in each partition.
    +   *
    +   * @param observed RDD[Double] containing the observed counts.
    +   * @param expected RDD[Double] containing the expected counts. If the 
observed total differs from
    +   *                 the expected total, this RDD is rescaled to sum up to 
the observed total.
    +   * @param method String specifying the method to use for the Chi-squared 
test.
    +   *               Supported: `pearson` (default)
    +   * @return ChiSquaredTest object containing the test statistic, degrees 
of freedom, p-value,
    +   *         the method used, and the null hypothesis.
    +   */
    +  @Experimental
    +  def chiSquared(observed: RDD[Double],
    --- End diff --
    
    Shall we call it `chiSqTest` (following R's)? We need `test` in the method 
name because X_2 is also a distribution. I feel `chiSqTest` may be better than 
`chiSquaredTest` because it is also called `chi-square test` without `d`.


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