146 lines (145 with data), 3.0 kB
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# WESAD Dataset Analysis"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import numpy as np\n",
"import matplotlib as mpl\n",
"import matplotlib.pyplot as plt\n",
"import seaborn as sns\n",
"import pandas as pd"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"df = pd.read_csv(\"../../WESAD/allchest.csv\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"df = df[df['ID'] == 2]"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"df.reset_index(inplace=True, drop=True)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"df['label'].unique()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"sns.set_context(\"paper\", rc={\"lines.linewidth\": 2.5})\n",
"sns.set_palette(\"binary_d\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# Neutral\n",
"sns.lineplot(data=df[df['label'] == 1].reset_index(drop=True)['chestResp'])\n",
"plt.ylabel('RESP')\n",
"plt.xlabel('Sequential Data-Points')\n",
"plt.show()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"scrolled": false
},
"outputs": [],
"source": [
"# Stress\n",
"sns.lineplot(data=df[df['label'] == 2].reset_index(drop=True)['chestResp'])\n",
"plt.ylabel('RESP')\n",
"plt.xlabel('Sequential Data-Points')\n",
"plt.show()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# Neutral\n",
"sns.lineplot(data=df[df['label'] == 1].reset_index(drop=True).iloc[400000:420000]['chestResp'])\n",
"plt.ylabel('RESP')\n",
"plt.xlabel('Sequential Data-Points')\n",
"plt.show()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# Stress\n",
"sns.lineplot(data=df[df['label'] == 2].reset_index(drop=True).iloc[50000:70000]['chestResp'])\n",
"plt.ylabel('RESP')\n",
"plt.xlabel('Sequential Data-Points')\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",
"version": "3.7.3"
}
},
"nbformat": 4,
"nbformat_minor": 2
}