当前位置:网站首页>Naive bayes
Naive bayes
2022-08-05 10:57:00 【Ding Jiaxiong】
12. Naive Bayes
Article table of contents
12.1 Introduction
Categories
12.2 Basics of Probability
12.2.1 Definition of probability
- The likelihood of an event happening
- P(X) : value in [0, 1]
12.2.2 Joint Probabilities
- Contains multiple conditions, and the probability that all conditions are met at the same time
- Denoted as: P(A,B)
12.2.3 Conditional Probabilities
- Probability of event A when another event B has already occurred
- Denoted as: P(A|B)
12.2.4 independent of each other
- If P(A, B) = P(A)P(B), then event A and event B are said to be independent of each other
12.2.5 Bayesian Formula
12.2.6 Naive Bayes
- A Bayesian formula that assumes independence between features
12.3 API
sklearn.naive_bayes.MultinomialNB(alpha = 1.0)
- Naive Bayesian Classification
- alpha: Laplace smoothing coefficient
12.4 Algorithm Summary
12.4.1 Advantages
- Naive Bayesian model originated from classical mathematical theory and has stable classification efficiency
- It is less sensitive to missing data and the algorithm is relatively simple, which is often used for text classification
- High classification accuracy and fast speed
12.4.2 Disadvantages
- It does not work well if the feature attributes are correlated due to the assumption of sample attribute independence
- The prior probability needs to be calculated, and the prior probability often depends on the hypothesis. There can be many kinds of hypothetical models, so in some cases, the prediction effect will be poor due to the hypothesized prior model.
12.4.3 Principles of NB
Naive Bayes is a classification method based on Bayes' theorem and the assumption of feature condition independence
- For a given item xx to be classified, calculate the posterior probability distribution through the learned model,
- That is: the probability of each target category appearing under the condition that this item appears, and the category with the largest posterior probability is taken as the category to which xx belongs.
12.4.4 Why Simple
- When calculating the conditional probability distribution P(X=x∣Y=c_k), NB introduces a strong conditional independence assumption, that is, when Y is determined, the values of each feature component of X are independent of each other
12.4.5 Why is the conditional independence assumption introduced
- In order to avoid the problem of combinatorial explosion and sample sparseness when solving Bayes' theorem
12.4.6 What should I do if the probability is 0 when estimating the conditional probability P(X∣Y)
Introduce λ
- When λ=0, it is an ordinary maximum likelihood estimation
- When λ=1, it is called Laplace smoothing
12.4.7 Difference between Naive Bayes and LR
One
- Naive Bayes is a generative model
- LR is a discriminant model
Two
- Naive Bayes is based on a strong assumption of conditional independence (under the condition that the classification Y is known, the values of each feature variable are independent of each other)
- LR does not require this
Three
- Naive Bayes is suitable for small datasets
- LR is suitable for large datasets
边栏推荐
- PPOCR 检测器配置文件参数详解
- 登录功能和退出功能(瑞吉外卖)
- SQL外连接之交集、并集、差集查询
- Android 开发用 Kotlin 编程语言一 基本数据类型
- FPGA:基础入门LED灯闪烁
- Chapter 4: activiti RuntimeService settings get and get process variables, and the difference from taskService, set process variables when starting and completing tasks [easy to understand]
- 智源社区AI周刊No.92:“计算复杂度”理论奠基人Juris Hartmanis逝世;美国AI学生九年涨2倍,大学教师短缺;2022智源大会观点报告发布[附下载]
- The fuse: OAuth 2.0 four authorized login methods must read
- nyoj86 找球号(一) set容器和二分 两种解法
- 产品太多了,如何实现一次登录多产品互通?
猜你喜欢

ECCV 2022 | 视听分割:全新任务,助力视听场景像素级精细化理解

PostgreSQL 2022 报告:流行度上涨,开源、可靠性和扩展是关键

.NET深入解析LINQ框架(六:LINQ执行表达式)

Dynamics 365Online PDF导出及打印

阿里全新推出:微服务突击手册,把所有操作都写出来了PDF

linux下oracle常见操作以及日常积累知识点(函数、定时任务)

Common operations of oracle under linux and daily accumulation of knowledge points (functions, timed tasks)

How to choose coins and determine the corresponding strategy research

Use KUSTO query statement (KQL) to query LOG on Azure Data Explorer Database

电气工程的标准是什么
随机推荐
Score interview (1)----related to business
如何测试一下现场的备机失败,转发主机的场景?
【MySQL基础】-【数据处理之增删改】
用KUSTO查询语句(KQL)在Azure Data Explorer Database上查询LOG实战
gradle尚硅谷笔记
工程设备在线监测管理系统自动预警功能
【加密解密】明文加密解密-已实现【已应用】
Go compilation principle series 6 (type checking)
提取人脸特征的三种方法
结合“xPlus”探讨软件架构的创新与变革
The fuse: OAuth 2.0 four authorized login methods must read
[Android]如何使用RecycleView in Kotlin project
.NET深入解析LINQ框架(六:LINQ执行表达式)
Go学习笔记(篇二)初识Go
#yyds干货盘点#【愚公系列】2022年08月 Go教学课程 001-Go语言前提简介
时间格式2020-01-13T16:00:00.000Z中的T和Z分别表示什么,如何处理
Oracle的自动段空间管理怎么关闭?
导火索:OAuth 2.0四种授权登录方式必读
字节一面:TCP 和 UDP 可以使用同一个端口吗?
FPGA: Basic Getting Started LED Lights Blinking


