Posts

Showing posts from June, 2023

Blog on Naive Bayes

Image
 INTRODUCTION: Naive Bayes is a Supervised Machine Learning algorithm based on the Bayes Theorem that is used to solve classification problems by following a probabilistic approach. It is based on the idea that the predictor variables in a  Machine Learning  model are independent of each other. Meaning that the outcome of a model depends on a set of independent variables that have nothing to do with each other. The Math Behind Naive Bayes The principle behind Naive Bayes is the Bayes theorem also known as the Bayes Rule. The Bayes theorem is used to calculate the conditional probability, which is nothing but the probability of an event occurring based on information about the events in the past. Mathematically, the Bayes theorem is represented as: In the above equation: P(A|B): Conditional probability of event A occurring, given the event B P(A): Probability of event A occurring P(B): Probability of event B occurring P(B|A): Conditional probability of event B occurring, g...

Blog on K-NN Algorithm Using Python

Image
  With the business world entirely revolving around Data Science, it has become one of the most sorts after fields. In this article on the KNN algorithm, you will understand how the KNN algorithm works and how it can be implemented by using Python. What is KNN Algorithm? “K nearest neighbors or KNN Algorithm is a simple algorithm that uses the entire dataset in its training phase. Whenever a prediction is required for an unseen data instance, it searches through the entire training dataset for k-most similar instances and the data with the most similar instance is finally returned as the prediction.” KNN is often used in search applications where you are looking for  similar  items, like  find items similar to this one. The algorithm suggests that if  you’re similar to your neighbors, then you are one of them . For example, if apple looks more similar to peach, pear, and cherry (fruits) than monkey, cat, or a rat (animals), then most likely apple is a fruit. How...