oplaTech Oplatek Teaching Archive
Oplatek's external memory

Entropy calculation example

Pdf with task data (CZE)


The example of Entropy calculation

$H(Vit(B)) = - \frac{n_{+}(Vitamin(B))}{Vitamin(B)} * log (\frac{n_{+}(Vitamin(B))}{Vitamin(B)})- \frac{n_{-}(Vitamin(B))}{Vitamin(B)} * log (\frac{n_{-}(Vitamin(B))}{Vitamin(B)}) $

where $n_{-}$ they died
where $n_{+}$ they survived


The formula for Entropy

$H(A(v)) = - \sum_{t=1}^{T} \frac{n_{t}(A(v))} {n(A(v))}* log (\frac{n_{t}(A(v))} {n(A(v))}) $
where $n_t(A(v))$ is frequency of inputs which belongs to target class with value t and also have value v for attribute A
where $n(A(v))$ is frequency of inputs which have value v for attribute A