Github user MechCoder commented on the pull request:
https://github.com/apache/spark/pull/6383#issuecomment-104984400
Note: In master
import org.apache.commons.math3.distribution.NormalDistribution
import org.apache.spark.mllib.stat.KernelDensity
val rdd = sc.parallelize(Array(5.0))
val evaluationPoints = Array(5.0, 6.0)
val densities = new
KernelDensity().setSample(rdd).setBandwidth(3.0).estimate(evaluationPoints)
val normal = new NormalDistribution(5.0, 3.0)
densities(0) - normal.density(5.0)
res1: Double = -0.06649038006690546
val rdd = sc.parallelize(Array(5.0, 10.0))
val evaluationPoints = Array(5.0, 6.0)
val densities = new
KernelDensity().setSample(rdd).setBandwidth(3.0).estimate(evaluationPoints)
val normal1 = new NormalDistribution(5.0, 3.0)
val normal2 = new NormalDistribution(10.0, 3.0)
densities(0) - (normal1.density(5.0) + normal2.density(5.0)) / 2
res2: Double = -0.04153495159951512
Hence the tests pass
cc @jkbradley @mengxr
---
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]