Prepares classifiers output for adversarial by splitting original predictions into train and test vectors.

prepare_to_adv(preds, sensitive, partition = 0.7)

Arguments

preds

numeric vector of predictions of target value made by classifier (preferably the probabilistic ones).

sensitive

integer vector of sensitive attribute which adversarial has to predict.

partition

float from [0,1] range setting the size of train vector (test size equals 1-partition). Default = 0.7.

Value

list of four numeric lists with x and y data for train and test respectively.

Examples

preds <-c(0.312,0.343,0.932,0.754,0.436,0.185,0.527,0.492,0.743,0.011) sensitive <- c(1,1,2,2,1,1,2,2,2,1) prepare_to_adv(preds,sensitive,partition=0.6)
#> $train_x #> [,1] #> [1,] 0.932 #> [2,] 0.011 #> [3,] 0.343 #> [4,] 0.492 #> [5,] 0.185 #> [6,] 0.743 #> #> $train_y #> [1] 2 1 1 2 1 2 #> #> $test_x #> [,1] #> [1,] 0.312 #> [2,] 0.754 #> [3,] 0.436 #> [4,] 0.527 #> #> $test_y #> [1] 1 2 1 2 #>