Calculate the value of the Gini index for binary classification (i.e. Y= 0 or 1)

gini(p)

Arguments

p

p a vector containit the probabilities 'P[Y=0]' and 'P[Y=1]'

Value

the value of the Gini index