GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - greeye/Naive_Bayes: 基于朴素贝叶斯的新闻分类实战

BranchesTags
Open more actions menu

Latest commit

 

History

7 Commits
7 Commits

Folders and files

NameName
Last commit message
Last commit date
Machine_Learning/Collaborative_Filtering
Machine_Learning/Collaborative_Filtering
 
 
data_structures_and_algorithm/leetcode/String
data_structures_and_algorithm/leetcode/String
 
 
Chinese_Bayes.py
Chinese_Bayes.py
 
 
English_Bayes.py
English_Bayes.py
 
 
README.md
README.md
 
 
Readme.txt
Readme.txt
 
 

Repository files navigation

基于朴素贝叶斯的新闻分类

本项目主要包括拉普拉斯平滑、 垃圾邮件过滤(Python3)、 新浪新闻分类(sklearn)。

一、拉普拉斯平滑

利用贝叶斯分类器对文档进行分类时,要计算多个概率的乘积以获得文档属于某个类别的概率,即计算p(w0|1)p(w1|1)p(w2|1)。如果其中有一个概率值为0,那么最后的结果也为0。拉斯拉普平滑是为了解决上问题的一种方法。本文使用的是加1平滑的拉斯拉普平滑,可以有效地解决0概率问题。

二、垃圾邮件过滤

使用贝叶斯对电子邮件进行分类的步骤:

  1. 收集数据:数据集来自新浪新闻
  2. 准备数据:将文本文件解析成词条向量
  3. 分析数据:检查词条的正确性
  4. 训练算法模型:使用 建立的 trainNB0()函数
  5. 测试算法模型:使用classifyNB(),并构建一个新的测试函数来进行计算文档集的错误率
  6. 数据导入模型分类:构建一个完整的程序对一组文档进行分类

三、新闻分类

  1. 数据准备阶段:使用jieba 对新闻中文语句进行切分。
  2. 文本特征选择:将所有的文本分为训练集和测试集样本,并对训练集中的所有单词进行词频统计和降序排序。
  3. 特征值筛选: 筛选掉一些对分类无影响的高频词
  4. 建模分类: Sklearn构建朴素贝叶斯分类器

About

基于朴素贝叶斯的新闻分类实战

Resources

Readme
Activity

Stars

3 stars

Watchers

1 watching

Forks

1 fork
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.