From Quanta Magazine:
To efficiently analyze a firehose of data, scientists first have to break big numbers into bits.
Computer programs that perform these kinds of on-the-go calculations are called streaming algorithms. Because data comes at them continuously, and in such volume, they try to record the essence of what they've seen while strategically forgetting the rest. For more than 30 years computer scientists have worked to build a better streaming algorithm. Last fall a team of researchers invented one that is just about perfect. "We developed a new algorithm that is simultaneously the best" on every performance dimension, said Jelani Nelson, a computer scientist at Harvard University and a co-author of the work with Kasper Green Larsen of Aarhus University in Denmark, Huy Nguyen of Northeastern University and Mikkel Thorup of the University of Copenhagen. This best-in-class streaming algorithm works by remembering just enough of what it's seen to tell you what it's seen most frequently. It suggests that compromises that seemed intrinsic to the analysis of streaming data are not actually necessary. It also points the way forward to a new era of strategic forgetting.
Small numbers are easier to keep track of than big numbers.
Imagine, for example, that you're monitoring a stream of numbers between zero and 50,000,000 (a task similar to logging internet users by their IP addresses). You could keep track of the numbers using a 50,000,000-term index, but it's hard to work with an index that size. A better way is to think of each eight-digit number as four two-digit numbers linked together. Say you see the number 12,345,678. One memory-efficient way to remember it is to break it into four two-digit blocks: 12, 34, 56, 78. Then you can send each block to a sub-algorithm that calculates item frequencies: 12 goes to copy one of the algorithm, 34 goes to copy two, 56 goes to copy three, and 78 goes to copy four. Each sub-algorithm maintains its own index of what it's seen, but since each version never sees anything bigger than a two-digit number, each index only runs from 0 to 99. An important feature of this splitting is that if the big number — 12,345,678 — appears frequently in your overall data stream, so will its two-digit components. When you ask each sub-algorithm to identify the numbers it has seen the most, copy one will spit out 12, copy two will spit out 34, and so on. You'll be able to find the most frequent members of a huge list just by looking for the frequent items in four much shorter lists.
I wonder if any Soylenters have heard of similar solutions.
Full Article
The paper at arxiv.org
(Score: 4, Interesting) by bob_super on Monday January 08 2018, @06:06PM (3 children)
That second paragraph ignores the boundary effects. If you cut 1299 into 12 and 99, and then your input regularly produces numbers around 1300, you're going to miss that as one part registers 12 and 13, not necessarily high enough to get tagged as significant, and the other algo cannot see that 95-to-99 and 00-to-05 hits are actually linked.
(Score: 1, Insightful) by Anonymous Coward on Monday January 08 2018, @07:18PM (2 children)
I was thinking the same: this approach loses any and all correlation between these arbitrarily-chosen buckets. To keep in the spirit of IP addresses, if your hits are coming uniformly from all RFC1918 private ip addresses, this algorithm will probably identify 10.168.0.0/16 as the most prevalent source (or worse, if the 24-bit block is underrepresented, it will identify the non-existing source 172.168.x.y).
(Score: 1) by rylyeh on Tuesday January 09 2018, @05:10AM (1 child)
I'm hearing that Bloom Clusters [sagepub.com] are the same, but this seems like a more standard tree approach to me. Of course, I didn't READ all of it.
"a vast crenulate shell wherein rode the grey and awful form of primal Nodens, Lord of the Great Abyss."
(Score: 1) by rylyeh on Tuesday January 09 2018, @05:18AM
OK - I read the details on the bloom filters and agree, on the surface it seems similar to me as well.
My original thought was this 'best' algorithm reminded me of pointer and bytes.
"a vast crenulate shell wherein rode the grey and awful form of primal Nodens, Lord of the Great Abyss."