Fundamentals of Probability

Conditional Probability:
  • Given B is ture, probability of A is true: P(A|B)
  • Chain Rule:
    P(A, B): Both A and B are true.
    • P(A, B) = P(A|B) * P(B)
    • P(A, B, C) = P(A| B, C) * P(B| C) * P(C)
Bayes' theorem:

P( B|A) = \frac{P(B) P(A|B)}{P(A)}

P(B): prior probobility.
We use it to test the probability firstly. Whether this method is better or worse depends.

P( B|A_1, A_2) = \frac{P(B|A_1) P(A_2|B, A_1)P(A_1)}{P(A_1, A_2)}

(add A_1 to the end)
P(B| A_1): prior probability

Naive Bayes Classifier:
  • Question: how to calculate P(C|F1, F2, ..., Fn)?
  • Example: Fraud User Detection
    Prior information: Real User C0 = 77%; Fake User C1 = 23%
    Features:
    F1: Number of blogs -> s, m, l
    F2: Number of friends -> s, m, l
    F3: Real Avator or Not
    • Lemma:

      P(C| F1, F2, ..., Fn) = P(F1|C) * P(F2|C) * ... P(Fn|C) * P(C)/Z

      P(C| F1, F2, ..., Fn)
      = P(F1, F2, ..., Fn|C)*P(C)/P(F1, F2, ..., Fn)
      = P(F1, F2, ..., Fn|C)*P(C)/Z
      Because F1-Fn are all independent:
      P(F1, F2, ..., Fn|C) = P(F1|C) * P(F2|C) * ... P(Fn|C)

    • Complete Fraud User Detection:
      P(C0| F1 = S, F2 = M, F3 = R)
      = P(C0) *P(F1 = S| C0) *P(F2 = M| C0) *P(F3 = R| C0)/Z
      = 0.0623 / Z

  • Conclusion: to calculate P(C|F1, F2, ..., Fn), we first calculate P(F1, F2, ...,Fn, C) to get the prior probability.
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • pyspark.sql模块 模块上下文 Spark SQL和DataFrames的重要类: pyspark.sql...
    mpro阅读 9,554评论 0 13
  • “滴答”,“滴答”,雨儿一滴一滴的落在地上,就像一颗颗透明的钻石,操打着人们的心房,让人们抵不住那种诱惑。 ...
    朽枫阅读 373评论 0 3
  • 文/Birdstriking 喜鹊在城市的上空飞行 嘴巴里面衔着一段树枝 树枝被投入忙碌的人群 悄无声息的飞向前 ...
    文丑阅读 452评论 0 0
  • 《臆想成病》由法国喜剧大叔丹尼·伯恩主演,讲述一位患有重度洁癖的医疗咨询师年过四十尚无妻无子,害怕与异性接触...
    Juliette阅读 1,325评论 1 20
  • 那个不被父母疼爱的女孩,后面怎么样了? 本文以第一人称来描述。 我出生在一个重男轻女的家庭里,由于第一胎不是儿子,...
    嫣然一笑嫣然阅读 312评论 0 0