In decision tree learning, specifically when calculating Gini impurity, I understand that probabilities are assigned to a class label based on the node label proportions, such as, child_node = [0,0,0,0,1,1,1,1,1,2]
with $P(X = 0) = 0.4$, $P(X = 1) = 0.5$ and $P(X = 2) = 0.1$.
But I have the following questions about how a probability mass function (PMF) would be constructed according to the definition in the link. If the sample space for child_node
is $\Omega = \{0,1,2\}$. What measurable function should be used to map the values from $\Omega$ to a measurable space? What would this measurable space look like?
Lastly, I'm unsure exactly how the probability P(X = x) can be determined using $P\bigl(\{\omega\in\Omega : X(\omega) = x\}\bigr)$. What does $\{\omega\in\Omega : X(\omega) = x\}\ $ actually mean? I understand this to mean something like.
>>> omega = {0,1,2}
>>> x = 3
>>> {om for om in omega if om in range(x)}
{0,1,2}
which is just the same as $\Omega$? Presumabley I am wrong here?