Object SamplingUtils

  • All Implemented Interfaces:

    
    public class SamplingUtils
    
                        

    随机采样相关工具类

    • Constructor Detail

    • Method Detail

      • aExpj

        @Deprecated(message = "啥也不是, 折腾半天比无脑整还慢", replaceWith = @ReplaceWith(imports = {"pers.neige.neigeitems.utils.SamplingUtils.weight"}, expression = "weight(samples, amount)")) final static <T extends Any> List<T> aExpj(Map<T, Double> samples, Integer amount)

        加权随机采样.

        Parameters:
        samples - 样本集
        amount - 采样数量
        Returns:

        采样结果

      • aExpj

        @Deprecated(message = "啥也不是, 折腾半天比无脑整还慢", replaceWith = @ReplaceWith(imports = {"pers.neige.neigeitems.utils.SamplingUtils.weight"}, expression = "weight(samples, amount)")) final static <T extends Any> List<T> aExpj(List<Pair<T, Double>> samples, Integer amount)

        加权随机采样.

        Parameters:
        samples - 样本集
        amount - 采样数量
        Returns:

        采样结果

      • weight

         final static <T extends Any> List<T> weight(Map<T, Double> samples, Integer amount)

        加权随机采样.

        Parameters:
        samples - 样本集
        amount - 采样数量
        Returns:

        采样结果

      • weight

         final static <T extends Any> List<T> weight(List<Pair<T, Double>> samples, Integer amount)

        加权随机采样.

        Parameters:
        samples - 样本集
        amount - 采样数量
        Returns:

        采样结果

      • weight

         final static <T extends Any> T weight(Map<T, Double> samples)

        加权随机采样.

        Parameters:
        samples - 样本集
        Returns:

        采样结果

      • weight

         final static <T extends Any> T weight(Map<T, Double> samples, Double total)

        加权随机采样.

        Parameters:
        samples - 样本集
        total - 权重和
        Returns:

        采样结果

      • weight

         final static <T extends Any> T weight(List<Pair<T, Double>> samples)

        加权随机采样.

        Parameters:
        samples - 样本集
        Returns:

        采样结果

      • weight

         final static <T extends Any> T weight(List<Pair<T, Double>> samples, Double total)

        加权随机采样.

        Parameters:
        samples - 样本集
        total - 权重和
        Returns:

        采样结果