|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Object org.apache.spark.mllib.stat.KernelDensity
public class KernelDensity
:: Experimental :: Kernel density estimation. Given a sample from a population, estimate its probability density function at each of the given evaluation points using kernels. Only Gaussian kernel is supported.
Scala example:
val sample = sc.parallelize(Seq(0.0, 1.0, 4.0, 4.0))
val kd = new KernelDensity()
.setSample(sample)
.setBandwidth(3.0)
val densities = kd.estimate(Array(-1.0, 2.0, 5.0))
Constructor Summary | |
---|---|
KernelDensity()
|
Method Summary | |
---|---|
double[] |
estimate(double[] points)
Estimates probability density function at the given array of points. |
static double |
normPdf(double mean,
double standardDeviation,
double logStandardDeviationPlusHalfLog2Pi,
double x)
Evaluates the PDF of a normal distribution. |
KernelDensity |
setBandwidth(double bandwidth)
Sets the bandwidth (standard deviation) of the Gaussian kernel (default: 1.0 ). |
KernelDensity |
setSample(JavaRDD<Double> sample)
Sets the sample to use for density estimation (for Java users). |
KernelDensity |
setSample(RDD<Object> sample)
Sets the sample to use for density estimation. |
Methods inherited from class Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public KernelDensity()
Method Detail |
---|
public static double normPdf(double mean, double standardDeviation, double logStandardDeviationPlusHalfLog2Pi, double x)
public KernelDensity setBandwidth(double bandwidth)
1.0
).
bandwidth
- (undocumented)
public KernelDensity setSample(RDD<Object> sample)
sample
- (undocumented)
public KernelDensity setSample(JavaRDD<Double> sample)
sample
- (undocumented)
public double[] estimate(double[] points)
points
- (undocumented)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |