Package pers.neige.neigeitems.utils
Object SamplingUtils
-
- All Implemented Interfaces:
public class SamplingUtils
随机采样相关工具类
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final class
SamplingUtils.SamplingResult
-
Field Summary
Fields Modifier and Type Field Description public final static SamplingUtils
INSTANCE
-
Method Summary
Modifier and Type Method Description final static <T extends Any> List<T>
aExpj(Map<T, Double> samples, Integer amount)
加权随机采样. final static <T extends Any> List<T>
aExpj(List<Pair<T, Double>> samples, Integer amount)
加权随机采样. final static <T extends Any> List<T>
weight(Map<T, Double> samples, Integer amount)
加权随机采样. final static <T extends Any> List<T>
weight(List<Pair<T, Double>> samples, Integer amount)
加权随机采样. final static <T extends Any> T
weight(Map<T, Double> samples)
加权随机采样. final static <T extends Any> T
weight(Map<T, Double> samples, Double total)
加权随机采样. final static <T extends Any> T
weight(List<Pair<T, Double>> samples)
加权随机采样. final static <T extends Any> T
weight(List<Pair<T, Double>> samples, Double total)
加权随机采样. final static <T extends Any> List<SamplingUtils.SamplingResult<T>>
weightWithIndex(List<Pair<T, Double>> samples, Integer amount)
加权随机采样. final static <T extends Any> SamplingUtils.SamplingResult<T>
weightWithIndex(List<Pair<T, Double>> samples)
加权随机采样. final static <T extends Any> SamplingUtils.SamplingResult<T>
weightWithIndex(List<Pair<T, Double>> samples, Double total)
加权随机采样. -
-
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:
采样结果
-
weightWithIndex
final static <T extends Any> List<SamplingUtils.SamplingResult<T>> weightWithIndex(List<Pair<T, Double>> samples, Integer amount)
加权随机采样.
- Parameters:
samples
- 样本集amount
- 采样数量- Returns:
采样结果
-
weightWithIndex
final static <T extends Any> SamplingUtils.SamplingResult<T> weightWithIndex(List<Pair<T, Double>> samples)
加权随机采样.
- Parameters:
samples
- 样本集- Returns:
采样结果
-
weightWithIndex
final static <T extends Any> SamplingUtils.SamplingResult<T> weightWithIndex(List<Pair<T, Double>> samples, Double total)
加权随机采样.
- Parameters:
samples
- 样本集total
- 权重和- Returns:
采样结果
-
-
-
-