Class SamplingParams


  • public class SamplingParams
    extends Object
    Parameters for sampling, dictating whether sampling is to take place and how.
    WARNING: This API is experimental and might change in incompatible ways in the next release.
    • Constructor Detail

      • SamplingParams

        public SamplingParams()
    • Method Detail

      • getSamplingThreshold

        public final int getSamplingThreshold()
        Return the samplingThreshold. Sampling would be performed only for document sets larger than this.
      • setMaxSampleSize

        public void setMaxSampleSize​(int maxSampleSize)
        Parameters:
        maxSampleSize - the maxSampleSize to set
        See Also:
        getMaxSampleSize()
      • setMinSampleSize

        public void setMinSampleSize​(int minSampleSize)
        Parameters:
        minSampleSize - the minSampleSize to set
        See Also:
        getMinSampleSize()
      • setSampleRatio

        public void setSampleRatio​(double sampleRatio)
        Parameters:
        sampleRatio - the sampleRatio to set
        See Also:
        getSampleRatio()
      • setSampingThreshold

        public void setSampingThreshold​(int sampingThreshold)
        Set a sampling-threshold
        See Also:
        getSamplingThreshold()
      • validate

        public boolean validate()
        Check validity of sampling settings, making sure that
        • minSampleSize <= maxSampleSize <= samplingThreshold
        • 0 < samplingRatio <= 1
        Returns:
        true if valid, false otherwise
      • getOversampleFactor

        public final double getOversampleFactor()
        Return the oversampleFactor. When sampling, we would collect that much more results, so that later, when selecting top out of these, chances are higher to get actual best results. Note that having this value larger than 1 only makes sense when using a SampleFixer which finds accurate results, such as TakmiSampleFixer. When this value is smaller than 1, it is ignored and no oversampling takes place.
      • setOversampleFactor

        public void setOversampleFactor​(double oversampleFactor)
        Parameters:
        oversampleFactor - the oversampleFactor to set
        See Also:
        getOversampleFactor()