{
"cells": [
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
""
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"# Train/test/val splits for PhysioNet-2012 dataset\n",
"# \n",
"# Author: Theodoros Tsiligkaridis\n",
"# Last updated: April 5 2021\n",
"from IPython.core.display import display, HTML\n",
"display(HTML(\"\"))\n",
"\n",
"import json\n",
"import numpy as np\n",
"import pandas as pd\n",
"import matplotlib.pyplot as plt"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [],
"source": [
"# p_train = 0.80*0.80\n",
"# p_val = 0.80*0.20\n",
"# p_test = 0.20"
]
},
{
"cell_type": "code",
"execution_count": 19,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"12000\n",
"(12000, 6)\n",
"pid: 132539\n"
]
}
],
"source": [
"with open(\"phy12_data.json\", 'r') as f:\n",
" P_list = json.load(f)\n",
"print(len(P_list))\n",
"\n",
"arr_outcomes = np.load('phy12_outcomes.npy')\n",
"print(arr_outcomes.shape)\n",
"\n",
"pid = P_list[0]['id']\n",
"print('pid: ', pid)"
]
},
{
"cell_type": "code",
"execution_count": 20,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"11988 (11988, 6)\n"
]
}
],
"source": [
"# remove blacklist patients\n",
"blacklist = ['140501', '150649', '140936', '143656', '141264', '145611', '142998', '147514', '142731', '150309', '155655', '156254']\n",
"\n",
"i = 0\n",
"n = len(P_list)\n",
"while i