Git Product home page Git Product logo

bayes's Introduction

Bayes

用java实现的贝叶斯分类算法。用于大数据的分类。 现在是大数据时代,海量数据影响着我们生活的方方面面。生活在当今时代的攻城狮,多多少少要对这个有点了解,不然就显得逼格不够高哈。大数据处理中最常用就是对数据进行分类,统计,关联分析等。这篇博客介绍下朴素贝叶斯分类算法在数据分类中的一个应用,举一个例子并使用java对其进行实现 ,借此也巩固下我所学的知识。

什么是朴素贝叶斯分类算法

回答这个问题首先要谈下什么是分类。其实这个很好理解,就比如看到一个陌生人,你通过他的穿着举止从而判断他十有八九是个程序猿,那这就是一个分类。

  1. 贝叶斯定理 对于事件A和事件B,满足以下关系: P(A|B)=P(B|A)P(A)/P(B) 其中P(B|A)表示事件A发生的条件下事件B发生的概率。但通常情况下,如果我们更需要知道事件B发生条件下事件A发生的概率时,贝叶斯定理就及其有用。
  2. 朴素贝叶斯分类算法 朴素贝叶斯分类的正式定义如下:
  • 有一个待分类项,比如举个例子,它是否是程序猿。
  • 有类别集合,这里可以理解为是一个人的各种特征。
  • 分别计算各个特征的概率。
  • 最后分析结果。比如分析出它是程序猿的概率比不是程序猿的概率大,那推测他就是。

##本项目的要求 目前我们在网上找来了有了3万多条数据,现在需要从人的性别,年龄,是否以婚,亲戚关系等14个条件来分析一个人是否所收入能超过50K。

  • 分类项C:是否工资超过50K。
  • 有类集合V:人的特征,性别,年龄,是否以婚,亲戚关系等。

##运行图如下:

bayes's People

Contributors

reallin avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

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.