
- Data Structures & Algorithms
- DSA - Home
- DSA - Overview
- DSA - Environment Setup
- Algorithm
- DSA - Algorithms Basics
- DSA - Asymptotic Analysis
- DSA - Greedy Algorithms
- DSA - Divide and Conquer
- DSA - Dynamic Programming
- Data Structures
- DSA - Data Structure Basics
- DSA - Data Structures and Types
- DSA - Array Data Structure
- Linked Lists
- DSA - Linked List Basics
- DSA - Doubly Linked List
- DSA - Circular Linked List
- Stack & Queue
- DSA - Stack
- DSA - Expression Parsing
- DSA - Queue
- Searching Techniques
- DSA - Linear Search
- DSA - Binary Search
- DSA - Interpolation Search
- DSA - Hash Table
- Sorting Techniques
- DSA - Sorting Algorithms
- DSA - Bubble Sort
- DSA - Insertion Sort
- DSA - Selection Sort
- DSA - Merge Sort
- DSA - Shell Sort
- DSA - Quick Sort
- Graph Data Structure
- DSA - Graph Data Structure
- DSA - Depth First Traversal
- DSA - Breadth First Traversal
- Tree Data Structure
- DSA - Tree Data Structure
- DSA - Tree Traversal
- DSA - Binary Search Tree
- DSA - AVL Tree
- DSA - Red Black Trees
- DSA - B Trees
- DSA - B+ Trees
- DSA - Splay Trees
- DSA - Spanning Tree
- DSA - Tries
- DSA - Heap
- Recursion
- DSA - Recursion Basics
- DSA - Tower of Hanoi
- DSA - Fibonacci Series
- DSA Useful Resources
- DSA - Questions and Answers
- DSA - Quick Guide
- DSA - Useful Resources
- DSA - Discussion
Bayes’ Rule in Data Structure
A way to update our beliefs depended on the arrival of new, relevant pieces of evidence are provided by Bayes rule. For example, if we were trying to provide the probability that a given person has cancer, we would initially just conclude it is whatever percent of the population has cancer. However, given extra evidence such as the fact that the person is a smoker, we can update our probability, since the probability of having cancer is greater given that the person is a smoker. This allows us to utilize prior knowledge to improve our probability estimations.
The rule is explained below -
$$P\lgroup C|D \rgroup=\frac{P \lgroup D|C \rgroup P \lgroup C \rgroup}{P\lgroup D \rgroup}$$
In this formula, C is the event we want the probability of, and D is the new evidence that is related to C in some way.
P(C|D) is denoted as the posterior; this is what we are trying to estimate. In the above example, it is concluded that the “probability of having cancer given that the person is a smoker”.
P(D|C) is denoted as the likelihood; this is the probability of observing the new evidence, provided our initial hypothesis. In the above example, it is concluded that the “probability of being a smoker given that the person has cancer”.
P(C) is denoted as prior; this is the probability of our hypothesis without any extra prior information. In the above example, it is concluded that the “probability of having cancer”.
P(D) is denoted as the marginal likelihood; this is the total probability of observing the evidence. In the above example, it is concluded that the “probability of being a smoker”. In several applications of Bayes Rule, this is ignored, as it mainly serves as normalization.
- Related Articles
- Rectangle Data in Data Structure
- Multilevel Association Rule in data mining
- Quadtrees in Data Structure
- Deaps in Data Structure
- Arrays Data Structure in Javascript
- Stack Data Structure in Javascript
- Queue Data Structure in Javascript
- Set Data Structure in Javascript
- Dictionary Data Structure in Javascript
- Tree Data Structure in Javascript
- Graph Data Structure in Javascript
- Range Trees in Data Structure
- Point Quadtrees in Data Structure
- Region Quadtrees in Data Structure
- BSP Trees in Data Structure
