gini_OOB: compute Gini impurity for binary values only

Description Usage Arguments Value Author(s) Examples

Description

simple function to compute simple or penalized Gini impurity

The "penalty" compares the class probabilities pOut with a reference estimate pIn

which would typically serve as a prediction (e.g. in a tree node).

Usage

1
2
3
4
gini_OOB(gIn, gOut, k = 2, kind = 1, w = 2, correctBias = FALSE, 


    verbose = 0)

Arguments

gIn

Gini Inbag

gOut

Gini Outbag

k

exponent of penalty term: abs(pOut-pIn)^k

kind

kind of penalty

w

weights, default is 2 if you pass just a single probability instead of the vector (p,1-p),

correctBias

multiply by n/(n-1) for sample variance correction!

verbose

level of verbosity

Value

simple or penalized Gini impurity

Author(s)

Markus Loecher <Markus.Loecher@gmail.com>

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#Test binary case:





gini_OOB(0.5,0.5,kind=1)


gini_OOB(0.9,0.1,kind=1)


gini_OOB(0.1,0.9,kind=1)





gini_OOB(0.5,0.5,kind=2)


gini_OOB(0.9,0.1,kind=2)


gini_OOB(0.1,0.9,kind=2)








gini_OOB(0.5,0.5,kind=3)


gini_OOB(0.9,0.1,kind=3)


gini_OOB(0.1,0.9,kind=3)

markusloecher/rfVarImpOOB documentation built on July 5, 2020, 6:50 p.m.