K - The type of the input keysV - The type of the input values
public class KMeansSampler<K,V>
extends java.lang.Object
| Constructor and Description |
|---|
KMeansSampler(double freq, int numSamples, int maxSplitsSampled)
Creates a new instance
|
KMeansSampler(org.apache.hadoop.mapreduce.lib.partition.InputSampler.Sampler<PointWritable,org.apache.hadoop.io.NullWritable> sampler)
Creates a new instance
|
| Modifier and Type | Method and Description |
|---|---|
PointWritable[] |
getSample(java.lang.Class<? extends org.apache.hadoop.mapreduce.lib.input.FileInputFormat<K,V>> inputFormatClass, java.lang.Class<? extends RecordInfoProvider<K,V>> riProviderClass, java.lang.String input, org.apache.hadoop.conf.Configuration conf)
Gets a sample of points from the input data set.
|
public KMeansSampler(double freq,
int numSamples,
int maxSplitsSampled)
freq - the portion to samplenumSamples - maximum number of samples to takemaxSplitsSampled - maximum number of splits to samplepublic KMeansSampler(org.apache.hadoop.mapreduce.lib.partition.InputSampler.Sampler<PointWritable,org.apache.hadoop.io.NullWritable> sampler)
sampler - a sampler implementationpublic PointWritable[] getSample(java.lang.Class<? extends org.apache.hadoop.mapreduce.lib.input.FileInputFormat<K,V>> inputFormatClass, java.lang.Class<? extends RecordInfoProvider<K,V>> riProviderClass, java.lang.String input, org.apache.hadoop.conf.Configuration conf) throws java.io.IOException, java.lang.InterruptedException
inputFormatClass - class used to read the input data setriProviderClass - class used to extract spatial information from input recordsinput - defines the path of the input data setconf - a job configurationjava.io.IOExceptionjava.lang.InterruptedException