Giter Site home page Giter Site logo

smstrash's Introduction

关于贝叶斯二择一形式公式的几点说明:
1.普通的贝叶斯公式:
P(A|B)={\frac {P(B|A)\,P(A)}{P(B)}}
2.二择一形式:
P(B)=P(A,B)+P(A^{C},B)=P(B|A)P(A)+P(B|A^{C})P(A^{C})
其中A^C为A的补集,也可以这样理解成(1-A),结合以上1,2两个式子,我们可以得到下面这个式子3
3. 二分类中的式子:
P(A|B)={\frac {P(B|A)\,P(A)}{P(B|A)P(A)+P(B|A^{C})P(A^{C})}}.,\!
但是上面这个式子明显是在两个条件的一个贝叶斯概率计算情况,但是在一般情况下,都不是两个,这个可以扩展到N个条件下,预测贝叶斯概率事件,推倒一般公式,我们可以先从三个条件的开始.:
4 推倒过程:
P(C|AB)=P(AB|C)*P(C)/P(AB) (4.1)
P(AB|C) = P(A|C)*P(B|C) (4.2)
P(AB) = P(A)*P(B) (4.3)
从上面4.1,4.2,4.3三个式子中,我们就可以将一个三个条件的降为多个两个条件的贝叶斯概率事件了.
P(C|AB) = {P(C)P(A|C)*P(B|C)}/{P(A)P(B)}
,我们在将其写成一般式子
P(C|EAi) = {P(C)P(EAi|C)}/{P(EAi)},然后我们将这个式子代入到我们的计算中,就可以用来简单的预测短信是否是垃圾信息啦~
5. 关于数据集合,从这个地址地方下载的http://archive.ics.uci.edu/ml/
6. 结果展示:
Rofl. Its true to its name>>>>>>|| result( prob spam ): --> 0.15844183241
Free Msg: Ringtone!From: http://tms. widelive.com/index. wml?id=1b6a5ecef91ff9
37819&first=true18:0430-JUL-05>>>>>>|| result( prob spam ): --> 1.0
龚细军>>>>>>|| result( prob spam ): --> 0.5
speak haha>>>>>>|| result( prob spam ): --> 0.00302526687657
helo,there is a ads>>>>>>|| result( prob spam ): --> 0.997563452806

smstrash's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

smstrash's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.