public class DoubleRDDFunctions extends Object implements Logging, scala.Serializable
Constructor and Description |
---|
DoubleRDDFunctions(RDD<Object> self) |
Modifier and Type | Method and Description |
---|---|
long[] |
histogram(double[] buckets,
boolean evenBuckets)
Compute a histogram using the provided buckets.
|
scala.Tuple2<double[],long[]> |
histogram(int bucketCount)
Compute a histogram of the data using bucketCount number of buckets evenly
spaced between the minimum and maximum of the RDD.
|
double |
mean()
Compute the mean of this RDD's elements.
|
PartialResult<BoundedDouble> |
meanApprox(long timeout,
double confidence)
Approximate operation to return the mean within a timeout.
|
double |
popStdev()
Compute the population standard deviation of this RDD's elements.
|
double |
popVariance()
Compute the population variance of this RDD's elements.
|
double |
sampleStdev()
Compute the sample standard deviation of this RDD's elements (which corrects for bias in
estimating the standard deviation by dividing by N-1 instead of N).
|
double |
sampleVariance()
Compute the sample variance of this RDD's elements (which corrects for bias in
estimating the variance by dividing by N-1 instead of N).
|
StatCounter |
stats()
Return a
StatCounter object that captures the mean, variance and
count of the RDD's elements in one operation. |
double |
stdev()
Compute the population standard deviation of this RDD's elements.
|
double |
sum()
Add up the elements in this RDD.
|
PartialResult<BoundedDouble> |
sumApprox(long timeout,
double confidence)
Approximate operation to return the sum within a timeout.
|
double |
variance()
Compute the population variance of this RDD's elements.
|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
initializeLogging, initializeLogIfNecessary, initializeLogIfNecessary, isTraceEnabled, log_, log, logDebug, logDebug, logError, logError, logInfo, logInfo, logName, logTrace, logTrace, logWarning, logWarning
public DoubleRDDFunctions(RDD<Object> self)
public double sum()
public StatCounter stats()
StatCounter
object that captures the mean, variance and
count of the RDD's elements in one operation.public double mean()
public double variance()
public double stdev()
public double sampleStdev()
public double sampleVariance()
public double popStdev()
public double popVariance()
public PartialResult<BoundedDouble> meanApprox(long timeout, double confidence)
timeout
- (undocumented)confidence
- (undocumented)public PartialResult<BoundedDouble> sumApprox(long timeout, double confidence)
timeout
- (undocumented)confidence
- (undocumented)public scala.Tuple2<double[],long[]> histogram(int bucketCount)
bucketCount
- (undocumented)public long[] histogram(double[] buckets, boolean evenBuckets)
<=x<10, 10<=x<20, 20<=x<=50
And on the input of 1 and 50 we would have a histogram of 1, 0, 1
buckets
- (undocumented)evenBuckets
- (undocumented)