docstr: Compute Gini impurity of a non-empty node.
  
  Gini impurity is defined as Σ p(1-p) over all classes, with p the freq
  class within the node. Since Σ p = 1, this is equivalent to 1 - Σ p^2.
docstr_tok: ["Compute","Gini","impurity","of","a","non-empty","node",".","Gini","impurity","is","defined","as","\u03a3","p","(","1-p",")","over","all","classes",",","with","p","the","freq","class","within","the","node",".","Since","\u03a3","p","=","1",",","this","is","equivalent","to","1","-","\u03a3","p^2","."]
code: def _gini(self, y):
      """Compute Gini impurity of a non-empty node.
  
      Gini impurity is defined as Σ p(1-p) over all classes, with p the freq
      class within the node. Since Σ p = 1, this is equivalent to 1 - Σ p^2.
      """
      m = y.size
      return 1.0 - sum(
          (np.sum(y == c) / m) ** 2 for c in range(self.n_classes_)
      )
  
imports: import numpy
  import ray
  from sklearn import datasets, metrics
  import time
  import tempfile
  import os
  import json
label_desc: Use image node_id 5 for calling the DecisionTreeClassifier obj's underlying member method code with example usage: obj._gini(y) and returns: unknown