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.mapred.lib.InputSampler.Sampler<PointWritable,org.apache.hadoop.io.NullWritable> sampler)
Creates a new instance
|
Modifier and Type | Method and Description |
---|---|
PointWritable[] |
getSample(AbstractInputDataSet dataSet, InputDataSetConfiguratorHandler confHandler, org.apache.hadoop.conf.Configuration conf)
Gets a sample of points from the input data set.
|
PointWritable[] |
getSample(java.lang.Class<? extends org.apache.hadoop.mapred.InputFormat<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.mapred.lib.InputSampler.Sampler<PointWritable,org.apache.hadoop.io.NullWritable> sampler)
sampler
- a sampler implementationpublic PointWritable[] getSample(java.lang.Class<? extends org.apache.hadoop.mapred.InputFormat<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
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.IOException
public PointWritable[] getSample(AbstractInputDataSet dataSet, InputDataSetConfiguratorHandler confHandler, org.apache.hadoop.conf.Configuration conf) throws java.io.IOException
dataSet
- an input data set encapsulated as an AbstractInputDataSet
confHandler
- a configuration handlers used to configure the given input data setconf
- a configuration instancePointWritable
instances representing points of the samplejava.io.IOException
Copyright © 2016 Oracle and/or its affiliates. All Rights Reserved.