DSA_SS24/notebooks/demographic_plots.ipynb

240 lines
178 KiB
Plaintext
Raw Normal View History

2024-05-08 17:45:29 +02:00
{
"cells": [
{
"cell_type": "code",
2024-05-29 09:25:12 +02:00
"execution_count": 1,
2024-05-08 17:45:29 +02:00
"metadata": {},
"outputs": [],
"source": [
"import pandas as pd\n",
"import numpy as np\n",
"import seaborn as sns\n",
"import matplotlib.pyplot as plt\n",
"import pickle\n",
"import wfdb"
]
},
{
"cell_type": "code",
2024-05-29 09:25:12 +02:00
"execution_count": 2,
2024-05-08 17:45:29 +02:00
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Reading SB\n",
2024-05-29 09:25:12 +02:00
"Length of SB: 50\n",
2024-05-08 17:45:29 +02:00
"Reading AFIB\n",
2024-05-29 09:25:12 +02:00
"Length of AFIB: 27\n",
2024-05-08 17:45:29 +02:00
"Reading GSVT\n",
2024-05-29 09:25:12 +02:00
"Length of GSVT: 0\n",
2024-05-08 17:45:29 +02:00
"Reading SR\n",
2024-05-29 09:25:12 +02:00
"Length of SR: 13\n"
2024-05-08 17:45:29 +02:00
]
}
],
"source": [
"\n",
2024-05-29 09:25:12 +02:00
"#path = \"C:/Studium/dsa/data\"\n",
2024-05-08 17:45:29 +02:00
"#path = \"C:/Users/Nils/Documents/HS-Mannheim/0000_MASTER/DSA/EKG_Prog/data\"\n",
2024-05-29 09:25:12 +02:00
"path = \"C:/Users/klara/projects/DSA/data\"\n",
2024-05-08 17:45:29 +02:00
"\n",
"categories_dict = {\n",
"'SB': [426177001],\n",
"'AFIB': [164889003, 164890007],\n",
"'GSVT': [426761007, 713422000, 233896004, 233897008, 713422000],\n",
"'SR': [426783006, 427393009]\n",
"}\n",
"\n",
"\n",
"data = {}\n",
"for cat_name in categories_dict.keys():\n",
" print(f\"Reading {cat_name}\")\n",
" with open(f'{path}/{cat_name}.pkl', 'rb') as f:\n",
" records = pickle.load(f)\n",
" data[cat_name] = records\n",
" print(f\"Length of {cat_name}: {len(records)}\")\n",
"\n",
"data_demographic = {'age':[], 'diag':[], 'gender':[]}\n",
"for cat_name, records in data.items():\n",
" for record in records:\n",
" age = record.comments[0].split(' ')[1]\n",
" sex = record.comments[1].split(' ')[1]\n",
" if age == 'NaN' or sex == 'NaN':\n",
" continue\n",
" # cut Age: from alter string \n",
" data_demographic['age'].append(int(age))\n",
" data_demographic['diag'].append(cat_name)\n",
" data_demographic['gender'].append(sex)\n",
"\n",
"df_dgc = pd.DataFrame(data_demographic)\n",
"\n",
"# Change from group to category\n",
"age_categories = [0, 20, 40, 60, 80, 100]\n",
"df_dgc['age_group'] = pd.cut(df_dgc['age'], bins=age_categories)"
]
},
{
"cell_type": "code",
2024-05-29 09:25:12 +02:00
"execution_count": 3,
2024-05-08 17:45:29 +02:00
"metadata": {},
"outputs": [
{
"data": {
2024-05-29 09:25:12 +02:00
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAhIAAAHHCAYAAADqJrG+AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguNCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8fJSN1AAAACXBIWXMAAA9hAAAPYQGoP6dpAABqhklEQVR4nO3dd1hT59sH8G9YYS/ZDnCiKC6KFrUVFEVwjzpb0Vq1Ko46WrF1YLWI1lHFVWdrW0fr3tta96oTN7gFRRFQEYQ87x++5GcEaoIJJ8Tv57rOpXnOyXPuhIw7zzoyIYQAERERUSEYSR0AERERFV9MJIiIiKjQmEgQERFRoTGRICIiokJjIkFERESFxkSCiIiICo2JBBERERUaEwkiIiIqNCYSREREVGhMJDTk5eWFHj16aLXOHj16wMvLS6t1GiJdPPfFlUwmw7hx46QOg/Tcvn37IJPJsG/fPq3XPW7cOMhkMq3XS8WP5InE0qVLIZPJcOLECZXy1NRU1KlTB+bm5ti2bZtE0WnPvXv3MG7cOJw+fVrqUCQXFxeHcePG4caNG1KHopfmzJkDmUyGunXrqn2fQ4cOYdy4cXjy5InuAiODlfs5nL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JVqlQRmZmZymN/+umnfM+TnxMnTggAYufOnUKIVwllqVKlxODBg/Mc+3oiIYQQU6ZMyffL6caNG8LY2FhMnDhRpfzcuXPCxMREpbyg98fatWv/80tGCCFWr14tAIgZM2Yoy3JycpQfqm8mEgDEyJEj89SjaSJRsmRJlWR21apVAoD46aef8jyuqVO
2024-05-08 17:45:29 +02:00
"text/plain": [
"<Figure size 640x480 with 2 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"# Correlation matrix\n",
"corr_matrix_age_diag= pd.crosstab(df_dgc['age_group'], df_dgc['diag'])\n",
"\n",
"# Plot the correlation matrix\n",
"sns.heatmap(corr_matrix_age_diag, annot=True, cmap='coolwarm', fmt='d')\n",
"plt.title('Korrelationsmatrix von Altersgruppen und Diagnosen')\n",
"plt.xlabel('Diagnose')\n",
"plt.ylabel('Altersgruppe')\n",
"plt.show()"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAiwAAAHHCAYAAACcHAM1AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8qNh9FAAAACXBIWXMAAA9hAAAPYQGoP6dpAABwNUlEQVR4nO3dd1QUVxsG8GdpS69SBQEFURQ16qexd7Fr1ERjF0tULKix9xZji12xl8QSe4uxt0SJvWBvKDZAKSKI1Pv9QZi4ggrsrrvA8ztnzmHv3Jl5Z7a93DIrE0IIEBEREWkxHU0HQERERPQ5TFiIiIhI6zFhISIiIq3HhIWIiIi0HhMWIiIi0npMWIiIiEjrMWEhIiIirceEhYiIiLQeExYiIiLSekxY1MzNzQ3dunVT6T67desGNzc3le4zP1LHtafsmzhxImQyGV69evXZuup+rmQyGfr376+2/X8JtWvXRu3atdWyb5lMhokTJ6pl30SqkucSlrVr10Imk+HChQsK5a9fv0alSpVgaGiIAwcOaCg61Xn+/Dkm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8RHv3r2TytLS0kTVqlWFp6enVFa2bNlPfuEJIUTNmjWFmZmZePz4sUJ5Wlqa9HdGwuLn56dQ55tvvhE2NjYKZR8+V1OmTBEmJibi7t27CvVGjhwpdHV1RWhoqBBCiGPHjgkACl9SWcWS3df9rFmzMn3RfkpOE5bPPd9JSUnCzs5OlCtXTqFexpezKhKWuXPnCgAK/+h9mLBk9705YMA
"text/plain": [
"<Figure size 640x480 with 2 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"# cut out sex 'unknown' (because only one occurence)\n",
"df_dgc_bineary = df_dgc[df_dgc['gender'] != 'Unknown']\n",
"# Correlation matrix\n",
"corr_matrix_sex_diag = pd.crosstab(df_dgc_bineary['gender'], df_dgc_bineary['diag'])\n",
"\n",
"# Plot the correlation matrix\n",
"sns.heatmap(corr_matrix_sex_diag, annot=True, cmap='coolwarm', fmt='d')\n",
"plt.title('Korrelationsmatrix von Geschlecht und Diagnosen')\n",
"plt.xlabel('Diagnose')\n",
"plt.ylabel('Geschlecht')\n",
"plt.show()"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAkQAAAHgCAYAAABEhXI/AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8qNh9FAAAACXBIWXMAAA9hAAAPYQGoP6dpAAByEUlEQVR4nO3deVxUZfs/8M8wMIOIgKiAKCApiYpb4IKaK4JG7j5puWuZhhpqbk+puKXhnrmUmvQ84VpqpaZMuJCJG4ULlkvi48ZSKaAgw8jcvz/8cb6OLALOMDPM5/16zUvnPvc55zpwuLg459z3yIQQAkREREQWzMrYARAREREZGwsiIiIisngsiIiIiMjisSAiIiIii8eCiIiIiCweCyIiIiKyeCyIiIiIyOKxICIiIiKLx4KIiIiILB4LIrJo9erVw8iRI40dBj2lc+fO6Ny5s7HDKCQq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zg7e2t069BgwbFbvvZvsCTX3Tz5s3D9u3bkZ6errMsMzOzUH9PT0+d946OjrC1tZVufzzd/uxzSMWtD0Dn9lZBu1arRWZmpnTL4lkFXwsfHx+ddhsbG7z00ks6bVevXsXvv/9e7O2NZ4+9qK9VcWJiYvDXX3+hdevWuHbtmtTepUsXbNu2DZ988gmsrMr+d+PVq1dx/vz5F4p5xowZ+Omnn9C6dWs0aNAAwcHBeOutt9C+fXupT48ePeDo6IgdO3agW7duAJ7cLmvRogVefvllAMC1a9cghMD
"text/plain": [
"<Figure size 640x480 with 4 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"# 4 subplots for each diagnosis a histrgramm for the age\n",
"fig, axs = plt.subplots(2, 2)\n",
"fig.suptitle('Histogramm der Altersverteilung')\n",
"for i, cat_name in enumerate(categories_dict.keys()):\n",
" ax = axs[i // 2, i % 2]\n",
" df_dgc[df_dgc['diag'] == cat_name]['age'].hist(ax=ax)\n",
" ax.set_title(cat_name)\n",
" ax.set_xlabel('Alter')\n",
" ax.set_ylabel('Anzahl')\n",
"plt.show()"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAk0AAAHHCAYAAACiOWx7AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8qNh9FAAAACXBIWXMAAA9hAAAPYQGoP6dpAABSSUlEQVR4nO3dd1QU1/8+8GfpTapURcQuigVUxF6IoGCPLdi7ASNi+Uii2GPEbqISEwVjMJoYeyegMSo2bMSCiigmCsRCs4DA/f3hj/m6gjoouIs+r3P2HPfeOzPv2VngceburEIIIUBEREREr6Wh6gKIiIiIygKGJiIiIiIZGJqIiIiIZGBoIiIiIpKBoYmIiIhIBoYmIiIiIhkYmoiIiIhkYGgiIiIikoGhiYiIiEgGhiaiEtCmTRvUrVv3jeNu3r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ZGRSEtLQ79+/XDv3j3poampCTc3Nxw8eLDQuseMGVPsel7FyMjojZ+ie/E1TE9Px71799C6dWvcuHFDuvwVFRWF3NxcfP7550rLFkw8L8rIkSOVLgW2bNkSeXl50mTjP/74Azk5OQgICFCaSzNixAgYGxtj9+7dACCdSdq/f/8rL9Ns2bIF+fn56N27t9LrbGNjg+rVqxd6nd/1veDh4YGqVatKz+vVqwdjY2Ol5V98XZ89e4b79++jWrVqMDU1xZkzZ6S+33//HfXr15fO3Lzo5UupQ4YMgY6OjvT8TT83AJCRkQHg+T6/rE2bNrC0tJQeK1asAAA8ePAA0dHR6N2
"text/plain": [
"<Figure size 640x480 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"# a barplot for each category with the age grpuoped besides each other\n",
"fig, ax = plt.subplots()\n",
"sns.countplot(data=df_dgc_bineary, x='diag', hue='gender', ax=ax)\n",
"plt.title('Anzahl der Diagnosen nach Geschlecht')\n",
"plt.xlabel('Diagnose')\n",
"plt.ylabel('Anzahl')\n",
"plt.show()"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAkQAAAHHCAYAAABeLEexAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8qNh9FAAAACXBIWXMAAA9hAAAPYQGoP6dpAABic0lEQVR4nO3dd1QU19sH8O9SdmkuiDQRRBSjYC9RkNhRNGgsJFFjwR4NaNRE/WEM9pioWGIjiQhq7IkaxYoCGhUbEXuwgRgViChgpd73jxzmdQUVcGHB/X7O2XPcO8/cuXNnd3yYuXdWJoQQICIiItJiOppuABEREZGmMSEiIiIirceEiIiIiLQeEyIiIiLSekyIiIiISOsxISIiIiKtx4SIiIiItB4TIiIiItJ6TIiIiIhI6zEhIq3Trl071K9f/41xCQkJkMlkCA0NLdF2QkNDIZPJkJCQ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l5+PTTT1X62cbGBrVr1y7Qz2/7WfDw8ECtWrWk9w0bNoRSqVRZ/8V+zc7ORmpqKpycnGBmZoa//vpLWvb777+jUaNG6NWrV4HtvHx7c8iQIZDL5dL7N31vXlTc72hRFLffFQoFhgwZolKWfwUpLCwM2dnZhW5n37590NfXV7nSqaOjo3IF82Xq+B4NGjQIlSpVkt5//PHHqFq1Kvbs2aMSp6enh88//1x6L5fL8fnnnyMlJQUxMTEAgK1bt8LZ2Rl169ZV6asOHToAQIG+KspnjN4eEyJSq9zcXGzatAnt27dHfHw8rl+/juvXr6Nly5ZITk7GoUOHCqx
"text/plain": [
"<Figure size 640x480 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"# barplot how many diagnosis are in each age group\n",
"fig, ax = plt.subplots()\n",
"sns.countplot(data=df_dgc, x='age_group', hue='diag', ax=ax)\n",
"plt.title('Anzahl der Diagnosen nach Altersgruppen')\n",
"plt.xlabel('Altersgruppe')\n",
"plt.ylabel('Anzahl')\n",
"plt.show()"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
2024-05-29 09:25:12 +02:00
"version": "3.11.9"
2024-05-08 17:45:29 +02:00
}
},
"nbformat": 4,
"nbformat_minor": 2
}