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(<any> sampler)
Creates a new instance
|
KMeansSampler(double freq, int numSamples, int maxSplitsSampled)
Creates a new instance
|
| Modifier and Type | Method and Description |
|---|---|
PointWritable[] |
getSample(AbstractInputDataSet dataSet, InputDataSetConfiguratorHandler confHandler, Configuration conf)
Gets a sample of points from the input data set.
|
PointWritable[] |
getSample(java.lang.Class<? extends <any>> inputFormatClass, java.lang.Class<? extends RecordInfoProvider<K,V>> riProviderClass, java.lang.String input, Configuration conf)
Gets a sample of points from the input data set.
|
public KMeansSampler(<any> sampler)
sampler - a sampler implementation
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 PointWritable[] getSample(AbstractInputDataSet dataSet, InputDataSetConfiguratorHandler confHandler, Configuration conf) throws java.io.IOException
dataSet - an input data set encapsulated as an AbstractInputDataSetconfHandler - a configuration handlers used to configure the given input data setconf - a configuration instancePointWritable instances representing points of the samplejava.io.IOExceptionpublic PointWritable[] getSample(java.lang.Class<? extends <any>> inputFormatClass, java.lang.Class<? extends RecordInfoProvider<K,V>> riProviderClass, java.lang.String input, 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.IOExceptionCopyright © 2016 Oracle and/or its affiliates. All Rights Reserved.