`
varsoft
  • 浏览: 2570024 次
  • 性别: Icon_minigender_1
  • 来自: 上海
文章分类
社区版块
存档分类
最新评论

Intuition out of counter-intuition

阅读更多
Intuition out of counter-intuition
刘未鹏
C++的罗浮宫(http://blog.csdn.net/pongba)

Lately I stumbled across an interesting article about Bayes Theorem( you can find it here - please read it first( it's a pretty enjoyable article), otherwise you might not know what I'm talking about). The article is entitled "It's not so easy to predict murder, do the math".

As interesting as the writing is, the most intriguing part of it is the application of Bayes Theorem to calculate the chance of a correct guess when deducing if someone is a potential murder.

It turns out that, when the percentage of people who're potential murders becomes low, the odds that the psychiatrist makes a wrong guess about whether one is a potential murder becomes high.

For instance, let's assume that the "specificity" of a murder-prediction made by a psychiatrists is 99.9%, and the "sensitivity" 99.9%, too, then for, say, 10,000 people, of which 150 are potential murders, the chance that one, when predicted as a murder, would actually be a murder is about 150/151, which is a pretty high one.

But then it dives into the counter-intuitive part.

Assume only 1 out of 10,000 people are actually potential murders, then the chance that a predicted murder is actually a potential one is 1/2(50%), which suggests a pretty high chance that the psychiatrist could've been wrong.

However, the point is, when someone says that something is counter-intuitive, there's a good chance that we can find something underneath that is intuitive again. That is, the reason people are calling it counter-intuitive is just that they get something wrong along the line, which eventually leads to the counter-intuition.

In this particular case. The confusion roots in the understanding of the specificity/sensitivity of a murder-prediction. As was told, the specificity and the sensitivity are both 99.9%. This can give us a false-belief that the prediction is a highly accurate one, which, because of the vagueness of human natural language, can in turn lead us to the belief that, whatever the context is, a predicted murder is, of the probability 99.9%, an actual potential murder. And therein lies the problem.

Let's recap the definition of "specificity" and "sensitivity": when we say that the sensitivity of a prediction is 99.9%, that means that if one is actually something, then there's a pretty high chance(99.9%) that he/she is predicted as something. Similarly, a specificity of 99.9% suggests that when one isn't something, there's a pretty high chance(99.9%) that he/she isn't predicted as something. In terms of mathematic language, this is to say: P(Pred(A)|A) = 99.9% and P(~Pred(A)|~A) = 99.9%.

Now recall that we thought of this differently. Actually we thought that "a predicted murder is, of the probability 99.9%, an actual potential murder". In terms of mathematics, this is to say: P(A|Pred(A)) = 99.9%, which is of the reverse form w.r.t. the definition of sensitivity. And this is exactly the source of all the counter-intuition.

Once we've captured the essence of the definition of "specificity" and "sensitivity"( note that they could, if the same, be referred to as "accuracy" collectively), the left job is easy - we just need to use the Bayes Theorem mechanically:

Let A = "one is potentially a murder"; Pred(A) = "one is predicted as a potential murder".

preconditions:
P(Pred(A)|A) = 99.9%; P(~Pred(A)|A) = 0.1%;
P(~Pred(A)|~A) = 99.9%; P(Pred(A)|~A) = 0.1%;

Bayes Theorem application:
P(A|Pred(A)) = (P(Pred(A)|A)*P(A))/P(Pred(A)) ;
where P(Pred(A)) = P(A)*P(Pred(A)|A) + P(~A)*P(Pred(A)|~A).

Now assume we have 10,000 people accepting the test, 1 of them is actually potentially a murder.
Then we'd have P(A) = 0.0001; P(~A) = 1-P(A) = 0.9999; Plug them into the equation above, we have:

P(A|Pred(A)) = (0.999*0.0001)/(0.0001*0.999+0.9999*0.001) ~= 1/10;
This implies that, if one is predicted as a potential murder, then there's only a 1/10 probability that he/she is actually one. Pretty embarrassing result, isn't it?

And if we adjust P(~Pred(A)|~A) - the specificity - to 99.99%, which is the original setting of the article in question. This'll become:
P(A|Pred(A)) = (0.999*0.0001)/(0.0001*0.999+0.9999*0.0001) ~= 1/2;
which is still pretty rough.

As it turned out, when the percentage of people who're actually potential murders becomes very low, the specificity becomes critical and it practically dominates the result. That's why in some scenarios where the samples that satisfy some particular conditions are rare, the specificity of the test is extremely important; straightly put, when the sample set is large and the percentage of the object samples is very low, one more(or fewer) '9' at the tail of the specificity would've changed the result dramatically.

A related example comes from data-mining, where you may construct a predictor/classifier to predict if one has cancer. And because of the severe percentage of patients who actually have cancer, a seemingly high sensibility or specificity isn't enough; it may classify those who doesn't have cancer correctly at a very high score, but as long as one or a few wrong predictions w.r.t. the cancer-having patients occur, the result would be bad. Hence in those situations, often some other techniques are used as supplements.

But, you may ask, then why isn't the accuracy of a prediction defined as P(A|Pred(A)) in the first place? This way we'd never have to do such tedious calculation. The reason is actually a simple one: the sample set of Pred(A) is usually too small( for instance, how many of a general group of people have aids?) to draw a reasonablly accurate P(A|Pred(A)) from. The sample set of A, on the other hand, is usually large enough to draw a reasonably accurate approximation of P(Pred(A)|A) from.

Another way to look at this issue:

Consider the Bayes Theorem:

P(A|B) = (P(B|A)*P(A))/P(B).

Let's rewrite it a little bit:

P(A|B) = P(B|A)* (P(A)/P(B)).

This way we can see clearly that P(A|B) is proportional to P(B|A), provided that P(B) and P(A) are fixed. An immediate conclusion is that, the higher/lower the accuracy of murder-detection is, the higher/lower the probability that one is actually a potential murder when predicted as one is; and vice versa. Actually, This kinda conforms to our intuition - the higher the probability that B occurs when A occurs, the higher the probability that A occurs when B occurs.

The tricky part, though, lies in the proportion factor(i.e. P(B)/P(A)).

Let's still take murder-detection as our example, then A would mean "one is actually a potential murder" and B "one is predicted as a potential murder"(i.e. Pred(A)). If we're concerned about the precise number, we must take into account the proportion of actual potential murders as oppose to that of those who're not. Given the original setting(i.e. 1 out of 10,000 people are actually potential murders), we can readily calculate P(B)/P(A), which is what effected the final result.

This would be even clearer if we draw a little ven diagram, though. But I lack the time and patience to do that. So you may draw it and see for it yourself.

分享到:
评论

相关推荐

    机器学习基石 7 - 3 - Physical Intuition of VC Dimension (6-11).mp4

    机器学习基石 7 - 3 - Physical Intuition of VC Dimension (6-11).mp4

    Intuition

    在IT领域,尤其是在设计和视觉传达方面,"Intuition"可能指的是一个特定的字体或设计风格,这从提供的标签“字体”可以推断出来。在我们的案例中,它似乎关联了两个文件:`Intuition1.GIF`和`Intuition.ttf`。 `...

    PyPI 官网下载 | intuition-0.2.2.dev.tar.gz

    《PyPI官网下载 | intuition-0.2.2.dev.tar.gz——深入了解Python库的发布与使用》 在Python的世界里,PyPI(Python Package Index)是最重要的资源库,它为全球开发者提供了一个集中分享和下载Python软件包的平台...

    ch09-creaturewar-Intuition121-RJT:ch09-creaturewar-Intuition121-RJT由GitHub Classroom创建

    【标题】"ch09-creaturewar-Intuition121-RJT:ch09-creaturewar-Intuition121-RJT由GitHub Classroom创建"指的是一个编程项目,源自GitHub Classroom,可能是一个教学环境下的练习或课程作业。"CreatureWar2"可能是...

    the intuition behind blacklitterman model portfolios.pdf

    Black-Litterman模型是投资组合优化领域中的一个重要工具,由 Fischer Black 和 Robert Litterman 在1991和1992年提出。这个模型在金融业界广泛应用,因其能够将市场均衡预期收益与投资者的主观观点相结合而备受青睐...

    【6】Going deeper with convolutions.pdf

    the intuition of multi-scale processing. One particular incarnation used in our submission for ILSVRC14 is called GoogLeNet, a 22 layers deep network, the quality of which is assessed in the context ...

    Going Deeper with Convolutions

    To optimize quality, the architectural decisions were based on the Hebbian principle and the intuition of multi-scale processing. One particular incarnation used in our submission for ILSVRC14 is ...

    Cost Function - Intuition I.vtt

    机器学习的视频 中文字幕 Cost Function - Intuition I

    Elementary Linear Algebra 6th Edition

    This program balances theory with examples, applications, and geometric intuition for a complete, step-by-step learning system. Featuring a new design that highlights the relevance of the mathematics...

    2008_Power Distribution Networks with On-Chip Decoupling Capacitors

    The book provides insight and intuition into the behavior and design of on-chip power distribution systems. This book has four primary objectives. The first objective is to describe the ...

    PCA-Tutorial-Intuition_jp.pdf

    ### 主成分分析(PCA)详解 #### 概览与引言 主成分分析(Principal Component Analysis,简称PCA)是现代数据分析领域中一个不可或缺的技术。它作为一种简单、非参数化的手段,能够有效地从复杂数据集中提取出...

    He_Litterman_1999.m_blackLitterMan_

    根据He Litterman 1999的重要论文《intuition behind the Black-Litterman model portfolios》写出来的matlab代码,输入输出和论文中的是一致的,也就是代码肯定是正确的。上面还附有一些解释,学习Black Litterman ...

    Statistical Reinforcement Learning - Modern Machine Learning Approaches

    Numerous illustrative examples are included to help readers understand the intuition and usefulness of reinforcement learning techniques. This book is an ideal resource for graduate-level students ...

    iNTUition-RESTAPIWorkshop:iNTUition REST API研讨会

    由为iNTUition hackathon设计 该讲习班采用动手实践的方法来学习REST API的基础知识。 您将学习REST API的类型,请求和响应的组成部分,如何调用REST API以及创建自己的其余API。 熟悉和将在此研讨会中为您提供帮助...

    Numerical Recipes 3rd Edition: The Art of Scientific Computing

    Radiative processes are treated with just the right level of rigor that students learn how to carry out useful computations while developing their physical intuition. I have successfully used ...

    Statistical Monitoring of Clinical Trials(Lemuel A. Moyé, 2005)

    Clearly presenting the necessary background with limited use of mathematics, this book increases the knowledge, experience, and intuition of investigations in the use of these important procedures ...

    Mastering Machine Learning with scikit-learn [2017,第二版]

    By the end of this book, you will master all required concepts of scikit-learn to build efficient models at work to carry out advanced tasks with the practical approach. What you will learn Review ...

Global site tag (gtag.js) - Google Analytics