This function performs generates
generate_data(n = 100, d = 3, type = "MAR well specified")
n | The number of samples to return. |
---|---|
d | The dimension of samples to return. |
type | The matrix of financed clients' labels |
Dataframe containing features as x.1..d, labels as y.
This function generates data from a uniform(0,1) distribution, and generates labels y according to a logistic regression on this data with random -1/1 parameter for each coordinate (MAR well-specified), the square of this data (MAR misspecified), or this data and some additional feature (from U(0,1) as well - MNAR).
Ehrhardt, A., Biernacki, C., Vandewalle, V., Heinrich, P. and Beben, S. (2018), Reject Inference Methods in Credit Scoring: a rational review,
Adrien Ehrhardt
# We simulate data from financed clients generate_data(n = 100, d = 3, type = "MAR well specified")#> x.1 x.2 x.3 y #> 1 0.23316 0.2629 0.00574 0 #> 2 0.34607 0.3302 0.90890 0 #> 3 0.67435 0.8059 0.24175 0 #> 4 0.10433 0.4462 0.12580 0 #> 5 0.81251 0.0463 0.53650 1 #> 6 0.28937 0.9736 0.28713 0 #> 7 0.89699 0.0508 0.80294 0 #> 8 0.74366 0.8016 0.14526 1 #> 9 0.09828 0.9237 0.86947 0 #> 10 0.57061 0.9349 0.63676 0 #> 11 0.57241 0.9381 0.79613 0 #> 12 0.56017 0.7778 0.17805 0 #> 13 0.46422 0.4692 0.08564 1 #> 14 0.33356 0.6832 0.29269 0 #> 15 0.45516 0.7649 0.57525 0 #> 16 0.33454 0.7197 0.83759 0 #> 17 0.56466 0.7770 0.97505 0 #> 18 0.57360 0.0596 0.29494 1 #> 19 0.71085 0.1345 0.21012 0 #> 20 0.55007 0.3558 0.72503 0 #> 21 0.80328 0.0720 0.59768 0 #> 22 0.96173 0.2470 0.33681 1 #> 23 0.42274 0.6162 0.69421 0 #> 24 0.62907 0.4622 0.36581 1 #> 25 0.48269 0.7449 0.31002 0 #> 26 0.76683 0.2795 0.80576 0 #> 27 0.29825 0.7406 0.18350 0 #> 28 0.96517 0.7570 0.26999 1 #> 29 0.27475 0.7336 0.84436 0 #> 30 0.05502 0.1955 0.12234 0 #> 31 0.55934 0.9897 0.94914 0 #> 32 0.22442 0.6636 0.96690 0 #> 33 0.89541 0.3514 0.20454 1 #> 34 0.00332 0.6194 0.22824 1 #> 35 0.40735 0.5126 0.09658 1 #> 36 0.85648 0.8288 0.73430 0 #> 37 0.92254 0.7813 0.31418 1 #> 38 0.00634 0.7207 0.60229 0 #> 39 0.61491 0.0237 0.42404 0 #> 40 0.83707 0.8582 0.88304 1 #> 41 0.23060 0.4978 0.11430 1 #> 42 0.97984 0.6633 0.30599 1 #> 43 0.44828 0.7588 0.06002 1 #> 44 0.48709 0.8850 0.99553 0 #> 45 0.98613 0.8894 0.44066 0 #> 46 0.63156 0.4130 0.40430 0 #> 47 0.94664 0.4438 0.16152 0 #> 48 0.40224 0.6495 0.92983 0 #> 49 0.39454 0.3102 0.09671 0 #> 50 0.73977 0.6288 0.53999 0 #> 51 0.55077 0.7997 0.77757 0 #> 52 0.12188 0.1960 0.54514 0 #> 53 0.35536 0.7123 0.22237 1 #> 54 0.04928 0.8055 0.90025 0 #> 55 0.32549 0.8722 0.85539 0 #> 56 0.87945 0.6779 0.87387 0 #> 57 0.88444 0.6822 0.71715 1 #> 58 0.86916 0.2992 0.86139 0 #> 59 0.83181 0.4402 0.92708 1 #> 60 0.73047 0.4468 0.06657 0 #> 61 0.86417 0.9838 0.97299 0 #> 62 0.32836 0.2439 0.16515 0 #> 63 0.52135 0.5863 0.64717 0 #> 64 0.21778 0.8392 0.04122 1 #> 65 0.47167 0.0290 0.67646 0 #> 66 0.29922 0.2396 0.40502 0 #> 67 0.39542 0.4432 0.37658 1 #> 68 0.63998 0.7940 0.85265 0 #> 69 0.13841 0.9282 0.42217 1 #> 70 0.14635 0.4809 0.15027 1 #> 71 0.54498 0.8587 0.70271 0 #> 72 0.33287 0.9239 0.29304 0 #> 73 0.35615 0.7438 0.09733 0 #> 74 0.76332 0.7744 0.42412 0 #> 75 0.03485 0.4510 0.45364 0 #> 76 0.35938 0.8045 0.39038 0 #> 77 0.23331 0.1763 0.03661 0 #> 78 0.08500 0.7152 0.25682 1 #> 79 0.37322 0.9353 0.85028 0 #> 80 0.75710 0.2404 0.45409 0 #> 81 0.54704 0.4694 0.22610 0 #> 82 0.79881 0.1606 0.33984 1 #> 83 0.69942 0.3558 0.92553 0 #> 84 0.46500 0.9646 0.42408 0 #> 85 0.34653 0.7278 0.76858 1 #> 86 0.48448 0.1427 0.35485 0 #> 87 0.23018 0.9366 0.14581 0 #> 88 0.37166 0.4791 0.07252 0 #> 89 0.90653 0.4675 0.51214 0 #> 90 0.39090 0.3371 0.55118 0 #> 91 0.29194 0.9234 0.26743 0 #> 92 0.34308 0.2831 0.09000 0 #> 93 0.98285 0.8446 0.42328 1 #> 94 0.54128 0.6020 0.01416 1 #> 95 0.59440 0.2493 0.65306 0 #> 96 0.08369 0.6736 0.94157 1 #> 97 0.30294 0.4065 0.48675 0 #> 98 0.64529 0.6367 0.48598 0 #> 99 0.87672 0.6934 0.29850 1 #> 100 0.42113 0.4491 0.93965 0