I am trying to understand how the Gini criterion for decision decision tree construction actually greedily optimises a loss function.
The Gini impurity, sometimes also called Gini index, for a region (think: set) $R_{j}$ is defined as $\sum_{i=1}^K p_{i}^j (1-p_{i}^j)$ where $p_{i}^j$ is the probability of drawing an example of class $i$ from region $R_{j}$ and $K$ is the number of classes.
I have two references which suggest this but I am not able to fully understand either of them so I would appreciate some help. Yang2019 write:
Given some node, the objective function after splitting on this node can be written as $$ L\left(s, f_L, f_R\right)=\sum_{i: s\left(x_i\right)=0} l\left(f_L\left(x_i\right), y_i\right)+\sum_{i: s\left(x_i\right)=1} l\left(f_R\left(x_i\right), y_i\right) \text {, } $$ where $s(\cdot)$ denotes a binary split function which decides whether an input instance that reaches this node should progress through the left or right branch emanating from the node; and $f_L(\cdot), f_R(\cdot)$ denote the output function w.r.t the left and right child, respectively.
Given a specific split function $s(\cdot)$, we have the reduction of objective function $$ \begin{aligned} t(s)=\min _w \sum_{i=1}^n l\left(w, y_i\right)-\min _{w^L} & \sum_{i: s\left(x_i\right)=0} l\left(w^L, y_i\right) & -\min _{w^R} \sum_{i: s\left(x_i\right)=1} l\left(w^R, y_i\right), \end{aligned} $$ where $w, w^L, w^R$ denote the output values of the node and left and right child node, since instances in one node have the same output values. --- Based on this equation, we can directly prove that the essence of various splitting criteria is to optimize some loss functions greedily. For instance, the frequently-used criteria gini impurity and information gain are essentially equivalent to optimizing the square loss and softmax loss [23], respectively.
I understand the equations above but I do not see how a split $s$ that minimises the Gini index reduces the squared error loss function $l(w_{L}, y_{i}) = (w_{L} - y_{i})^2$ (resp. for $R$).
Let's try something else then. Leistner2009 consider margin losses instead and argue that the Gini index greedily optimises a loss function "related to the Hinge loss"
We can write the empirical loss at a node $R_j$ as $$ \mathcal{L}\left(\mathcal{R}_j\right)=\frac{1}{\left|\mathcal{R}_j\right|} \sum_{(\mathbf{x}, y) \in \mathcal{R}_j} \ell\left(g_y(\mathbf{x})\right) . $$ where $g_{y}(x)$ is the "true margin vector of $x$" i.e. Let $\mathbf{g}(\mathbf{x})=\left[g_1(\mathbf{x}), \cdots, g_K(\mathbf{x})\right]^T$ be a multivalued functio, then. $\mathbf{g}(\mathbf{x})$ is called a margin vector, if $$ \forall \mathbf{x}: \sum_{i=1}^K g_i(\mathbf{x})=0 . $$ Defining the margin vector as $\mathbf{g}^j(\mathbf{x})=\left[p_1^j-\right.$ $\left.\frac{1}{K}, \cdots, p_K^j-\frac{1}{K}\right]^T$, we can develop the empirical loss as $$ \begin{aligned} \mathcal{L}\left(\mathcal{R}_j\right) & =\frac{1}{\left|\mathcal{R}_j\right|} \sum_{(\mathbf{x}, y) \in \mathcal{R}_j} \sum_{i=1}^K \mathbb{I}(y=i) \ell\left(p_i^j-\frac{1}{K}\right) \\ & =\frac{1}{\left|\mathcal{R}_j\right|} \sum_{i=1}^K \ell\left(p_i^j-\frac{1}{K}\right) \sum_{(\mathbf{x}, y) \in \mathcal{R}_j} \mathbb{I}(y=i) \\ & =\sum_{i=1}^K p_i^j \ell\left(p_i^j-\frac{1}{K}\right) . \end{aligned} $$ Using (these) results, we can see that (...) the Gini index is related to the hinge loss function.
Again, I understand the derivation but I am unable to see how the Gini index $\sum_{i=1}^K p_{i}^j (1-p_{i}^j)$ can be related to the equation above and via what $\ell$.