<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Mark Shovman on Medium]]></title>
        <description><![CDATA[Stories by Mark Shovman on Medium]]></description>
        <link>https://medium.com/@markshovman?source=rss-f00bef772e11------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*vUzA1CpbF9fZZcOi.jpg</url>
            <title>Stories by Mark Shovman on Medium</title>
            <link>https://medium.com/@markshovman?source=rss-f00bef772e11------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 07:58:19 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@markshovman/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[A Babel Tower of Binary Classification]]></title>
            <link>https://markshovman.medium.com/a-babel-tower-of-binary-classification-b1791aefa302?source=rss-f00bef772e11------2</link>
            <guid isPermaLink="false">https://medium.com/p/b1791aefa302</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[statistics]]></category>
            <category><![CDATA[testing]]></category>
            <category><![CDATA[binary-classification]]></category>
            <dc:creator><![CDATA[Mark Shovman]]></dc:creator>
            <pubDate>Sat, 22 Aug 2020 19:49:48 GMT</pubDate>
            <atom:updated>2021-05-27T11:56:54.011Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*SNwpkNcH6m82D1Ln" /><figcaption>Photo by <a href="https://unsplash.com/@m3design?utm_source=medium&amp;utm_medium=referral">Marat Gilyadzinov</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h4><strong><em>TL;DR</em></strong>: Binary Classification is a common task, but the terminology for it varies wildly between the fields. Here’s a short glossary.</h4><blockquote>“<a href="https://en.wikipedia.org/wiki/Binary_classification"><strong>Binary classification</strong></a> is the task of classifying the elements of a given set into two groups (predicting which group each one belongs to)” (Wikipedia)</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/471/1*rmmxE4m4hffw5iAqc92Y9Q.png" /><figcaption>A common visualisation of a binary classification task is a 2 by 2 table</figcaption></figure><p>Consider a pregnancy test. A person can be either pregnant or not; and a pregnancy test will either tell that the person is pregnant or that they are not. The test results are usually correct, but there might be errors.</p><p>Or consider a hurricane alert. It should come before a hurricane, but sometimes there are errors. A false alarm is bad, but a hurricane that comes without a warning is worse. Or a search for alien life. Or quality assurance protocols…</p><p>All these are binary classification tasks. They occur in many fields — medicine, psychology, machine learning, statistics, quality assurance, weather forecasting, and so on. There is even a separate Signal Detection Theory.</p><p>Unfortunately, each field seems to have its own terminology around binary classification: for instance, a kind of error when a test shows that a person is pregnant when they are not, is called ‘False Positive’ in medicine, ‘False Alarm’ in signal detection, and ‘Type I Error’ in statistics. Very confusing.</p><p>I often work in interdisciplinary teams, and time and again find myself translating a term for the same thing, from, say, machine-learning-ese to medical-ese. At some point, I compiled a short glossary, and it has helped me a lot over the years. Here it is, hope it helps you too.</p><h3>Part I — Basics</h3><p>A common way to summarise the outcomes of a binary classification task is a 2-by-2 table, called, alternatively, an error matrix, a 2x2 contingency table, or, fittingly, a confusion matrix.</p><figure><img alt="A 2-by-2 table of binary classification" src="https://cdn-images-1.medium.com/max/353/1*Eq5_fa6PeT7k9rGCCb_--Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/690/1*RUM5Qj_Ahu70TcUVLhF-3Q.png" /><figcaption>A glossary for basic elements of a confusion matrix</figcaption></figure><h3>Part II — Conditional Probabilities</h3><p>The second bundle of terminological confusion is ‘conditional probabilities’ — secondary calculations from the numbers in the confusion matrix. For instance, the probability that a pregnancy test tells someone is pregnant when they actually are (‘actually pregnant’ is the condition here). For a 2x2 case, there are eight conditional probabilities in total, and the terminology runs wild across the fields. This specific conditional probability (TP / (TP+FN)) is called, alternatively, ‘True Positive Rate’, ‘Sensitivity’, ‘Recall’, ‘Hit Rate’, and ‘Test Power’. If I missed any, please tell me and I’ll add them.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/731/1*uf-3kf1n5lLtrtPqfKq0iQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*y4mYqcxgeJyUzRNuPwnkCg.jpeg" /><figcaption>A glossary for conditional probabilities</figcaption></figure><h3>Part III — Evaluation Metrics</h3><p>The last part of where this glossary often comes useful, is the quality evaluation of a given binary classifier. Given two pregnancy tests, or several hurricane alert systems, how do we compare their quality to choose the better one? Each field seems to invent their own metric — and sometime they are the same, or very similar, but under different names.</p><p>Sometime, of course, different fields really need different metrics. For instance, in weather forecasting, there is no way to calculate the True Negatives (TN) — that would be every time that there was neither hurricane alert, nor a hurricane — and how does one count that? For these cases, the evaluation metrics have to be TN-independent — see below. If you want to read more, there’s an excellent (but longish) Wiki article <em>[2]</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MyhLdOlbzLguho_XtB68jA.png" /><figcaption>A list of evaluation metrics by field</figcaption></figure><h3>Summary</h3><p>These are basically my cuff-notes, not very organised — I just hope they help someone make sense of a new terminology in an unfamiliar field. If you have some new fields/terms to add, of just wanted to share your experience— please comment.</p><h3>Links</h3><ol><li><a href="https://en.wikipedia.org/wiki/Statistical_classification">https://en.wikipedia.org/wiki/Statistical_classification</a></li><li><a href="https://en.wikipedia.org/wiki/Evaluation_of_binary_classifiers">https://en.wikipedia.org/wiki/Evaluation_of_binary_classifiers</a></li><li><a href="https://en.wikipedia.org/wiki/Confusion_matrix">https://en.wikipedia.org/wiki/Confusion_matrix</a></li><li><a href="https://en.wikipedia.org/wiki/Sensitivity_and_specificity">https://en.wikipedia.org/wiki/Sensitivity_and_specificity</a></li><li><a href="https://en.wikipedia.org/wiki/Precision_and_recall">https://en.wikipedia.org/wiki/Precision_and_recall</a></li><li><a href="https://en.wikipedia.org/wiki/Receiver_operating_characteristic">https://en.wikipedia.org/wiki/Receiver_operating_characteristic</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b1791aefa302" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Human-generated Randomness]]></title>
            <link>https://markshovman.medium.com/human-generated-randomness-ac0e3d2f394f?source=rss-f00bef772e11------2</link>
            <guid isPermaLink="false">https://medium.com/p/ac0e3d2f394f</guid>
            <category><![CDATA[stats]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[random]]></category>
            <dc:creator><![CDATA[Mark Shovman]]></dc:creator>
            <pubDate>Sun, 10 Sep 2017 13:53:58 GMT</pubDate>
            <atom:updated>2017-09-10T14:40:20.005Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>TL;DR: when my FB friends generate long sequences of random digits, they are not really random, but not in a way I thought. In fact, the largest deviations from uniform randomness seems to be caused by the keyboard layout.</strong></p><p>Yesterday I posted on my FB:</p><blockquote>“A short experiment: could you please type a random number (long one — 10–20 digits, or even more if you feel like it) in the comments? No random number generators — I want to check human-generated randomness… Thanks! I promise I’ll post an analysis once I get enough comments.” [<a href="https://www.facebook.com/qwerty69/posts/10155756534308628">link</a>]</blockquote><p>This experiment grew out of thinking about how people overestimate the importance of random things coming in pairs (or, inversely, underestimate the actual chance of random thinds coming in pairs).</p><p>My hypothesis was that, if I ask people to give me long random numbers, then (a) single digits will be distributed reasonably uniformly, and (b) digits pairs will be distributed non-uniformly, with visible under-representation of same-digit pairs (11, 33 etc.).</p><p>A day after posting, I got 120 numbers, with 4022 digits, and decided I have enough. Not The Big Data, but probably enough to see major deviations from uniformity. (3 responses were discarded: 2 numbers with less than 10 digits, and one from YT who was being a smartass). A bit of Python-wrangling later, I had my results.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*m5CHLBqcLRHyemOIy8xzhg.png" /><figcaption>Figure 1: distribution of single digits. Red dotted line is at 10%, i.e. the amount expected given uniform randomness.</figcaption></figure><p>And immediately my first hypothesis went out of the window — single digits were not really randomnly distributed (see Figure 1). I am afraid I’m too lazy to calculate the reasonable level of deviation from expected given the amount of data, but it seems that zeros and ones are seriously undeloved, and fives get far more than their fair share. I guess that’s because most people used top keyboard row to type (corect me if I’m wrong), and a pinky is harder to lift than the index finger.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*TB_wW0oiDTlCuVkwrUtN4A.png" /><figcaption>Figure 2: distribution of same-digit pairs. Red dotted line at 1%.</figcaption></figure><p>Same-digit pairs (figure 2) were more interesting. They seem to be, in general, slightly under-represented, except when they are grossly over-represented. I claim that these results supports my hypothesis (b), with the caveat that some of my friends (AL, I’m looking at you) are smartasses who tried to outguess me by introducing, as an after-thought, long runs of the same digits.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*pMNDxIQh72rFs7lsW6Ww0w.png" /><figcaption>Figure 3: distribution of digit pairs. White is the the amount expected given uniform randomness, red is over-representation, blue is under-representation. Should’ve divided by standard deviation but couldnt’ve been bothered.</figcaption></figure><p>The most interesting graph, imho, (and the prettiest) is the overall distribution of digit pairs (Figure 3). You are welcome to look at it yourself and draw your own conclusions (and post them); what I see is that neighbouring digits (e.g. 12, 87, and especially 45 and 54) are over-represented, and, in comparison, same-digit pairs now look <em>significantly </em>under-represented (look at 55 and 44 compared to 45 and 54). So hypothesis (b) sort of holds — people seem to tend to avoid sameness when going for randomness — but a more interesting patern is that participants seemed to play the keyboard in arpeggios. Irrelevant to what I was after, but kinda cool to know.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*G1IzDsXhVc_Hp9_vwgIPSw.png" /><figcaption>Figure 4: distribution of same-digit triplets. Red dotted line at 0.1%.</figcaption></figure><p>By the way, as an afterthought, I checked same-digit triplets as well (Figure 4). There’s really not enough data to support any kind of analysis on these — I mean, the expected amount of each of these is 4 — but, yeah, someone (AL) entered a looo0000ooong string of zeroes because he thought he knew what I’m after, and it shows. Fives are over-represented too, but they are over-represented overall, so I guess that’s a different story.</p><p>That’s it, for now — looking forward to your comments.</p><p>PS. This is my first try at posting the results of my hobbyist stats experiments. What do you think? Should I keep it to myself? Is that a suitable format? Cheers.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ac0e3d2f394f" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>