本文整理了Java中com.clearspring.analytics.stream.cardinality.HyperLogLog.linearCounting()
方法的一些代码示例,展示了HyperLogLog.linearCounting()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。HyperLogLog.linearCounting()
方法的具体详情如下:
包路径:com.clearspring.analytics.stream.cardinality.HyperLogLog
类名称:HyperLogLog
方法名:linearCounting
暂无
代码示例来源:origin: addthis/stream-lib
@Override
public long cardinality() {
double registerSum = 0;
int count = registerSet.count;
double zeros = 0.0;
for (int j = 0; j < registerSet.count; j++) {
int val = registerSet.get(j);
registerSum += 1.0 / (1 << val);
if (val == 0) {
zeros++;
}
}
double estimate = alphaMM * (1 / registerSum);
if (estimate <= (5.0 / 2.0) * count) {
// Small Range Estimate
return Math.round(linearCounting(count, zeros));
} else {
return Math.round(estimate);
}
}
代码示例来源:origin: addthis/stream-lib
H = HyperLogLog.linearCounting(count, zeros);
} else {
H = estimatePrime;
return Math.round(HyperLogLog.linearCounting(sm, sm - sparseSet.length));
代码示例来源:origin: com.addthis/stream-lib
@Override
public long cardinality() {
double registerSum = 0;
int count = registerSet.count;
double zeros = 0.0;
for (int j = 0; j < registerSet.count; j++) {
int val = registerSet.get(j);
registerSum += 1.0 / (1 << val);
if (val == 0) {
zeros++;
}
}
double estimate = alphaMM * (1 / registerSum);
if (estimate <= (5.0 / 2.0) * count) {
// Small Range Estimate
return Math.round(linearCounting(count, zeros));
} else {
return Math.round(estimate);
}
}
代码示例来源:origin: com.addthis/stream-lib
H = HyperLogLog.linearCounting(count, zeros);
} else {
H = estimatePrime;
return Math.round(HyperLogLog.linearCounting(sm, sm - sparseSet.length));
内容来源于网络,如有侵权,请联系作者删除!