{
"cells": [
{
"cell_type": "markdown",
"id": "20fce00f",
"metadata": {},
"source": [
"# ML, Data Analysis\n",
"### Machine learning: Entropy\n",
"\n",
"The **entropy** measures how much a random variable (or a dataset) has disorder or uncertainty. It is often used in decision tree algorithms to measure how *diverse* or *mixed* a set of items is with respect to their class labels (similar to the **Gini impurity** mentioned earlier).\n",
"
**Definition:** We have a dataset with $K$ different classes (or a random variable with $K$ possible outcomes). Let's denote the probability of selecting an item of class $i$ by $p_i$. Then, the entropy is defined by:\n",
"