This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
import szaru | |
qtl_est = szaru.QuantileEstimatorInt32(11) | |
lst = range(1001) | |
random.shuffle(lst) | |
for i in lst: | |
qtl_est.add_elem(i) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "szaru" | |
unq_est = SZaru::UniqueEstimator.new(10) | |
1000.times do |i| | |
unq_est.add_elem(i.to_s + "test") | |
end | |
puts unq_est.estimate # => 913 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <szaru.h> | |
using namespace std; | |
using namespace SZaru; | |
TopEstimator<int32_t> *topEst = TopEstimator<int32_t>::Create(3); | |
topEst->AddWeightedElem("abc", 1); | |
topEst->AddWeightedElem("def", 2); | |
topEst->AddWeightedElem("ghi", 3); | |
topEst->AddWeightedElem("def", 4); |