Posts

Showing posts from May, 2022

The Loss function/Cost Function

Image
In this post we are gonna learn about the loss function in machine learning..The loss functions are essential in machine learning cause they are one who tells the algorithm if it makes mistake in prediction as wrong. so The Loss function/Cost Function are integral part of gradient descent and entropy calculations. Here we are gonna learn a bit about the different cost functions for different types of problems in machine learning. Mathematical Formula for Entropy : Consider a data set having a total number of N classes, then the entropy (E) can be determined with the formula below: Where: P i  = Probability of randomly selecting an example in class I; Entropy always lies between 0 and 1, however depending on the number of classes in the dataset, it can be greater than 1. But the high value of Let's understand it with an example where we have a dataset having three colors of fruits as red, green, and yellow. Suppose we have 2 red, 2 green, and 4 yellow observations throughout the dat