{
"cells": [
{
"cell_type": "markdown",
"id": "f21133df-9ed8-4757-8963-6e2176c3128e",
"metadata": {},
"source": [
"# Balance Calculators"
]
},
{
"cell_type": "code",
"execution_count": 1,
"id": "b83085cf-5a4d-4db3-85ff-317d6e376735",
"metadata": {},
"outputs": [],
"source": [
"from pybalance.utils.balance_calculators import *\n",
"from pybalance.utils import MatchingData\n",
"from pybalance.sim import load_paper_dataset"
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "917b2206-9b4e-404d-9ff7-21a251565338",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\n",
" Headers Numeric:
\n",
" ['age', 'height', 'weight']
\n",
" Headers Categoric:
\n",
" ['gender', 'haircolor', 'country', 'binary_0', 'binary_1', 'binary_2', 'binary_3']
\n",
" Populations
\n",
" ['pool', 'target']
\n",
"
\n", " | age | \n", "height | \n", "weight | \n", "gender | \n", "haircolor | \n", "country | \n", "population | \n", "binary_0 | \n", "binary_1 | \n", "binary_2 | \n", "binary_3 | \n", "patient_id | \n", "
---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | \n", "64.854093 | \n", "189.466850 | \n", "88.835049 | \n", "1.0 | \n", "1 | \n", "4 | \n", "pool | \n", "0 | \n", "1 | \n", "0 | \n", "1 | \n", "135740 | \n", "
1 | \n", "52.571993 | \n", "158.134940 | \n", "94.215107 | \n", "1.0 | \n", "1 | \n", "1 | \n", "pool | \n", "0 | \n", "1 | \n", "0 | \n", "1 | \n", "49288 | \n", "
2 | \n", "25.828361 | \n", "154.692482 | \n", "94.226222 | \n", "1.0 | \n", "0 | \n", "3 | \n", "pool | \n", "0 | \n", "0 | \n", "1 | \n", "0 | \n", "256676 | \n", "
3 | \n", "70.177571 | \n", "160.536632 | \n", "94.244356 | \n", "1.0 | \n", "0 | \n", "2 | \n", "pool | \n", "0 | \n", "0 | \n", "0 | \n", "1 | \n", "338287 | \n", "
4 | \n", "73.779164 | \n", "153.551419 | \n", "86.161814 | \n", "0.0 | \n", "0 | \n", "1 | \n", "pool | \n", "0 | \n", "0 | \n", "1 | \n", "1 | \n", "72849 | \n", "
... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "
274995 | \n", "62.547794 | \n", "186.005015 | \n", "50.975051 | \n", "0.0 | \n", "0 | \n", "1 | \n", "target | \n", "0 | \n", "0 | \n", "1 | \n", "1 | \n", "579081 | \n", "
274996 | \n", "69.879934 | \n", "142.371386 | \n", "100.138389 | \n", "1.0 | \n", "1 | \n", "4 | \n", "target | \n", "0 | \n", "1 | \n", "1 | \n", "0 | \n", "569939 | \n", "
274997 | \n", "56.921402 | \n", "130.639589 | \n", "108.745182 | \n", "1.0 | \n", "1 | \n", "5 | \n", "target | \n", "0 | \n", "1 | \n", "0 | \n", "0 | \n", "532419 | \n", "
274998 | \n", "34.082754 | \n", "174.764051 | \n", "67.998396 | \n", "0.0 | \n", "2 | \n", "2 | \n", "target | \n", "0 | \n", "0 | \n", "0 | \n", "1 | \n", "566266 | \n", "
274999 | \n", "60.981259 | \n", "137.419436 | \n", "89.897817 | \n", "1.0 | \n", "0 | \n", "5 | \n", "target | \n", "1 | \n", "1 | \n", "1 | \n", "1 | \n", "544231 | \n", "
275000 rows × 12 columns
\n", "\n", " | N | \n", "
---|---|
population | \n", "\n", " |
pool | \n", "250000 | \n", "
target | \n", "25000 | \n", "