4289 lines (4288 with data), 159.5 kB
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "4pSvBuCv6lMC",
"outputId": "7addb939-067e-4915-ab6a-1c72968c36ce"
},
"outputs": [
{
"data": {
"text/html": [
"<script type=\"text/javascript\">window.PlotlyConfig = {MathJaxConfig: 'local'};</script><script type=\"text/javascript\">if (window.MathJax) {MathJax.Hub.Config({SVG: {font: \"STIX-Web\"}});}</script><script>requirejs.config({paths: { 'plotly': ['https://cdn.plot.ly/plotly-latest.min']},});if(!window._Plotly) {require(['plotly'],function(plotly) {window._Plotly=plotly;});}</script>"
],
"text/vnd.plotly.v1+html": [
"<script type=\"text/javascript\">window.PlotlyConfig = {MathJaxConfig: 'local'};</script><script type=\"text/javascript\">if (window.MathJax) {MathJax.Hub.Config({SVG: {font: \"STIX-Web\"}});}</script><script>requirejs.config({paths: { 'plotly': ['https://cdn.plot.ly/plotly-latest.min']},});if(!window._Plotly) {require(['plotly'],function(plotly) {window._Plotly=plotly;});}</script>"
]
},
"metadata": {
"tags": []
},
"output_type": "display_data"
}
],
"source": [
"# Import libraries\n",
"import numpy as np\n",
"import pandas as pd\n",
"import matplotlib.pyplot as plt\n",
"import getpass\n",
"import pdvega\n",
"import plotly.graph_objs as go\n",
"\n",
"from plotly.offline import iplot, init_notebook_mode\n",
"import plotly.io as pio\n",
"from plotly.graph_objs import *\n",
"\n",
"# for configuring connection \n",
"from configobj import ConfigObj\n",
"import os\n",
"\n",
"%matplotlib inline\n",
"\n",
"\n",
"import os\n",
"\n",
"\n",
"from sklearn import linear_model\n",
"from sklearn import metrics\n",
"from sklearn.model_selection import train_test_split\n",
"\n",
"#configure the notebook for use in offline mode\n",
"init_notebook_mode(connected=True)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "SuO51zoQ6lME",
"outputId": "416ccf6e-d866-4f7f-d009-ec5b027c87f7"
},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>Unnamed: 0</th>\n",
" <th>hospitalid</th>\n",
" <th>sodium</th>\n",
" <th>electivesurgery</th>\n",
" <th>vent</th>\n",
" <th>dialysis</th>\n",
" <th>gcs</th>\n",
" <th>urine</th>\n",
" <th>wbc</th>\n",
" <th>temperature</th>\n",
" <th>...</th>\n",
" <th>m11_True</th>\n",
" <th>m12_True</th>\n",
" <th>m13_True</th>\n",
" <th>m14_True</th>\n",
" <th>m15_True</th>\n",
" <th>m16_True</th>\n",
" <th>m17_True</th>\n",
" <th>m18_True</th>\n",
" <th>m19_True</th>\n",
" <th>m20_True</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>0</td>\n",
" <td>59.0</td>\n",
" <td>139.0</td>\n",
" <td>-1.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>15.0</td>\n",
" <td>-1.0</td>\n",
" <td>14.7</td>\n",
" <td>36.1</td>\n",
" <td>...</td>\n",
" <td>1</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>1</td>\n",
" <td>1</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>1</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>1</td>\n",
" <td>73.0</td>\n",
" <td>134.0</td>\n",
" <td>-1.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>13.0</td>\n",
" <td>-1.0</td>\n",
" <td>14.1</td>\n",
" <td>39.3</td>\n",
" <td>...</td>\n",
" <td>1</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>1</td>\n",
" <td>1</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>1</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>2</td>\n",
" <td>73.0</td>\n",
" <td>-1.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>15.0</td>\n",
" <td>-1.0</td>\n",
" <td>8.0</td>\n",
" <td>34.8</td>\n",
" <td>...</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>1</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>1</td>\n",
" <td>0</td>\n",
" <td>1</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>3</td>\n",
" <td>63.0</td>\n",
" <td>137.0</td>\n",
" <td>-1.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>15.0</td>\n",
" <td>-1.0</td>\n",
" <td>10.9</td>\n",
" <td>36.6</td>\n",
" <td>...</td>\n",
" <td>1</td>\n",
" <td>0</td>\n",
" <td>1</td>\n",
" <td>1</td>\n",
" <td>1</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>1</td>\n",
" <td>1</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>4</td>\n",
" <td>63.0</td>\n",
" <td>135.0</td>\n",
" <td>-1.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>15.0</td>\n",
" <td>-1.0</td>\n",
" <td>5.9</td>\n",
" <td>35.0</td>\n",
" <td>...</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>1</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>1</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"<p>5 rows × 85 columns</p>\n",
"</div>"
],
"text/plain": [
" Unnamed: 0 hospitalid sodium electivesurgery vent dialysis gcs \\\n",
"0 0 59.0 139.0 -1.0 0.0 0.0 15.0 \n",
"1 1 73.0 134.0 -1.0 0.0 0.0 13.0 \n",
"2 2 73.0 -1.0 1.0 1.0 0.0 15.0 \n",
"3 3 63.0 137.0 -1.0 0.0 0.0 15.0 \n",
"4 4 63.0 135.0 -1.0 0.0 0.0 15.0 \n",
"\n",
" urine wbc temperature ... m11_True m12_True m13_True m14_True \\\n",
"0 -1.0 14.7 36.1 ... 1 0 0 1 \n",
"1 -1.0 14.1 39.3 ... 1 0 0 1 \n",
"2 -1.0 8.0 34.8 ... 0 0 1 0 \n",
"3 -1.0 10.9 36.6 ... 1 0 1 1 \n",
"4 -1.0 5.9 35.0 ... 0 0 1 0 \n",
"\n",
" m15_True m16_True m17_True m18_True m19_True m20_True \n",
"0 1 0 0 0 1 0 \n",
"1 1 0 0 0 1 0 \n",
"2 0 1 0 1 0 0 \n",
"3 1 0 0 1 1 0 \n",
"4 0 0 0 1 0 0 \n",
"\n",
"[5 rows x 85 columns]"
]
},
"execution_count": 15,
"metadata": {
"tags": []
},
"output_type": "execute_result"
}
],
"source": [
"df= pd.read_csv(\"Analysis.csv\")\n",
"df.head()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "DY_YHpZt6lMF"
},
"outputs": [],
"source": [
"del df['hospitalid']\n",
"\n",
"df = df.drop(df.columns[[0]], axis=1)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "ADb9y6cp6lMF",
"outputId": "936cfb4e-e475-416e-ed8b-5dd9011709c5"
},
"outputs": [
{
"data": {
"text/plain": [
"sodium 0\n",
"electivesurgery 0\n",
"vent 0\n",
"dialysis 0\n",
"gcs 0\n",
"urine 0\n",
"wbc 0\n",
"temperature 0\n",
"respiratoryrate 0\n",
"heartrate 0\n",
"meanbp 0\n",
"creatinine 0\n",
"ph 0\n",
"hematocrit 0\n",
"albumin 0\n",
"pao2 0\n",
"pco2 0\n",
"bun 0\n",
"glucose 0\n",
"bilirubin 0\n",
"fio2 0\n",
"age 0\n",
"thrombolytics 0\n",
"aids 0\n",
"hepaticfailure 0\n",
"lymphoma 0\n",
"metastaticcancer 0\n",
"leukemia 0\n",
"immunosuppression 0\n",
"cirrhosis 0\n",
" ..\n",
"diaggroup_Neuro 0\n",
"diaggroup_Other 0\n",
"diaggroup_Overdose 0\n",
"diaggroup_PNA 0\n",
"diaggroup_RespMedOther 0\n",
"diaggroup_Sepsis 0\n",
"diaggroup_Trauma 0\n",
"diaggroup_ValveDz 0\n",
"gender_Male 0\n",
"gender_Other 0\n",
"m1_True 0\n",
"m2_True 0\n",
"m3_True 0\n",
"m4_True 0\n",
"m5_True 0\n",
"m6_True 0\n",
"m7_True 0\n",
"m8_True 0\n",
"m9_True 0\n",
"m10_True 0\n",
"m11_True 0\n",
"m12_True 0\n",
"m13_True 0\n",
"m14_True 0\n",
"m15_True 0\n",
"m16_True 0\n",
"m17_True 0\n",
"m18_True 0\n",
"m19_True 0\n",
"m20_True 0\n",
"Length: 83, dtype: int64"
]
},
"execution_count": 18,
"metadata": {
"tags": []
},
"output_type": "execute_result"
}
],
"source": [
"missing_values_count = df.isnull().sum()\n",
"missing_values_count"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "l3m5jhLa6lMF"
},
"source": [
"**We moved all the pre-processing including splitting>imputation>Standardization to the CV iterations**"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "jpDbj7Fj6lMG"
},
"outputs": [],
"source": [
"cols_to_norm=['gcs', 'urine', 'wbc', 'sodium',\n",
" 'temperature', 'respiratoryrate', 'heartrate', 'meanbp', 'creatinine',\n",
" 'ph', 'hematocrit', 'albumin', 'pao2', 'pco2', 'bun', 'glucose',\n",
" 'bilirubin', 'fio2', 'age', 'offset']\n",
"\n",
"X=df.drop('destcopy', 1)\n",
"y=df['destcopy']\n",
"df_cols = list(X) #fancy impute removes column names."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "vRhjfNFs6lMG",
"outputId": "c7dcc7dd-a08d-4fc4-eae7-49376505cc68"
},
"outputs": [
{
"data": {
"text/plain": [
"Index(['sodium', 'electivesurgery', 'vent', 'dialysis', 'gcs', 'urine', 'wbc',\n",
" 'temperature', 'respiratoryrate', 'heartrate', 'meanbp', 'creatinine',\n",
" 'ph', 'hematocrit', 'albumin', 'pao2', 'pco2', 'bun', 'glucose',\n",
" 'bilirubin', 'fio2', 'age', 'thrombolytics', 'aids', 'hepaticfailure',\n",
" 'lymphoma', 'metastaticcancer', 'leukemia', 'immunosuppression',\n",
" 'cirrhosis', 'readmit', 'offset', 'destcopy', 'admitsource_1.0',\n",
" 'admitsource_2.0', 'admitsource_3.0', 'admitsource_4.0',\n",
" 'admitsource_5.0', 'admitsource_6.0', 'admitsource_7.0',\n",
" 'admitsource_8.0', 'diaggroup_ARF', 'diaggroup_Asthma-Emphys',\n",
" 'diaggroup_CABG', 'diaggroup_CHF', 'diaggroup_CVA', 'diaggroup_CVOther',\n",
" 'diaggroup_CardiacArrest', 'diaggroup_ChestPainUnknown',\n",
" 'diaggroup_Coma', 'diaggroup_DKA', 'diaggroup_GIBleed',\n",
" 'diaggroup_GIObstruction', 'diaggroup_Neuro', 'diaggroup_Other',\n",
" 'diaggroup_Overdose', 'diaggroup_PNA', 'diaggroup_RespMedOther',\n",
" 'diaggroup_Sepsis', 'diaggroup_Trauma', 'diaggroup_ValveDz',\n",
" 'gender_Male', 'gender_Other', 'm1_True', 'm2_True', 'm3_True',\n",
" 'm4_True', 'm5_True', 'm6_True', 'm7_True', 'm8_True', 'm9_True',\n",
" 'm10_True', 'm11_True', 'm12_True', 'm13_True', 'm14_True', 'm15_True',\n",
" 'm16_True', 'm17_True', 'm18_True', 'm19_True', 'm20_True'],\n",
" dtype='object')"
]
},
"execution_count": 20,
"metadata": {
"tags": []
},
"output_type": "execute_result"
}
],
"source": [
"df.columns"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "Q7W7zo1m6lMG"
},
"source": [
"**Logistic Regression**"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "XcxcPY866lMH"
},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "7RVegpb-6lMH"
},
"outputs": [],
"source": [
"from collections import Counter"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "8qmztaJb6lMH",
"outputId": "7652110b-dbf3-490d-f655-d4ab68ee478e"
},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"C:\\Users\\llois\\Anaconda\\lib\\site-packages\\ipykernel_launcher.py:36: SettingWithCopyWarning:\n",
"\n",
"\n",
"A value is trying to be set on a copy of a slice from a DataFrame.\n",
"Try using .loc[row_indexer,col_indexer] = value instead\n",
"\n",
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n",
"\n",
"C:\\Users\\llois\\Anaconda\\lib\\site-packages\\pandas\\core\\indexing.py:543: SettingWithCopyWarning:\n",
"\n",
"\n",
"A value is trying to be set on a copy of a slice from a DataFrame.\n",
"Try using .loc[row_indexer,col_indexer] = value instead\n",
"\n",
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n",
"\n",
"C:\\Users\\llois\\Anaconda\\lib\\site-packages\\ipykernel_launcher.py:37: SettingWithCopyWarning:\n",
"\n",
"\n",
"A value is trying to be set on a copy of a slice from a DataFrame.\n",
"Try using .loc[row_indexer,col_indexer] = value instead\n",
"\n",
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n",
"\n",
"C:\\Users\\llois\\Anaconda\\lib\\site-packages\\pandas\\core\\indexing.py:543: SettingWithCopyWarning:\n",
"\n",
"\n",
"A value is trying to be set on a copy of a slice from a DataFrame.\n",
"Try using .loc[row_indexer,col_indexer] = value instead\n",
"\n",
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n",
"\n",
"C:\\Users\\llois\\Anaconda\\lib\\site-packages\\ipykernel_launcher.py:47: SettingWithCopyWarning:\n",
"\n",
"\n",
"A value is trying to be set on a copy of a slice from a DataFrame.\n",
"Try using .loc[row_indexer,col_indexer] = value instead\n",
"\n",
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n",
"\n",
"C:\\Users\\llois\\Anaconda\\lib\\site-packages\\ipykernel_launcher.py:50: SettingWithCopyWarning:\n",
"\n",
"\n",
"A value is trying to be set on a copy of a slice from a DataFrame.\n",
"Try using .loc[row_indexer,col_indexer] = value instead\n",
"\n",
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n",
"\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"hi\n",
"[(1, 9194), (2, 59442), (3, 12662), (4, 4335)]\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"C:\\Users\\llois\\Anaconda\\lib\\site-packages\\sklearn\\linear_model\\logistic.py:432: FutureWarning:\n",
"\n",
"Default solver will be changed to 'lbfgs' in 0.22. Specify a solver to silence this warning.\n",
"\n",
"C:\\Users\\llois\\Anaconda\\lib\\site-packages\\sklearn\\linear_model\\logistic.py:469: FutureWarning:\n",
"\n",
"Default multi_class will be changed to 'auto' in 0.22. Specify the multi_class option to silence this warning.\n",
"\n",
"C:\\Users\\llois\\Anaconda\\lib\\site-packages\\sklearn\\linear_model\\logistic.py:432: FutureWarning:\n",
"\n",
"Default solver will be changed to 'lbfgs' in 0.22. Specify a solver to silence this warning.\n",
"\n",
"C:\\Users\\llois\\Anaconda\\lib\\site-packages\\sklearn\\linear_model\\logistic.py:469: FutureWarning:\n",
"\n",
"Default multi_class will be changed to 'auto' in 0.22. Specify the multi_class option to silence this warning.\n",
"\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"For fold 1:\n",
"Accuracy: 0.6286915396741987\n",
"f-score: 0.6286915396741987\n",
" pre rec spe f1 geo iba sup\n",
"\n",
" 1 0.36 0.53 0.93 0.43 0.70 0.47 642\n",
" 2 0.83 0.73 0.63 0.78 0.68 0.47 6776\n",
" 3 0.37 0.32 0.88 0.35 0.53 0.27 1716\n",
" 4 0.11 0.33 0.89 0.17 0.55 0.28 381\n",
"\n",
"avg / total 0.69 0.63 0.71 0.65 0.65 0.42 9515\n",
"\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"C:\\Users\\llois\\Anaconda\\lib\\site-packages\\ipykernel_launcher.py:36: SettingWithCopyWarning:\n",
"\n",
"\n",
"A value is trying to be set on a copy of a slice from a DataFrame.\n",
"Try using .loc[row_indexer,col_indexer] = value instead\n",
"\n",
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n",
"\n",
"C:\\Users\\llois\\Anaconda\\lib\\site-packages\\pandas\\core\\indexing.py:543: SettingWithCopyWarning:\n",
"\n",
"\n",
"A value is trying to be set on a copy of a slice from a DataFrame.\n",
"Try using .loc[row_indexer,col_indexer] = value instead\n",
"\n",
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n",
"\n",
"C:\\Users\\llois\\Anaconda\\lib\\site-packages\\ipykernel_launcher.py:37: SettingWithCopyWarning:\n",
"\n",
"\n",
"A value is trying to be set on a copy of a slice from a DataFrame.\n",
"Try using .loc[row_indexer,col_indexer] = value instead\n",
"\n",
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n",
"\n",
"C:\\Users\\llois\\Anaconda\\lib\\site-packages\\pandas\\core\\indexing.py:543: SettingWithCopyWarning:\n",
"\n",
"\n",
"A value is trying to be set on a copy of a slice from a DataFrame.\n",
"Try using .loc[row_indexer,col_indexer] = value instead\n",
"\n",
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n",
"\n",
"C:\\Users\\llois\\Anaconda\\lib\\site-packages\\ipykernel_launcher.py:47: SettingWithCopyWarning:\n",
"\n",
"\n",
"A value is trying to be set on a copy of a slice from a DataFrame.\n",
"Try using .loc[row_indexer,col_indexer] = value instead\n",
"\n",
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n",
"\n",
"C:\\Users\\llois\\Anaconda\\lib\\site-packages\\ipykernel_launcher.py:50: SettingWithCopyWarning:\n",
"\n",
"\n",
"A value is trying to be set on a copy of a slice from a DataFrame.\n",
"Try using .loc[row_indexer,col_indexer] = value instead\n",
"\n",
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n",
"\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"hi\n",
"[(1, 8862), (2, 58698), (3, 13681), (4, 4392)]\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"C:\\Users\\llois\\Anaconda\\lib\\site-packages\\sklearn\\linear_model\\logistic.py:432: FutureWarning:\n",
"\n",
"Default solver will be changed to 'lbfgs' in 0.22. Specify a solver to silence this warning.\n",
"\n",
"C:\\Users\\llois\\Anaconda\\lib\\site-packages\\sklearn\\linear_model\\logistic.py:469: FutureWarning:\n",
"\n",
"Default multi_class will be changed to 'auto' in 0.22. Specify the multi_class option to silence this warning.\n",
"\n",
"C:\\Users\\llois\\Anaconda\\lib\\site-packages\\sklearn\\linear_model\\logistic.py:432: FutureWarning:\n",
"\n",
"Default solver will be changed to 'lbfgs' in 0.22. Specify a solver to silence this warning.\n",
"\n",
"C:\\Users\\llois\\Anaconda\\lib\\site-packages\\sklearn\\linear_model\\logistic.py:469: FutureWarning:\n",
"\n",
"Default multi_class will be changed to 'auto' in 0.22. Specify the multi_class option to silence this warning.\n",
"\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"For fold 2:\n",
"Accuracy: 0.6316342616920652\n",
"f-score: 0.6315291644771414\n",
" pre rec spe f1 geo iba sup\n",
"\n",
" 1 0.44 0.51 0.93 0.47 0.69 0.46 974\n",
" 2 0.87 0.70 0.62 0.78 0.66 0.44 7520\n",
" 3 0.17 0.26 0.90 0.20 0.48 0.21 697\n",
" 4 0.05 0.19 0.87 0.08 0.41 0.16 324\n",
"\n",
"avg / total 0.75 0.63 0.68 0.68 0.64 0.41 9515\n",
"\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"C:\\Users\\llois\\Anaconda\\lib\\site-packages\\ipykernel_launcher.py:36: SettingWithCopyWarning:\n",
"\n",
"\n",
"A value is trying to be set on a copy of a slice from a DataFrame.\n",
"Try using .loc[row_indexer,col_indexer] = value instead\n",
"\n",
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n",
"\n",
"C:\\Users\\llois\\Anaconda\\lib\\site-packages\\pandas\\core\\indexing.py:543: SettingWithCopyWarning:\n",
"\n",
"\n",
"A value is trying to be set on a copy of a slice from a DataFrame.\n",
"Try using .loc[row_indexer,col_indexer] = value instead\n",
"\n",
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n",
"\n",
"C:\\Users\\llois\\Anaconda\\lib\\site-packages\\ipykernel_launcher.py:37: SettingWithCopyWarning:\n",
"\n",
"\n",
"A value is trying to be set on a copy of a slice from a DataFrame.\n",
"Try using .loc[row_indexer,col_indexer] = value instead\n",
"\n",
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n",
"\n",
"C:\\Users\\llois\\Anaconda\\lib\\site-packages\\pandas\\core\\indexing.py:543: SettingWithCopyWarning:\n",
"\n",
"\n",
"A value is trying to be set on a copy of a slice from a DataFrame.\n",
"Try using .loc[row_indexer,col_indexer] = value instead\n",
"\n",
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n",
"\n",
"C:\\Users\\llois\\Anaconda\\lib\\site-packages\\ipykernel_launcher.py:47: SettingWithCopyWarning:\n",
"\n",
"\n",
"A value is trying to be set on a copy of a slice from a DataFrame.\n",
"Try using .loc[row_indexer,col_indexer] = value instead\n",
"\n",
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n",
"\n",
"C:\\Users\\llois\\Anaconda\\lib\\site-packages\\ipykernel_launcher.py:50: SettingWithCopyWarning:\n",
"\n",
"\n",
"A value is trying to be set on a copy of a slice from a DataFrame.\n",
"Try using .loc[row_indexer,col_indexer] = value instead\n",
"\n",
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n",
"\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"hi\n",
"[(1, 8589), (2, 59633), (3, 12916), (4, 4495)]\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"C:\\Users\\llois\\Anaconda\\lib\\site-packages\\sklearn\\linear_model\\logistic.py:432: FutureWarning:\n",
"\n",
"Default solver will be changed to 'lbfgs' in 0.22. Specify a solver to silence this warning.\n",
"\n",
"C:\\Users\\llois\\Anaconda\\lib\\site-packages\\sklearn\\linear_model\\logistic.py:469: FutureWarning:\n",
"\n",
"Default multi_class will be changed to 'auto' in 0.22. Specify the multi_class option to silence this warning.\n",
"\n",
"C:\\Users\\llois\\Anaconda\\lib\\site-packages\\sklearn\\linear_model\\logistic.py:432: FutureWarning:\n",
"\n",
"Default solver will be changed to 'lbfgs' in 0.22. Specify a solver to silence this warning.\n",
"\n",
"C:\\Users\\llois\\Anaconda\\lib\\site-packages\\sklearn\\linear_model\\logistic.py:469: FutureWarning:\n",
"\n",
"Default multi_class will be changed to 'auto' in 0.22. Specify the multi_class option to silence this warning.\n",
"\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"For fold 3:\n",
"Accuracy: 0.6162900683131897\n",
"f-score: 0.6162900683131897\n",
" pre rec spe f1 geo iba sup\n",
"\n",
" 1 0.49 0.59 0.91 0.54 0.73 0.52 1247\n",
" 2 0.83 0.71 0.67 0.76 0.69 0.48 6585\n",
" 3 0.31 0.27 0.89 0.29 0.49 0.22 1462\n",
" 4 0.06 0.29 0.89 0.09 0.50 0.24 221\n",
"\n",
"avg / total 0.69 0.62 0.74 0.65 0.66 0.44 9515\n",
"\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"C:\\Users\\llois\\Anaconda\\lib\\site-packages\\ipykernel_launcher.py:36: SettingWithCopyWarning:\n",
"\n",
"\n",
"A value is trying to be set on a copy of a slice from a DataFrame.\n",
"Try using .loc[row_indexer,col_indexer] = value instead\n",
"\n",
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n",
"\n",
"C:\\Users\\llois\\Anaconda\\lib\\site-packages\\pandas\\core\\indexing.py:543: SettingWithCopyWarning:\n",
"\n",
"\n",
"A value is trying to be set on a copy of a slice from a DataFrame.\n",
"Try using .loc[row_indexer,col_indexer] = value instead\n",
"\n",
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n",
"\n",
"C:\\Users\\llois\\Anaconda\\lib\\site-packages\\ipykernel_launcher.py:37: SettingWithCopyWarning:\n",
"\n",
"\n",
"A value is trying to be set on a copy of a slice from a DataFrame.\n",
"Try using .loc[row_indexer,col_indexer] = value instead\n",
"\n",
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n",
"\n",
"C:\\Users\\llois\\Anaconda\\lib\\site-packages\\pandas\\core\\indexing.py:543: SettingWithCopyWarning:\n",
"\n",
"\n",
"A value is trying to be set on a copy of a slice from a DataFrame.\n",
"Try using .loc[row_indexer,col_indexer] = value instead\n",
"\n",
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n",
"\n",
"C:\\Users\\llois\\Anaconda\\lib\\site-packages\\ipykernel_launcher.py:47: SettingWithCopyWarning:\n",
"\n",
"\n",
"A value is trying to be set on a copy of a slice from a DataFrame.\n",
"Try using .loc[row_indexer,col_indexer] = value instead\n",
"\n",
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n",
"\n",
"C:\\Users\\llois\\Anaconda\\lib\\site-packages\\ipykernel_launcher.py:50: SettingWithCopyWarning:\n",
"\n",
"\n",
"A value is trying to be set on a copy of a slice from a DataFrame.\n",
"Try using .loc[row_indexer,col_indexer] = value instead\n",
"\n",
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n",
"\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"hi\n",
"[(1, 8707), (2, 59870), (3, 13093), (4, 3963)]\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"C:\\Users\\llois\\Anaconda\\lib\\site-packages\\sklearn\\linear_model\\logistic.py:432: FutureWarning:\n",
"\n",
"Default solver will be changed to 'lbfgs' in 0.22. Specify a solver to silence this warning.\n",
"\n",
"C:\\Users\\llois\\Anaconda\\lib\\site-packages\\sklearn\\linear_model\\logistic.py:469: FutureWarning:\n",
"\n",
"Default multi_class will be changed to 'auto' in 0.22. Specify the multi_class option to silence this warning.\n",
"\n",
"C:\\Users\\llois\\Anaconda\\lib\\site-packages\\sklearn\\linear_model\\logistic.py:432: FutureWarning:\n",
"\n",
"Default solver will be changed to 'lbfgs' in 0.22. Specify a solver to silence this warning.\n",
"\n",
"C:\\Users\\llois\\Anaconda\\lib\\site-packages\\sklearn\\linear_model\\logistic.py:469: FutureWarning:\n",
"\n",
"Default multi_class will be changed to 'auto' in 0.22. Specify the multi_class option to silence this warning.\n",
"\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"For fold 4:\n",
"Accuracy: 0.6191276931161325\n",
"f-score: 0.6191276931161325\n",
" pre rec spe f1 geo iba sup\n",
"\n",
" 1 0.50 0.50 0.93 0.50 0.68 0.45 1129\n",
" 2 0.76 0.79 0.52 0.78 0.64 0.42 6348\n",
" 3 0.23 0.11 0.94 0.15 0.32 0.09 1285\n",
" 4 0.16 0.27 0.88 0.20 0.48 0.22 753\n",
"\n",
"avg / total 0.61 0.62 0.65 0.61 0.59 0.36 9515\n",
"\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"C:\\Users\\llois\\Anaconda\\lib\\site-packages\\ipykernel_launcher.py:36: SettingWithCopyWarning:\n",
"\n",
"\n",
"A value is trying to be set on a copy of a slice from a DataFrame.\n",
"Try using .loc[row_indexer,col_indexer] = value instead\n",
"\n",
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n",
"\n",
"C:\\Users\\llois\\Anaconda\\lib\\site-packages\\pandas\\core\\indexing.py:543: SettingWithCopyWarning:\n",
"\n",
"\n",
"A value is trying to be set on a copy of a slice from a DataFrame.\n",
"Try using .loc[row_indexer,col_indexer] = value instead\n",
"\n",
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n",
"\n",
"C:\\Users\\llois\\Anaconda\\lib\\site-packages\\ipykernel_launcher.py:37: SettingWithCopyWarning:\n",
"\n",
"\n",
"A value is trying to be set on a copy of a slice from a DataFrame.\n",
"Try using .loc[row_indexer,col_indexer] = value instead\n",
"\n",
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n",
"\n",
"C:\\Users\\llois\\Anaconda\\lib\\site-packages\\pandas\\core\\indexing.py:543: SettingWithCopyWarning:\n",
"\n",
"\n",
"A value is trying to be set on a copy of a slice from a DataFrame.\n",
"Try using .loc[row_indexer,col_indexer] = value instead\n",
"\n",
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n",
"\n",
"C:\\Users\\llois\\Anaconda\\lib\\site-packages\\ipykernel_launcher.py:47: SettingWithCopyWarning:\n",
"\n",
"\n",
"A value is trying to be set on a copy of a slice from a DataFrame.\n",
"Try using .loc[row_indexer,col_indexer] = value instead\n",
"\n",
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n",
"\n",
"C:\\Users\\llois\\Anaconda\\lib\\site-packages\\ipykernel_launcher.py:50: SettingWithCopyWarning:\n",
"\n",
"\n",
"A value is trying to be set on a copy of a slice from a DataFrame.\n",
"Try using .loc[row_indexer,col_indexer] = value instead\n",
"\n",
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n",
"\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"hi\n",
"[(1, 8751), (2, 59781), (3, 12721), (4, 4380)]\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"C:\\Users\\llois\\Anaconda\\lib\\site-packages\\sklearn\\linear_model\\logistic.py:432: FutureWarning:\n",
"\n",
"Default solver will be changed to 'lbfgs' in 0.22. Specify a solver to silence this warning.\n",
"\n",
"C:\\Users\\llois\\Anaconda\\lib\\site-packages\\sklearn\\linear_model\\logistic.py:469: FutureWarning:\n",
"\n",
"Default multi_class will be changed to 'auto' in 0.22. Specify the multi_class option to silence this warning.\n",
"\n",
"C:\\Users\\llois\\Anaconda\\lib\\site-packages\\sklearn\\linear_model\\logistic.py:432: FutureWarning:\n",
"\n",
"Default solver will be changed to 'lbfgs' in 0.22. Specify a solver to silence this warning.\n",
"\n",
"C:\\Users\\llois\\Anaconda\\lib\\site-packages\\sklearn\\linear_model\\logistic.py:469: FutureWarning:\n",
"\n",
"Default multi_class will be changed to 'auto' in 0.22. Specify the multi_class option to silence this warning.\n",
"\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"For fold 5:\n",
"Accuracy: 0.6122963741460852\n",
"f-score: 0.6122963741460852\n",
" pre rec spe f1 geo iba sup\n",
"\n",
" 1 0.49 0.51 0.93 0.50 0.69 0.45 1085\n",
" 2 0.79 0.75 0.59 0.77 0.66 0.45 6437\n",
" 3 0.37 0.21 0.92 0.26 0.44 0.18 1657\n",
" 4 0.07 0.29 0.86 0.11 0.50 0.23 336\n",
"\n",
"avg / total 0.66 0.61 0.69 0.63 0.62 0.39 9515\n",
"\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"C:\\Users\\llois\\Anaconda\\lib\\site-packages\\ipykernel_launcher.py:36: SettingWithCopyWarning:\n",
"\n",
"\n",
"A value is trying to be set on a copy of a slice from a DataFrame.\n",
"Try using .loc[row_indexer,col_indexer] = value instead\n",
"\n",
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n",
"\n",
"C:\\Users\\llois\\Anaconda\\lib\\site-packages\\pandas\\core\\indexing.py:543: SettingWithCopyWarning:\n",
"\n",
"\n",
"A value is trying to be set on a copy of a slice from a DataFrame.\n",
"Try using .loc[row_indexer,col_indexer] = value instead\n",
"\n",
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n",
"\n",
"C:\\Users\\llois\\Anaconda\\lib\\site-packages\\ipykernel_launcher.py:37: SettingWithCopyWarning:\n",
"\n",
"\n",
"A value is trying to be set on a copy of a slice from a DataFrame.\n",
"Try using .loc[row_indexer,col_indexer] = value instead\n",
"\n",
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n",
"\n",
"C:\\Users\\llois\\Anaconda\\lib\\site-packages\\pandas\\core\\indexing.py:543: SettingWithCopyWarning:\n",
"\n",
"\n",
"A value is trying to be set on a copy of a slice from a DataFrame.\n",
"Try using .loc[row_indexer,col_indexer] = value instead\n",
"\n",
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n",
"\n",
"C:\\Users\\llois\\Anaconda\\lib\\site-packages\\ipykernel_launcher.py:47: SettingWithCopyWarning:\n",
"\n",
"\n",
"A value is trying to be set on a copy of a slice from a DataFrame.\n",
"Try using .loc[row_indexer,col_indexer] = value instead\n",
"\n",
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n",
"\n",
"C:\\Users\\llois\\Anaconda\\lib\\site-packages\\ipykernel_launcher.py:50: SettingWithCopyWarning:\n",
"\n",
"\n",
"A value is trying to be set on a copy of a slice from a DataFrame.\n",
"Try using .loc[row_indexer,col_indexer] = value instead\n",
"\n",
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n",
"\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"hi\n",
"[(1, 9051), (2, 59994), (3, 12352), (4, 4236)]\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"C:\\Users\\llois\\Anaconda\\lib\\site-packages\\sklearn\\linear_model\\logistic.py:432: FutureWarning:\n",
"\n",
"Default solver will be changed to 'lbfgs' in 0.22. Specify a solver to silence this warning.\n",
"\n",
"C:\\Users\\llois\\Anaconda\\lib\\site-packages\\sklearn\\linear_model\\logistic.py:469: FutureWarning:\n",
"\n",
"Default multi_class will be changed to 'auto' in 0.22. Specify the multi_class option to silence this warning.\n",
"\n",
"C:\\Users\\llois\\Anaconda\\lib\\site-packages\\sklearn\\linear_model\\logistic.py:432: FutureWarning:\n",
"\n",
"Default solver will be changed to 'lbfgs' in 0.22. Specify a solver to silence this warning.\n",
"\n",
"C:\\Users\\llois\\Anaconda\\lib\\site-packages\\sklearn\\linear_model\\logistic.py:469: FutureWarning:\n",
"\n",
"Default multi_class will be changed to 'auto' in 0.22. Specify the multi_class option to silence this warning.\n",
"\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"For fold 6:\n",
"Accuracy: 0.6133473462953232\n",
"f-score: 0.6133473462953232\n",
" pre rec spe f1 geo iba sup\n",
"\n",
" 1 0.36 0.56 0.91 0.43 0.71 0.49 785\n",
" 2 0.79 0.77 0.61 0.78 0.69 0.48 6224\n",
" 3 0.43 0.25 0.91 0.31 0.48 0.21 2026\n",
" 4 0.12 0.26 0.90 0.16 0.48 0.22 480\n",
"\n",
"avg / total 0.64 0.61 0.72 0.62 0.63 0.41 9515\n",
"\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"C:\\Users\\llois\\Anaconda\\lib\\site-packages\\ipykernel_launcher.py:36: SettingWithCopyWarning:\n",
"\n",
"\n",
"A value is trying to be set on a copy of a slice from a DataFrame.\n",
"Try using .loc[row_indexer,col_indexer] = value instead\n",
"\n",
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n",
"\n",
"C:\\Users\\llois\\Anaconda\\lib\\site-packages\\pandas\\core\\indexing.py:543: SettingWithCopyWarning:\n",
"\n",
"\n",
"A value is trying to be set on a copy of a slice from a DataFrame.\n",
"Try using .loc[row_indexer,col_indexer] = value instead\n",
"\n",
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n",
"\n",
"C:\\Users\\llois\\Anaconda\\lib\\site-packages\\ipykernel_launcher.py:37: SettingWithCopyWarning:\n",
"\n",
"\n",
"A value is trying to be set on a copy of a slice from a DataFrame.\n",
"Try using .loc[row_indexer,col_indexer] = value instead\n",
"\n",
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n",
"\n",
"C:\\Users\\llois\\Anaconda\\lib\\site-packages\\pandas\\core\\indexing.py:543: SettingWithCopyWarning:\n",
"\n",
"\n",
"A value is trying to be set on a copy of a slice from a DataFrame.\n",
"Try using .loc[row_indexer,col_indexer] = value instead\n",
"\n",
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n",
"\n",
"C:\\Users\\llois\\Anaconda\\lib\\site-packages\\ipykernel_launcher.py:47: SettingWithCopyWarning:\n",
"\n",
"\n",
"A value is trying to be set on a copy of a slice from a DataFrame.\n",
"Try using .loc[row_indexer,col_indexer] = value instead\n",
"\n",
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n",
"\n",
"C:\\Users\\llois\\Anaconda\\lib\\site-packages\\ipykernel_launcher.py:50: SettingWithCopyWarning:\n",
"\n",
"\n",
"A value is trying to be set on a copy of a slice from a DataFrame.\n",
"Try using .loc[row_indexer,col_indexer] = value instead\n",
"\n",
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n",
"\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"hi\n",
"[(1, 8983), (2, 59534), (3, 13169), (4, 3947)]\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"C:\\Users\\llois\\Anaconda\\lib\\site-packages\\sklearn\\linear_model\\logistic.py:432: FutureWarning:\n",
"\n",
"Default solver will be changed to 'lbfgs' in 0.22. Specify a solver to silence this warning.\n",
"\n",
"C:\\Users\\llois\\Anaconda\\lib\\site-packages\\sklearn\\linear_model\\logistic.py:469: FutureWarning:\n",
"\n",
"Default multi_class will be changed to 'auto' in 0.22. Specify the multi_class option to silence this warning.\n",
"\n",
"C:\\Users\\llois\\Anaconda\\lib\\site-packages\\sklearn\\linear_model\\logistic.py:432: FutureWarning:\n",
"\n",
"Default solver will be changed to 'lbfgs' in 0.22. Specify a solver to silence this warning.\n",
"\n",
"C:\\Users\\llois\\Anaconda\\lib\\site-packages\\sklearn\\linear_model\\logistic.py:469: FutureWarning:\n",
"\n",
"Default multi_class will be changed to 'auto' in 0.22. Specify the multi_class option to silence this warning.\n",
"\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"For fold 7:\n",
"Accuracy: 0.6250131371518655\n",
"f-score: 0.6249080399369417\n",
" pre rec spe f1 geo iba sup\n",
"\n",
" 1 0.44 0.53 0.93 0.48 0.70 0.47 853\n",
" 2 0.83 0.73 0.65 0.77 0.69 0.47 6684\n",
" 3 0.30 0.38 0.87 0.33 0.57 0.31 1209\n",
" 4 0.17 0.25 0.89 0.20 0.47 0.21 769\n",
"\n",
"avg / total 0.67 0.62 0.72 0.65 0.66 0.43 9515\n",
"\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"C:\\Users\\llois\\Anaconda\\lib\\site-packages\\ipykernel_launcher.py:36: SettingWithCopyWarning:\n",
"\n",
"\n",
"A value is trying to be set on a copy of a slice from a DataFrame.\n",
"Try using .loc[row_indexer,col_indexer] = value instead\n",
"\n",
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n",
"\n",
"C:\\Users\\llois\\Anaconda\\lib\\site-packages\\pandas\\core\\indexing.py:543: SettingWithCopyWarning:\n",
"\n",
"\n",
"A value is trying to be set on a copy of a slice from a DataFrame.\n",
"Try using .loc[row_indexer,col_indexer] = value instead\n",
"\n",
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n",
"\n",
"C:\\Users\\llois\\Anaconda\\lib\\site-packages\\ipykernel_launcher.py:37: SettingWithCopyWarning:\n",
"\n",
"\n",
"A value is trying to be set on a copy of a slice from a DataFrame.\n",
"Try using .loc[row_indexer,col_indexer] = value instead\n",
"\n",
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n",
"\n",
"C:\\Users\\llois\\Anaconda\\lib\\site-packages\\pandas\\core\\indexing.py:543: SettingWithCopyWarning:\n",
"\n",
"\n",
"A value is trying to be set on a copy of a slice from a DataFrame.\n",
"Try using .loc[row_indexer,col_indexer] = value instead\n",
"\n",
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n",
"\n",
"C:\\Users\\llois\\Anaconda\\lib\\site-packages\\ipykernel_launcher.py:47: SettingWithCopyWarning:\n",
"\n",
"\n",
"A value is trying to be set on a copy of a slice from a DataFrame.\n",
"Try using .loc[row_indexer,col_indexer] = value instead\n",
"\n",
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n",
"\n",
"C:\\Users\\llois\\Anaconda\\lib\\site-packages\\ipykernel_launcher.py:50: SettingWithCopyWarning:\n",
"\n",
"\n",
"A value is trying to be set on a copy of a slice from a DataFrame.\n",
"Try using .loc[row_indexer,col_indexer] = value instead\n",
"\n",
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n",
"\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"hi\n",
"[(1, 8903), (2, 59573), (3, 12703), (4, 4454)]\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"C:\\Users\\llois\\Anaconda\\lib\\site-packages\\sklearn\\linear_model\\logistic.py:432: FutureWarning:\n",
"\n",
"Default solver will be changed to 'lbfgs' in 0.22. Specify a solver to silence this warning.\n",
"\n",
"C:\\Users\\llois\\Anaconda\\lib\\site-packages\\sklearn\\linear_model\\logistic.py:469: FutureWarning:\n",
"\n",
"Default multi_class will be changed to 'auto' in 0.22. Specify the multi_class option to silence this warning.\n",
"\n",
"C:\\Users\\llois\\Anaconda\\lib\\site-packages\\sklearn\\linear_model\\logistic.py:432: FutureWarning:\n",
"\n",
"Default solver will be changed to 'lbfgs' in 0.22. Specify a solver to silence this warning.\n",
"\n",
"C:\\Users\\llois\\Anaconda\\lib\\site-packages\\sklearn\\linear_model\\logistic.py:469: FutureWarning:\n",
"\n",
"Default multi_class will be changed to 'auto' in 0.22. Specify the multi_class option to silence this warning.\n",
"\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"For fold 8:\n",
"Accuracy: 0.5963215974776669\n",
"f-score: 0.5963215974776669\n",
" pre rec spe f1 geo iba sup\n",
"\n",
" 1 0.48 0.46 0.95 0.47 0.66 0.41 933\n",
" 2 0.81 0.70 0.62 0.75 0.66 0.44 6645\n",
" 3 0.35 0.28 0.89 0.31 0.50 0.24 1675\n",
" 4 0.06 0.36 0.85 0.11 0.55 0.29 262\n",
"\n",
"avg / total 0.68 0.60 0.71 0.63 0.63 0.40 9515\n",
"\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"C:\\Users\\llois\\Anaconda\\lib\\site-packages\\ipykernel_launcher.py:36: SettingWithCopyWarning:\n",
"\n",
"\n",
"A value is trying to be set on a copy of a slice from a DataFrame.\n",
"Try using .loc[row_indexer,col_indexer] = value instead\n",
"\n",
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n",
"\n",
"C:\\Users\\llois\\Anaconda\\lib\\site-packages\\pandas\\core\\indexing.py:543: SettingWithCopyWarning:\n",
"\n",
"\n",
"A value is trying to be set on a copy of a slice from a DataFrame.\n",
"Try using .loc[row_indexer,col_indexer] = value instead\n",
"\n",
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n",
"\n",
"C:\\Users\\llois\\Anaconda\\lib\\site-packages\\ipykernel_launcher.py:37: SettingWithCopyWarning:\n",
"\n",
"\n",
"A value is trying to be set on a copy of a slice from a DataFrame.\n",
"Try using .loc[row_indexer,col_indexer] = value instead\n",
"\n",
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n",
"\n",
"C:\\Users\\llois\\Anaconda\\lib\\site-packages\\pandas\\core\\indexing.py:543: SettingWithCopyWarning:\n",
"\n",
"\n",
"A value is trying to be set on a copy of a slice from a DataFrame.\n",
"Try using .loc[row_indexer,col_indexer] = value instead\n",
"\n",
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n",
"\n",
"C:\\Users\\llois\\Anaconda\\lib\\site-packages\\ipykernel_launcher.py:47: SettingWithCopyWarning:\n",
"\n",
"\n",
"A value is trying to be set on a copy of a slice from a DataFrame.\n",
"Try using .loc[row_indexer,col_indexer] = value instead\n",
"\n",
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n",
"\n",
"C:\\Users\\llois\\Anaconda\\lib\\site-packages\\ipykernel_launcher.py:50: SettingWithCopyWarning:\n",
"\n",
"\n",
"A value is trying to be set on a copy of a slice from a DataFrame.\n",
"Try using .loc[row_indexer,col_indexer] = value instead\n",
"\n",
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n",
"\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"hi\n",
"[(1, 8805), (2, 59819), (3, 12883), (4, 4127)]\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"C:\\Users\\llois\\Anaconda\\lib\\site-packages\\sklearn\\linear_model\\logistic.py:432: FutureWarning:\n",
"\n",
"Default solver will be changed to 'lbfgs' in 0.22. Specify a solver to silence this warning.\n",
"\n",
"C:\\Users\\llois\\Anaconda\\lib\\site-packages\\sklearn\\linear_model\\logistic.py:469: FutureWarning:\n",
"\n",
"Default multi_class will be changed to 'auto' in 0.22. Specify the multi_class option to silence this warning.\n",
"\n",
"C:\\Users\\llois\\Anaconda\\lib\\site-packages\\sklearn\\linear_model\\logistic.py:432: FutureWarning:\n",
"\n",
"Default solver will be changed to 'lbfgs' in 0.22. Specify a solver to silence this warning.\n",
"\n",
"C:\\Users\\llois\\Anaconda\\lib\\site-packages\\sklearn\\linear_model\\logistic.py:469: FutureWarning:\n",
"\n",
"Default multi_class will be changed to 'auto' in 0.22. Specify the multi_class option to silence this warning.\n",
"\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"For fold 9:\n",
"Accuracy: 0.6217153668278327\n",
"f-score: 0.6217153668278327\n",
" pre rec spe f1 geo iba sup\n",
"\n",
" 1 0.49 0.49 0.94 0.49 0.68 0.44 1031\n",
" 2 0.81 0.76 0.63 0.78 0.69 0.48 6399\n",
" 3 0.34 0.23 0.92 0.27 0.46 0.19 1495\n",
" 4 0.14 0.34 0.86 0.20 0.54 0.28 589\n",
"\n",
"avg / total 0.66 0.62 0.72 0.63 0.64 0.42 9514\n",
"\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"C:\\Users\\llois\\Anaconda\\lib\\site-packages\\ipykernel_launcher.py:36: SettingWithCopyWarning:\n",
"\n",
"\n",
"A value is trying to be set on a copy of a slice from a DataFrame.\n",
"Try using .loc[row_indexer,col_indexer] = value instead\n",
"\n",
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n",
"\n",
"C:\\Users\\llois\\Anaconda\\lib\\site-packages\\pandas\\core\\indexing.py:543: SettingWithCopyWarning:\n",
"\n",
"\n",
"A value is trying to be set on a copy of a slice from a DataFrame.\n",
"Try using .loc[row_indexer,col_indexer] = value instead\n",
"\n",
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n",
"\n",
"C:\\Users\\llois\\Anaconda\\lib\\site-packages\\ipykernel_launcher.py:37: SettingWithCopyWarning:\n",
"\n",
"\n",
"A value is trying to be set on a copy of a slice from a DataFrame.\n",
"Try using .loc[row_indexer,col_indexer] = value instead\n",
"\n",
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n",
"\n",
"C:\\Users\\llois\\Anaconda\\lib\\site-packages\\pandas\\core\\indexing.py:543: SettingWithCopyWarning:\n",
"\n",
"\n",
"A value is trying to be set on a copy of a slice from a DataFrame.\n",
"Try using .loc[row_indexer,col_indexer] = value instead\n",
"\n",
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n",
"\n",
"C:\\Users\\llois\\Anaconda\\lib\\site-packages\\ipykernel_launcher.py:47: SettingWithCopyWarning:\n",
"\n",
"\n",
"A value is trying to be set on a copy of a slice from a DataFrame.\n",
"Try using .loc[row_indexer,col_indexer] = value instead\n",
"\n",
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n",
"\n",
"C:\\Users\\llois\\Anaconda\\lib\\site-packages\\ipykernel_launcher.py:50: SettingWithCopyWarning:\n",
"\n",
"\n",
"A value is trying to be set on a copy of a slice from a DataFrame.\n",
"Try using .loc[row_indexer,col_indexer] = value instead\n",
"\n",
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n",
"\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"hi\n",
"[(1, 8679), (2, 59618), (3, 13222), (4, 4115)]\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"C:\\Users\\llois\\Anaconda\\lib\\site-packages\\sklearn\\linear_model\\logistic.py:432: FutureWarning:\n",
"\n",
"Default solver will be changed to 'lbfgs' in 0.22. Specify a solver to silence this warning.\n",
"\n",
"C:\\Users\\llois\\Anaconda\\lib\\site-packages\\sklearn\\linear_model\\logistic.py:469: FutureWarning:\n",
"\n",
"Default multi_class will be changed to 'auto' in 0.22. Specify the multi_class option to silence this warning.\n",
"\n",
"C:\\Users\\llois\\Anaconda\\lib\\site-packages\\sklearn\\linear_model\\logistic.py:432: FutureWarning:\n",
"\n",
"Default solver will be changed to 'lbfgs' in 0.22. Specify a solver to silence this warning.\n",
"\n",
"C:\\Users\\llois\\Anaconda\\lib\\site-packages\\sklearn\\linear_model\\logistic.py:469: FutureWarning:\n",
"\n",
"Default multi_class will be changed to 'auto' in 0.22. Specify the multi_class option to silence this warning.\n",
"\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"For fold 10:\n",
"Accuracy: 0.6359049821315955\n",
"f-score: 0.6359049821315955\n",
" pre rec spe f1 geo iba sup\n",
"\n",
" 1 0.51 0.57 0.92 0.54 0.72 0.51 1157\n",
" 2 0.81 0.76 0.60 0.79 0.68 0.46 6600\n",
" 3 0.30 0.17 0.95 0.21 0.40 0.14 1156\n",
" 4 0.11 0.26 0.86 0.16 0.47 0.21 601\n",
"\n",
"avg / total 0.67 0.64 0.70 0.65 0.63 0.41 9514\n",
"\n"
]
},
{
"data": {
"text/plain": [
"<Figure size 432x288 with 0 Axes>"
]
},
"metadata": {
"tags": []
},
"output_type": "display_data"
}
],
"source": [
"from sklearn.model_selection import KFold\n",
"from sklearn import preprocessing\n",
"from imblearn.over_sampling import SMOTE\n",
"from imblearn.over_sampling import SMOTENC\n",
"from sklearn.metrics import f1_score\n",
"from imblearn.metrics import classification_report_imbalanced\n",
"from yellowbrick.classifier import ROCAUC\n",
"from sklearn.linear_model import LogisticRegression\n",
"import numpy as np\n",
"import pandas as pd\n",
"from sklearn.model_selection import cross_val_score, StratifiedKFold\n",
"from sklearn.ensemble import RandomForestClassifier\n",
"from sklearn.metrics import make_scorer\n",
"import xgboost as xgb\n",
"import lightgbm as lgbm\n",
"from collections import Counter\n",
"from sklearn.cluster import KMeans\n",
"\n",
"\n",
"\n",
"classes=['Death','Home','Nursing Home','Rehabilitation']\n",
"\n",
"\n",
"kf = KFold(n_splits=10)\n",
"\n",
"for fold, (train_index, test_index) in enumerate(kf.split(X), 1):\n",
" X_train = X.iloc[train_index]\n",
" y_train = y.iloc[train_index] # Based on your code, you might need a ravel call here, but I would look into how you're generating your y\n",
" X_test = X.iloc[test_index]\n",
" y_test = y.iloc[test_index] # See comment on ravel and y_train\n",
" \n",
" n_clusters = len(np.unique(y_train))\n",
" \n",
"#------------------------------Standardize Testing Set------------------------------------\n",
" std_scale = preprocessing.StandardScaler().fit(X_train[cols_to_norm])\n",
" X_train[cols_to_norm] = std_scale.transform(X_train[cols_to_norm])\n",
" X_test[cols_to_norm] = std_scale.transform(X_test[cols_to_norm])\n",
"#------------------------------------------------------------------------------------------\n",
"\n",
" # Hyperparameters are optimized using hyperopt\n",
"\n",
" \n",
" clf = KMeans(n_clusters = n_clusters, random_state=42)\n",
" clf.fit(X_train[['vent', 'temperature', 'bun', 'fio2', 'gcs','age', 'offset','diaggroup_CVA', 'diaggroup_CardiacArrest', 'diaggroup_Sepsis']])\n",
" y_labels_train = clf.labels_\n",
" y_labels_test = clf.predict(X_test[['vent', 'temperature', 'bun', 'fio2', 'gcs','age', 'offset','diaggroup_CVA', 'diaggroup_CardiacArrest', 'diaggroup_Sepsis']])\n",
" X_train['km_clust'] = y_labels_train\n",
" print(\"hi\")\n",
" X_train.shape\n",
" X_test['km_clust'] = y_labels_test\n",
" X_test.shape\n",
" \n",
" \n",
" \n",
" \n",
"#------------------------------------------------------------------------------------------\n",
" \n",
" sm = SMOTENC(random_state=50, categorical_features=[1,2,3,22,23,24,25,26,27,28,29,30,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61, 62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81])\n",
" X_train_oversampled, y_train_oversampled = sm.fit_sample(X_train, y_train)\n",
" print(sorted(Counter(y_train).items()))\n",
" model = linear_model.LogisticRegression(C= 2.5,max_iter= 100,tol= 6.75e-05,penalty='l1', class_weight='balanced') \n",
" model.fit(X_train_oversampled, y_train_oversampled) \n",
" y_pred = model.predict(X_test)\n",
" visualizer = ROCAUC(model, classes=classes)\n",
" visualizer.fit(X_train_oversampled, y_train_oversampled) # Fit the training data to the visualizer\n",
" visualizer.score(X_test, y_test) # Evaluate the model on the test data\n",
" visualizer.poof(\"LR_Mixed_Main_{}.pdf\".format(fold), clear_figure=True) \n",
" print(f'For fold {fold}:')\n",
" print(f'Accuracy: {model.score(X_test, y_test)}')\n",
" f1=f1_score(y_test, y_pred, average='micro')\n",
" print(f'f-score: {f1}')\n",
" print(classification_report_imbalanced(y_test, y_pred))\n",
" \n",
"\n",
"\n",
" \n",
" "
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "kF-qCqGV6lMI",
"outputId": "2067787a-71df-4819-db20-59705c0a7e8a"
},
"outputs": [
{
"data": {
"text/plain": [
"0 1\n",
"1 3\n",
"2 1\n",
"3 1\n",
"4 1\n",
"5 3\n",
"6 1\n",
"7 1\n",
"8 3\n",
"9 1\n",
"10 1\n",
"11 1\n",
"12 3\n",
"13 0\n",
"14 1\n",
"15 3\n",
"16 1\n",
"17 3\n",
"18 1\n",
"19 1\n",
"20 1\n",
"21 1\n",
"22 1\n",
"23 1\n",
"24 1\n",
"25 1\n",
"26 3\n",
"27 3\n",
"28 0\n",
"29 1\n",
" ..\n",
"97186 1\n",
"97187 1\n",
"97188 1\n",
"97189 1\n",
"97190 1\n",
"97191 0\n",
"97192 3\n",
"97193 1\n",
"97194 1\n",
"97195 1\n",
"97196 0\n",
"97197 1\n",
"97198 3\n",
"97199 1\n",
"97200 1\n",
"97201 0\n",
"97202 3\n",
"97203 1\n",
"97204 1\n",
"97205 0\n",
"97206 2\n",
"97207 0\n",
"97208 3\n",
"97209 1\n",
"97210 1\n",
"97211 1\n",
"97212 1\n",
"97213 3\n",
"97214 1\n",
"97215 0\n",
"Name: km_clust, Length: 97216, dtype: int32"
]
},
"execution_count": 32,
"metadata": {
"tags": []
},
"output_type": "execute_result"
}
],
"source": [
"X_train['km_clust']"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "eQO4m1JD6lMI"
},
"outputs": [],
"source": [
"r=X_train.copy()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "F0p1tQnq6lMJ",
"outputId": "ab11cb9a-73c3-46b6-eba7-d05253a4cca0"
},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>sodium</th>\n",
" <th>electivesurgery</th>\n",
" <th>vent</th>\n",
" <th>dialysis</th>\n",
" <th>gcs</th>\n",
" <th>urine</th>\n",
" <th>wbc</th>\n",
" <th>temperature</th>\n",
" <th>respiratoryrate</th>\n",
" <th>heartrate</th>\n",
" <th>...</th>\n",
" <th>m12_True</th>\n",
" <th>m13_True</th>\n",
" <th>m14_True</th>\n",
" <th>m15_True</th>\n",
" <th>m16_True</th>\n",
" <th>m17_True</th>\n",
" <th>m18_True</th>\n",
" <th>m19_True</th>\n",
" <th>m20_True</th>\n",
" <th>km_clust</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>-0.681964</td>\n",
" <td>0.859496</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>-0.166369</td>\n",
" <td>-1.396133</td>\n",
" <td>0.337637</td>\n",
" <td>3.604419</td>\n",
" <td>0.782521</td>\n",
" <td>0.643651</td>\n",
" <td>...</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>-0.861765</td>\n",
" <td>1.482495</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.176378</td>\n",
" <td>0.297334</td>\n",
" <td>0.380078</td>\n",
" <td>0.293250</td>\n",
" <td>0.850101</td>\n",
" <td>0.116229</td>\n",
" <td>...</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>3</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>1.059665</td>\n",
" <td>1.000000</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>0.519125</td>\n",
" <td>-0.543367</td>\n",
" <td>-0.492726</td>\n",
" <td>-2.126451</td>\n",
" <td>-1.380049</td>\n",
" <td>0.511796</td>\n",
" <td>...</td>\n",
" <td>0.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>-0.117364</td>\n",
" <td>0.925698</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.519125</td>\n",
" <td>1.611408</td>\n",
" <td>-0.097963</td>\n",
" <td>0.165897</td>\n",
" <td>0.714940</td>\n",
" <td>0.478832</td>\n",
" <td>...</td>\n",
" <td>0.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>-0.493764</td>\n",
" <td>0.916627</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.519125</td>\n",
" <td>0.443590</td>\n",
" <td>-0.778588</td>\n",
" <td>-1.871745</td>\n",
" <td>1.931386</td>\n",
" <td>1.138110</td>\n",
" <td>...</td>\n",
" <td>0.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>5</th>\n",
" <td>0.259036</td>\n",
" <td>1.098652</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.519125</td>\n",
" <td>1.114718</td>\n",
" <td>-0.438276</td>\n",
" <td>-0.216161</td>\n",
" <td>1.458324</td>\n",
" <td>-0.147482</td>\n",
" <td>...</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>3</td>\n",
" </tr>\n",
" <tr>\n",
" <th>6</th>\n",
" <td>0.552113</td>\n",
" <td>1.000000</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.519125</td>\n",
" <td>-0.369482</td>\n",
" <td>-0.290931</td>\n",
" <td>0.420602</td>\n",
" <td>-0.636666</td>\n",
" <td>0.083265</td>\n",
" <td>...</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>7</th>\n",
" <td>-0.493764</td>\n",
" <td>1.000000</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.176378</td>\n",
" <td>1.992667</td>\n",
" <td>-0.534937</td>\n",
" <td>-0.088808</td>\n",
" <td>-0.028443</td>\n",
" <td>-0.114519</td>\n",
" <td>...</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>8</th>\n",
" <td>3.474343</td>\n",
" <td>0.301079</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.519125</td>\n",
" <td>0.189526</td>\n",
" <td>-0.364714</td>\n",
" <td>0.165897</td>\n",
" <td>0.241878</td>\n",
" <td>0.248084</td>\n",
" <td>...</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>3</td>\n",
" </tr>\n",
" <tr>\n",
" <th>9</th>\n",
" <td>0.447236</td>\n",
" <td>1.000000</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.519125</td>\n",
" <td>1.251597</td>\n",
" <td>-0.179638</td>\n",
" <td>0.165897</td>\n",
" <td>1.188002</td>\n",
" <td>0.709579</td>\n",
" <td>...</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>10</th>\n",
" <td>-0.305564</td>\n",
" <td>1.000000</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.519125</td>\n",
" <td>-0.866858</td>\n",
" <td>-1.118901</td>\n",
" <td>-1.107629</td>\n",
" <td>-1.042148</td>\n",
" <td>-1.531966</td>\n",
" <td>...</td>\n",
" <td>0.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>11</th>\n",
" <td>-0.117364</td>\n",
" <td>1.122396</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.519125</td>\n",
" <td>-0.912948</td>\n",
" <td>0.800462</td>\n",
" <td>0.165897</td>\n",
" <td>-0.163604</td>\n",
" <td>-0.543049</td>\n",
" <td>...</td>\n",
" <td>0.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>12</th>\n",
" <td>0.447236</td>\n",
" <td>1.138969</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.519125</td>\n",
" <td>-0.138761</td>\n",
" <td>-0.764976</td>\n",
" <td>0.165897</td>\n",
" <td>1.728645</td>\n",
" <td>-0.246374</td>\n",
" <td>...</td>\n",
" <td>0.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>3</td>\n",
" </tr>\n",
" <tr>\n",
" <th>13</th>\n",
" <td>-1.058364</td>\n",
" <td>0.826892</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>-2.565597</td>\n",
" <td>-1.467063</td>\n",
" <td>-0.261313</td>\n",
" <td>-0.088808</td>\n",
" <td>0.647360</td>\n",
" <td>0.511796</td>\n",
" <td>...</td>\n",
" <td>0.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>14</th>\n",
" <td>1.143563</td>\n",
" <td>1.419359</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.176378</td>\n",
" <td>0.756106</td>\n",
" <td>-0.901101</td>\n",
" <td>0.165897</td>\n",
" <td>-1.380049</td>\n",
" <td>-0.015627</td>\n",
" <td>...</td>\n",
" <td>0.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>15</th>\n",
" <td>0.685819</td>\n",
" <td>1.000000</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>0.519125</td>\n",
" <td>-0.640511</td>\n",
" <td>0.405699</td>\n",
" <td>-0.088808</td>\n",
" <td>-1.042148</td>\n",
" <td>2.555557</td>\n",
" <td>...</td>\n",
" <td>0.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>3</td>\n",
" </tr>\n",
" <tr>\n",
" <th>16</th>\n",
" <td>0.555785</td>\n",
" <td>1.000000</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.519125</td>\n",
" <td>-1.306823</td>\n",
" <td>0.863921</td>\n",
" <td>-0.088808</td>\n",
" <td>-0.569086</td>\n",
" <td>-1.400111</td>\n",
" <td>...</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>17</th>\n",
" <td>0.070836</td>\n",
" <td>1.000000</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.519125</td>\n",
" <td>-1.292957</td>\n",
" <td>1.385799</td>\n",
" <td>0.293250</td>\n",
" <td>1.593484</td>\n",
" <td>0.973290</td>\n",
" <td>...</td>\n",
" <td>0.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>3</td>\n",
" </tr>\n",
" <tr>\n",
" <th>18</th>\n",
" <td>1.576435</td>\n",
" <td>0.523411</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>-1.194609</td>\n",
" <td>2.393056</td>\n",
" <td>-0.234088</td>\n",
" <td>-0.216161</td>\n",
" <td>0.579780</td>\n",
" <td>0.017337</td>\n",
" <td>...</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>19</th>\n",
" <td>-0.117364</td>\n",
" <td>0.734129</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.519125</td>\n",
" <td>-1.155986</td>\n",
" <td>-0.451888</td>\n",
" <td>0.038545</td>\n",
" <td>-0.839407</td>\n",
" <td>0.182157</td>\n",
" <td>...</td>\n",
" <td>0.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>20</th>\n",
" <td>-0.493764</td>\n",
" <td>0.471570</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.519125</td>\n",
" <td>0.310790</td>\n",
" <td>-0.710526</td>\n",
" <td>0.293250</td>\n",
" <td>-0.298764</td>\n",
" <td>0.643651</td>\n",
" <td>...</td>\n",
" <td>0.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>21</th>\n",
" <td>0.447236</td>\n",
" <td>0.000000</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>0.519125</td>\n",
" <td>-0.401062</td>\n",
" <td>0.255962</td>\n",
" <td>0.165897</td>\n",
" <td>-0.636666</td>\n",
" <td>-0.147482</td>\n",
" <td>...</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>22</th>\n",
" <td>-0.493764</td>\n",
" <td>1.000000</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.519125</td>\n",
" <td>-0.354343</td>\n",
" <td>-0.206863</td>\n",
" <td>0.165897</td>\n",
" <td>-0.974568</td>\n",
" <td>3.313727</td>\n",
" <td>...</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>1.0</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>23</th>\n",
" <td>-0.681964</td>\n",
" <td>1.064101</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.519125</td>\n",
" <td>0.325140</td>\n",
" <td>-0.560788</td>\n",
" <td>0.293250</td>\n",
" <td>-0.704246</td>\n",
" <td>-0.279338</td>\n",
" <td>...</td>\n",
" <td>0.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>24</th>\n",
" <td>-0.273389</td>\n",
" <td>0.244215</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.519125</td>\n",
" <td>-0.739734</td>\n",
" <td>-0.744194</td>\n",
" <td>-1.871745</td>\n",
" <td>-0.163604</td>\n",
" <td>-1.367147</td>\n",
" <td>...</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>25</th>\n",
" <td>1.377070</td>\n",
" <td>1.000000</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.519125</td>\n",
" <td>0.521300</td>\n",
" <td>-1.090165</td>\n",
" <td>-0.088808</td>\n",
" <td>0.985262</td>\n",
" <td>-1.169363</td>\n",
" <td>...</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>26</th>\n",
" <td>-1.200002</td>\n",
" <td>1.263085</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.519125</td>\n",
" <td>0.435928</td>\n",
" <td>-0.325981</td>\n",
" <td>0.293250</td>\n",
" <td>-0.704246</td>\n",
" <td>1.105146</td>\n",
" <td>...</td>\n",
" <td>0.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>3</td>\n",
" </tr>\n",
" <tr>\n",
" <th>27</th>\n",
" <td>0.070836</td>\n",
" <td>0.996634</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.519125</td>\n",
" <td>-0.174357</td>\n",
" <td>-0.383826</td>\n",
" <td>-0.470866</td>\n",
" <td>1.188002</td>\n",
" <td>-0.114519</td>\n",
" <td>...</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>3</td>\n",
" </tr>\n",
" <tr>\n",
" <th>28</th>\n",
" <td>0.823635</td>\n",
" <td>1.045833</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>-1.537356</td>\n",
" <td>-0.757020</td>\n",
" <td>-0.490307</td>\n",
" <td>0.675308</td>\n",
" <td>-1.380049</td>\n",
" <td>-0.147482</td>\n",
" <td>...</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>29</th>\n",
" <td>1.200035</td>\n",
" <td>1.160238</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.519125</td>\n",
" <td>-0.856408</td>\n",
" <td>-0.846651</td>\n",
" <td>0.420602</td>\n",
" <td>1.323163</td>\n",
" <td>0.314012</td>\n",
" <td>...</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>...</th>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" </tr>\n",
" <tr>\n",
" <th>97186</th>\n",
" <td>-2.026258</td>\n",
" <td>1.000000</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.519125</td>\n",
" <td>0.326659</td>\n",
" <td>-0.511688</td>\n",
" <td>-0.343513</td>\n",
" <td>0.377039</td>\n",
" <td>-1.993461</td>\n",
" <td>...</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>97187</th>\n",
" <td>-2.166705</td>\n",
" <td>1.000000</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.519125</td>\n",
" <td>-0.089078</td>\n",
" <td>-0.388565</td>\n",
" <td>-0.088808</td>\n",
" <td>-1.177308</td>\n",
" <td>-1.235291</td>\n",
" <td>...</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>97188</th>\n",
" <td>1.023733</td>\n",
" <td>0.958161</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>-0.674986</td>\n",
" <td>-0.590674</td>\n",
" <td>0.226332</td>\n",
" <td>-0.598219</td>\n",
" <td>-0.906987</td>\n",
" <td>-2.059389</td>\n",
" <td>...</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>97189</th>\n",
" <td>1.576435</td>\n",
" <td>0.406408</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.519125</td>\n",
" <td>-1.172530</td>\n",
" <td>-0.119372</td>\n",
" <td>0.165897</td>\n",
" <td>-0.906987</td>\n",
" <td>-0.444158</td>\n",
" <td>...</td>\n",
" <td>0.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>97190</th>\n",
" <td>0.767009</td>\n",
" <td>1.000000</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.176378</td>\n",
" <td>0.535019</td>\n",
" <td>1.247073</td>\n",
" <td>0.675308</td>\n",
" <td>0.039137</td>\n",
" <td>-0.147482</td>\n",
" <td>...</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>97191</th>\n",
" <td>-0.426119</td>\n",
" <td>0.535617</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>-1.014049</td>\n",
" <td>1.509891</td>\n",
" <td>1.210075</td>\n",
" <td>0.293250</td>\n",
" <td>-0.636666</td>\n",
" <td>0.215120</td>\n",
" <td>...</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>97192</th>\n",
" <td>1.200035</td>\n",
" <td>0.424769</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.176378</td>\n",
" <td>-0.752318</td>\n",
" <td>-0.656076</td>\n",
" <td>-0.343513</td>\n",
" <td>-0.906987</td>\n",
" <td>1.237001</td>\n",
" <td>...</td>\n",
" <td>0.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>3</td>\n",
" </tr>\n",
" <tr>\n",
" <th>97193</th>\n",
" <td>0.259036</td>\n",
" <td>1.138332</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.519125</td>\n",
" <td>0.123582</td>\n",
" <td>1.222449</td>\n",
" <td>0.293250</td>\n",
" <td>0.377039</td>\n",
" <td>1.237001</td>\n",
" <td>...</td>\n",
" <td>0.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>97194</th>\n",
" <td>-1.045646</td>\n",
" <td>0.663694</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.176378</td>\n",
" <td>-0.097972</td>\n",
" <td>0.307920</td>\n",
" <td>2.840303</td>\n",
" <td>0.714940</td>\n",
" <td>0.676615</td>\n",
" <td>...</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>97195</th>\n",
" <td>0.348892</td>\n",
" <td>0.526342</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.519125</td>\n",
" <td>0.632219</td>\n",
" <td>-1.076554</td>\n",
" <td>0.420602</td>\n",
" <td>1.188002</td>\n",
" <td>-1.334183</td>\n",
" <td>...</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>97196</th>\n",
" <td>0.635435</td>\n",
" <td>1.000000</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>-3.593838</td>\n",
" <td>1.343935</td>\n",
" <td>1.018262</td>\n",
" <td>-1.828132</td>\n",
" <td>0.106717</td>\n",
" <td>0.116229</td>\n",
" <td>...</td>\n",
" <td>0.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>97197</th>\n",
" <td>-0.117364</td>\n",
" <td>0.553722</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.519125</td>\n",
" <td>-0.666500</td>\n",
" <td>-0.166026</td>\n",
" <td>-0.088808</td>\n",
" <td>0.309458</td>\n",
" <td>0.346976</td>\n",
" <td>...</td>\n",
" <td>0.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>97198</th>\n",
" <td>-0.870164</td>\n",
" <td>1.000000</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.519125</td>\n",
" <td>1.253000</td>\n",
" <td>-0.451888</td>\n",
" <td>-0.088808</td>\n",
" <td>0.309458</td>\n",
" <td>-1.564930</td>\n",
" <td>...</td>\n",
" <td>0.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>3</td>\n",
" </tr>\n",
" <tr>\n",
" <th>97199</th>\n",
" <td>-0.493764</td>\n",
" <td>0.791849</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>-0.166369</td>\n",
" <td>-0.270457</td>\n",
" <td>-0.125188</td>\n",
" <td>0.930013</td>\n",
" <td>0.377039</td>\n",
" <td>1.830351</td>\n",
" <td>...</td>\n",
" <td>0.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>97200</th>\n",
" <td>-1.264474</td>\n",
" <td>1.000000</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.519125</td>\n",
" <td>-0.399510</td>\n",
" <td>-1.257626</td>\n",
" <td>0.930013</td>\n",
" <td>-0.906987</td>\n",
" <td>-0.147482</td>\n",
" <td>...</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>97201</th>\n",
" <td>-1.078979</td>\n",
" <td>0.624408</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>-1.194609</td>\n",
" <td>-0.185786</td>\n",
" <td>0.034331</td>\n",
" <td>1.057366</td>\n",
" <td>0.444619</td>\n",
" <td>1.896279</td>\n",
" <td>...</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>97202</th>\n",
" <td>-0.493764</td>\n",
" <td>1.212735</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.519125</td>\n",
" <td>0.627428</td>\n",
" <td>0.460149</td>\n",
" <td>0.165897</td>\n",
" <td>-1.380049</td>\n",
" <td>0.874398</td>\n",
" <td>...</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>3</td>\n",
" </tr>\n",
" <tr>\n",
" <th>97203</th>\n",
" <td>0.635435</td>\n",
" <td>1.076185</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.519125</td>\n",
" <td>-0.237293</td>\n",
" <td>-1.675018</td>\n",
" <td>-0.216161</td>\n",
" <td>-0.974568</td>\n",
" <td>-2.026425</td>\n",
" <td>...</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>97204</th>\n",
" <td>-0.493764</td>\n",
" <td>1.687988</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.519125</td>\n",
" <td>3.438795</td>\n",
" <td>-0.166026</td>\n",
" <td>3.986477</td>\n",
" <td>1.525904</td>\n",
" <td>0.577723</td>\n",
" <td>...</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>97205</th>\n",
" <td>0.823635</td>\n",
" <td>0.682610</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>-1.537356</td>\n",
" <td>-0.142878</td>\n",
" <td>-0.078337</td>\n",
" <td>-0.470866</td>\n",
" <td>1.728645</td>\n",
" <td>0.346976</td>\n",
" <td>...</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>97206</th>\n",
" <td>1.132685</td>\n",
" <td>1.000000</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.350070</td>\n",
" <td>1.071183</td>\n",
" <td>0.597714</td>\n",
" <td>0.173995</td>\n",
" <td>-0.771827</td>\n",
" <td>-0.378230</td>\n",
" <td>...</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>2</td>\n",
" </tr>\n",
" <tr>\n",
" <th>97207</th>\n",
" <td>0.259036</td>\n",
" <td>1.154917</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>-1.880103</td>\n",
" <td>-0.264315</td>\n",
" <td>-0.601626</td>\n",
" <td>3.859124</td>\n",
" <td>0.241878</td>\n",
" <td>1.039218</td>\n",
" <td>...</td>\n",
" <td>0.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>97208</th>\n",
" <td>-0.145273</td>\n",
" <td>0.387276</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>-0.166369</td>\n",
" <td>0.243954</td>\n",
" <td>0.174287</td>\n",
" <td>0.802660</td>\n",
" <td>-0.906987</td>\n",
" <td>0.116229</td>\n",
" <td>...</td>\n",
" <td>0.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>3</td>\n",
" </tr>\n",
" <tr>\n",
" <th>97209</th>\n",
" <td>-0.055043</td>\n",
" <td>1.097365</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.519125</td>\n",
" <td>0.485110</td>\n",
" <td>-0.921644</td>\n",
" <td>-0.470866</td>\n",
" <td>-0.906987</td>\n",
" <td>-1.795677</td>\n",
" <td>...</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>97210</th>\n",
" <td>0.447236</td>\n",
" <td>0.892346</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.519125</td>\n",
" <td>-0.424198</td>\n",
" <td>-0.773374</td>\n",
" <td>0.838030</td>\n",
" <td>-0.839407</td>\n",
" <td>-1.103436</td>\n",
" <td>...</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>97211</th>\n",
" <td>1.011835</td>\n",
" <td>0.952220</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.176378</td>\n",
" <td>-0.287366</td>\n",
" <td>-0.274926</td>\n",
" <td>-0.088808</td>\n",
" <td>-0.906987</td>\n",
" <td>0.017337</td>\n",
" <td>...</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>97212</th>\n",
" <td>0.447236</td>\n",
" <td>1.059568</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.519125</td>\n",
" <td>0.212837</td>\n",
" <td>0.800462</td>\n",
" <td>0.165897</td>\n",
" <td>-0.839407</td>\n",
" <td>0.314012</td>\n",
" <td>...</td>\n",
" <td>0.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>97213</th>\n",
" <td>0.823635</td>\n",
" <td>0.618508</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>-0.509116</td>\n",
" <td>-0.407535</td>\n",
" <td>1.045487</td>\n",
" <td>0.420602</td>\n",
" <td>0.985262</td>\n",
" <td>0.248084</td>\n",
" <td>...</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>3</td>\n",
" </tr>\n",
" <tr>\n",
" <th>97214</th>\n",
" <td>0.635435</td>\n",
" <td>0.612340</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>-0.851862</td>\n",
" <td>0.800291</td>\n",
" <td>-0.438276</td>\n",
" <td>0.165897</td>\n",
" <td>-0.906987</td>\n",
" <td>-1.301219</td>\n",
" <td>...</td>\n",
" <td>0.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>97215</th>\n",
" <td>0.447236</td>\n",
" <td>0.148500</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>-1.194609</td>\n",
" <td>0.271386</td>\n",
" <td>0.144139</td>\n",
" <td>0.547955</td>\n",
" <td>0.444619</td>\n",
" <td>1.500712</td>\n",
" <td>...</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>0</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"<p>97216 rows × 83 columns</p>\n",
"</div>"
],
"text/plain": [
" sodium electivesurgery vent dialysis gcs urine \\\n",
"0 -0.681964 0.859496 0.0 0.0 -0.166369 -1.396133 \n",
"1 -0.861765 1.482495 0.0 0.0 0.176378 0.297334 \n",
"2 1.059665 1.000000 1.0 0.0 0.519125 -0.543367 \n",
"3 -0.117364 0.925698 0.0 0.0 0.519125 1.611408 \n",
"4 -0.493764 0.916627 0.0 0.0 0.519125 0.443590 \n",
"5 0.259036 1.098652 0.0 0.0 0.519125 1.114718 \n",
"6 0.552113 1.000000 0.0 0.0 0.519125 -0.369482 \n",
"7 -0.493764 1.000000 0.0 0.0 0.176378 1.992667 \n",
"8 3.474343 0.301079 0.0 0.0 0.519125 0.189526 \n",
"9 0.447236 1.000000 0.0 0.0 0.519125 1.251597 \n",
"10 -0.305564 1.000000 0.0 0.0 0.519125 -0.866858 \n",
"11 -0.117364 1.122396 0.0 0.0 0.519125 -0.912948 \n",
"12 0.447236 1.138969 0.0 0.0 0.519125 -0.138761 \n",
"13 -1.058364 0.826892 1.0 0.0 -2.565597 -1.467063 \n",
"14 1.143563 1.419359 0.0 0.0 0.176378 0.756106 \n",
"15 0.685819 1.000000 1.0 0.0 0.519125 -0.640511 \n",
"16 0.555785 1.000000 0.0 0.0 0.519125 -1.306823 \n",
"17 0.070836 1.000000 0.0 0.0 0.519125 -1.292957 \n",
"18 1.576435 0.523411 1.0 0.0 -1.194609 2.393056 \n",
"19 -0.117364 0.734129 0.0 0.0 0.519125 -1.155986 \n",
"20 -0.493764 0.471570 0.0 0.0 0.519125 0.310790 \n",
"21 0.447236 0.000000 1.0 0.0 0.519125 -0.401062 \n",
"22 -0.493764 1.000000 0.0 0.0 0.519125 -0.354343 \n",
"23 -0.681964 1.064101 0.0 0.0 0.519125 0.325140 \n",
"24 -0.273389 0.244215 0.0 0.0 0.519125 -0.739734 \n",
"25 1.377070 1.000000 0.0 0.0 0.519125 0.521300 \n",
"26 -1.200002 1.263085 0.0 0.0 0.519125 0.435928 \n",
"27 0.070836 0.996634 0.0 0.0 0.519125 -0.174357 \n",
"28 0.823635 1.045833 0.0 0.0 -1.537356 -0.757020 \n",
"29 1.200035 1.160238 0.0 0.0 0.519125 -0.856408 \n",
"... ... ... ... ... ... ... \n",
"97186 -2.026258 1.000000 0.0 0.0 0.519125 0.326659 \n",
"97187 -2.166705 1.000000 0.0 0.0 0.519125 -0.089078 \n",
"97188 1.023733 0.958161 0.0 0.0 -0.674986 -0.590674 \n",
"97189 1.576435 0.406408 0.0 0.0 0.519125 -1.172530 \n",
"97190 0.767009 1.000000 0.0 0.0 0.176378 0.535019 \n",
"97191 -0.426119 0.535617 0.0 0.0 -1.014049 1.509891 \n",
"97192 1.200035 0.424769 0.0 0.0 0.176378 -0.752318 \n",
"97193 0.259036 1.138332 0.0 0.0 0.519125 0.123582 \n",
"97194 -1.045646 0.663694 0.0 0.0 0.176378 -0.097972 \n",
"97195 0.348892 0.526342 0.0 0.0 0.519125 0.632219 \n",
"97196 0.635435 1.000000 0.0 0.0 -3.593838 1.343935 \n",
"97197 -0.117364 0.553722 0.0 0.0 0.519125 -0.666500 \n",
"97198 -0.870164 1.000000 0.0 0.0 0.519125 1.253000 \n",
"97199 -0.493764 0.791849 0.0 0.0 -0.166369 -0.270457 \n",
"97200 -1.264474 1.000000 0.0 0.0 0.519125 -0.399510 \n",
"97201 -1.078979 0.624408 1.0 0.0 -1.194609 -0.185786 \n",
"97202 -0.493764 1.212735 0.0 0.0 0.519125 0.627428 \n",
"97203 0.635435 1.076185 0.0 0.0 0.519125 -0.237293 \n",
"97204 -0.493764 1.687988 0.0 0.0 0.519125 3.438795 \n",
"97205 0.823635 0.682610 0.0 0.0 -1.537356 -0.142878 \n",
"97206 1.132685 1.000000 0.0 0.0 0.350070 1.071183 \n",
"97207 0.259036 1.154917 1.0 0.0 -1.880103 -0.264315 \n",
"97208 -0.145273 0.387276 0.0 0.0 -0.166369 0.243954 \n",
"97209 -0.055043 1.097365 0.0 0.0 0.519125 0.485110 \n",
"97210 0.447236 0.892346 0.0 0.0 0.519125 -0.424198 \n",
"97211 1.011835 0.952220 0.0 0.0 0.176378 -0.287366 \n",
"97212 0.447236 1.059568 0.0 0.0 0.519125 0.212837 \n",
"97213 0.823635 0.618508 0.0 0.0 -0.509116 -0.407535 \n",
"97214 0.635435 0.612340 1.0 0.0 -0.851862 0.800291 \n",
"97215 0.447236 0.148500 0.0 0.0 -1.194609 0.271386 \n",
"\n",
" wbc temperature respiratoryrate heartrate ... m12_True \\\n",
"0 0.337637 3.604419 0.782521 0.643651 ... 0.0 \n",
"1 0.380078 0.293250 0.850101 0.116229 ... 1.0 \n",
"2 -0.492726 -2.126451 -1.380049 0.511796 ... 0.0 \n",
"3 -0.097963 0.165897 0.714940 0.478832 ... 0.0 \n",
"4 -0.778588 -1.871745 1.931386 1.138110 ... 0.0 \n",
"5 -0.438276 -0.216161 1.458324 -0.147482 ... 0.0 \n",
"6 -0.290931 0.420602 -0.636666 0.083265 ... 1.0 \n",
"7 -0.534937 -0.088808 -0.028443 -0.114519 ... 1.0 \n",
"8 -0.364714 0.165897 0.241878 0.248084 ... 1.0 \n",
"9 -0.179638 0.165897 1.188002 0.709579 ... 0.0 \n",
"10 -1.118901 -1.107629 -1.042148 -1.531966 ... 0.0 \n",
"11 0.800462 0.165897 -0.163604 -0.543049 ... 0.0 \n",
"12 -0.764976 0.165897 1.728645 -0.246374 ... 0.0 \n",
"13 -0.261313 -0.088808 0.647360 0.511796 ... 0.0 \n",
"14 -0.901101 0.165897 -1.380049 -0.015627 ... 0.0 \n",
"15 0.405699 -0.088808 -1.042148 2.555557 ... 0.0 \n",
"16 0.863921 -0.088808 -0.569086 -1.400111 ... 1.0 \n",
"17 1.385799 0.293250 1.593484 0.973290 ... 0.0 \n",
"18 -0.234088 -0.216161 0.579780 0.017337 ... 0.0 \n",
"19 -0.451888 0.038545 -0.839407 0.182157 ... 0.0 \n",
"20 -0.710526 0.293250 -0.298764 0.643651 ... 0.0 \n",
"21 0.255962 0.165897 -0.636666 -0.147482 ... 0.0 \n",
"22 -0.206863 0.165897 -0.974568 3.313727 ... 0.0 \n",
"23 -0.560788 0.293250 -0.704246 -0.279338 ... 0.0 \n",
"24 -0.744194 -1.871745 -0.163604 -1.367147 ... 1.0 \n",
"25 -1.090165 -0.088808 0.985262 -1.169363 ... 1.0 \n",
"26 -0.325981 0.293250 -0.704246 1.105146 ... 0.0 \n",
"27 -0.383826 -0.470866 1.188002 -0.114519 ... 0.0 \n",
"28 -0.490307 0.675308 -1.380049 -0.147482 ... 1.0 \n",
"29 -0.846651 0.420602 1.323163 0.314012 ... 0.0 \n",
"... ... ... ... ... ... ... \n",
"97186 -0.511688 -0.343513 0.377039 -1.993461 ... 1.0 \n",
"97187 -0.388565 -0.088808 -1.177308 -1.235291 ... 1.0 \n",
"97188 0.226332 -0.598219 -0.906987 -2.059389 ... 1.0 \n",
"97189 -0.119372 0.165897 -0.906987 -0.444158 ... 0.0 \n",
"97190 1.247073 0.675308 0.039137 -0.147482 ... 1.0 \n",
"97191 1.210075 0.293250 -0.636666 0.215120 ... 1.0 \n",
"97192 -0.656076 -0.343513 -0.906987 1.237001 ... 0.0 \n",
"97193 1.222449 0.293250 0.377039 1.237001 ... 0.0 \n",
"97194 0.307920 2.840303 0.714940 0.676615 ... 1.0 \n",
"97195 -1.076554 0.420602 1.188002 -1.334183 ... 1.0 \n",
"97196 1.018262 -1.828132 0.106717 0.116229 ... 0.0 \n",
"97197 -0.166026 -0.088808 0.309458 0.346976 ... 0.0 \n",
"97198 -0.451888 -0.088808 0.309458 -1.564930 ... 0.0 \n",
"97199 -0.125188 0.930013 0.377039 1.830351 ... 0.0 \n",
"97200 -1.257626 0.930013 -0.906987 -0.147482 ... 1.0 \n",
"97201 0.034331 1.057366 0.444619 1.896279 ... 1.0 \n",
"97202 0.460149 0.165897 -1.380049 0.874398 ... 0.0 \n",
"97203 -1.675018 -0.216161 -0.974568 -2.026425 ... 1.0 \n",
"97204 -0.166026 3.986477 1.525904 0.577723 ... 0.0 \n",
"97205 -0.078337 -0.470866 1.728645 0.346976 ... 1.0 \n",
"97206 0.597714 0.173995 -0.771827 -0.378230 ... 1.0 \n",
"97207 -0.601626 3.859124 0.241878 1.039218 ... 0.0 \n",
"97208 0.174287 0.802660 -0.906987 0.116229 ... 0.0 \n",
"97209 -0.921644 -0.470866 -0.906987 -1.795677 ... 1.0 \n",
"97210 -0.773374 0.838030 -0.839407 -1.103436 ... 1.0 \n",
"97211 -0.274926 -0.088808 -0.906987 0.017337 ... 0.0 \n",
"97212 0.800462 0.165897 -0.839407 0.314012 ... 0.0 \n",
"97213 1.045487 0.420602 0.985262 0.248084 ... 0.0 \n",
"97214 -0.438276 0.165897 -0.906987 -1.301219 ... 0.0 \n",
"97215 0.144139 0.547955 0.444619 1.500712 ... 1.0 \n",
"\n",
" m13_True m14_True m15_True m16_True m17_True m18_True m19_True \\\n",
"0 0.0 1.0 1.0 0.0 0.0 0.0 1.0 \n",
"1 1.0 1.0 1.0 1.0 1.0 1.0 1.0 \n",
"2 1.0 0.0 0.0 1.0 0.0 1.0 0.0 \n",
"3 1.0 1.0 1.0 0.0 0.0 1.0 1.0 \n",
"4 1.0 0.0 0.0 0.0 0.0 1.0 0.0 \n",
"5 0.0 1.0 1.0 0.0 0.0 0.0 1.0 \n",
"6 1.0 1.0 1.0 1.0 1.0 1.0 1.0 \n",
"7 1.0 1.0 1.0 0.0 0.0 1.0 1.0 \n",
"8 1.0 1.0 1.0 1.0 0.0 1.0 1.0 \n",
"9 0.0 1.0 1.0 0.0 0.0 0.0 1.0 \n",
"10 1.0 0.0 0.0 0.0 0.0 1.0 0.0 \n",
"11 1.0 1.0 1.0 0.0 0.0 1.0 1.0 \n",
"12 1.0 1.0 1.0 0.0 0.0 1.0 1.0 \n",
"13 1.0 0.0 0.0 0.0 0.0 1.0 0.0 \n",
"14 1.0 1.0 1.0 1.0 0.0 1.0 1.0 \n",
"15 1.0 0.0 0.0 1.0 0.0 1.0 0.0 \n",
"16 1.0 1.0 1.0 1.0 0.0 1.0 1.0 \n",
"17 1.0 1.0 1.0 0.0 0.0 1.0 1.0 \n",
"18 0.0 1.0 1.0 0.0 0.0 0.0 1.0 \n",
"19 1.0 1.0 1.0 0.0 0.0 1.0 1.0 \n",
"20 1.0 1.0 1.0 0.0 0.0 1.0 1.0 \n",
"21 0.0 1.0 1.0 0.0 0.0 0.0 1.0 \n",
"22 0.0 0.0 0.0 0.0 0.0 0.0 0.0 \n",
"23 1.0 1.0 1.0 0.0 0.0 1.0 1.0 \n",
"24 1.0 1.0 1.0 1.0 1.0 1.0 1.0 \n",
"25 1.0 1.0 1.0 1.0 0.0 1.0 1.0 \n",
"26 1.0 1.0 1.0 1.0 0.0 1.0 1.0 \n",
"27 0.0 1.0 1.0 0.0 0.0 0.0 1.0 \n",
"28 1.0 1.0 1.0 0.0 0.0 1.0 1.0 \n",
"29 0.0 1.0 1.0 0.0 0.0 0.0 1.0 \n",
"... ... ... ... ... ... ... ... \n",
"97186 1.0 1.0 1.0 1.0 1.0 1.0 1.0 \n",
"97187 1.0 1.0 1.0 1.0 1.0 1.0 1.0 \n",
"97188 1.0 1.0 1.0 1.0 0.0 1.0 1.0 \n",
"97189 1.0 1.0 1.0 0.0 0.0 1.0 1.0 \n",
"97190 1.0 1.0 1.0 1.0 0.0 1.0 1.0 \n",
"97191 1.0 1.0 1.0 1.0 0.0 1.0 1.0 \n",
"97192 1.0 1.0 1.0 0.0 0.0 1.0 1.0 \n",
"97193 1.0 1.0 1.0 0.0 0.0 1.0 1.0 \n",
"97194 1.0 1.0 1.0 1.0 1.0 1.0 1.0 \n",
"97195 1.0 1.0 1.0 1.0 0.0 1.0 1.0 \n",
"97196 1.0 0.0 0.0 0.0 0.0 1.0 0.0 \n",
"97197 1.0 1.0 1.0 0.0 0.0 1.0 1.0 \n",
"97198 1.0 1.0 1.0 0.0 0.0 1.0 1.0 \n",
"97199 1.0 1.0 1.0 0.0 0.0 1.0 1.0 \n",
"97200 1.0 1.0 1.0 1.0 0.0 1.0 1.0 \n",
"97201 1.0 1.0 1.0 1.0 1.0 1.0 1.0 \n",
"97202 0.0 1.0 1.0 0.0 0.0 0.0 1.0 \n",
"97203 1.0 1.0 1.0 0.0 0.0 1.0 1.0 \n",
"97204 0.0 1.0 1.0 0.0 0.0 0.0 1.0 \n",
"97205 0.0 0.0 0.0 0.0 0.0 0.0 0.0 \n",
"97206 1.0 1.0 1.0 1.0 0.0 1.0 1.0 \n",
"97207 1.0 0.0 0.0 0.0 0.0 1.0 0.0 \n",
"97208 1.0 1.0 1.0 1.0 1.0 1.0 1.0 \n",
"97209 1.0 1.0 1.0 1.0 1.0 1.0 1.0 \n",
"97210 0.0 1.0 1.0 0.0 0.0 1.0 1.0 \n",
"97211 0.0 0.0 0.0 0.0 0.0 1.0 0.0 \n",
"97212 1.0 1.0 1.0 0.0 0.0 1.0 1.0 \n",
"97213 0.0 1.0 1.0 0.0 0.0 0.0 1.0 \n",
"97214 1.0 0.0 0.0 0.0 0.0 1.0 0.0 \n",
"97215 1.0 1.0 1.0 0.0 0.0 1.0 1.0 \n",
"\n",
" m20_True km_clust \n",
"0 0.0 1 \n",
"1 0.0 3 \n",
"2 0.0 1 \n",
"3 0.0 1 \n",
"4 0.0 1 \n",
"5 0.0 3 \n",
"6 0.0 1 \n",
"7 0.0 1 \n",
"8 0.0 3 \n",
"9 0.0 1 \n",
"10 0.0 1 \n",
"11 0.0 1 \n",
"12 0.0 3 \n",
"13 0.0 0 \n",
"14 0.0 1 \n",
"15 0.0 3 \n",
"16 0.0 1 \n",
"17 0.0 3 \n",
"18 0.0 1 \n",
"19 0.0 1 \n",
"20 0.0 1 \n",
"21 0.0 1 \n",
"22 1.0 1 \n",
"23 0.0 1 \n",
"24 0.0 1 \n",
"25 0.0 1 \n",
"26 0.0 3 \n",
"27 0.0 3 \n",
"28 0.0 0 \n",
"29 0.0 1 \n",
"... ... ... \n",
"97186 0.0 1 \n",
"97187 0.0 1 \n",
"97188 0.0 1 \n",
"97189 0.0 1 \n",
"97190 0.0 1 \n",
"97191 0.0 0 \n",
"97192 0.0 3 \n",
"97193 0.0 1 \n",
"97194 0.0 1 \n",
"97195 0.0 1 \n",
"97196 0.0 0 \n",
"97197 0.0 1 \n",
"97198 0.0 3 \n",
"97199 0.0 1 \n",
"97200 0.0 1 \n",
"97201 0.0 0 \n",
"97202 0.0 3 \n",
"97203 0.0 1 \n",
"97204 0.0 1 \n",
"97205 0.0 0 \n",
"97206 0.0 2 \n",
"97207 0.0 0 \n",
"97208 0.0 3 \n",
"97209 0.0 1 \n",
"97210 0.0 1 \n",
"97211 0.0 1 \n",
"97212 0.0 1 \n",
"97213 1.0 3 \n",
"97214 0.0 1 \n",
"97215 0.0 0 \n",
"\n",
"[97216 rows x 83 columns]"
]
},
"execution_count": 34,
"metadata": {
"tags": []
},
"output_type": "execute_result"
}
],
"source": [
"r"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "nkF7t9M06lMJ",
"outputId": "4990da6b-6298-4e24-9cdc-be2363a7b63c"
},
"outputs": [
{
"data": {
"text/plain": [
"4"
]
},
"execution_count": 35,
"metadata": {
"tags": []
},
"output_type": "execute_result"
}
],
"source": [
"n_clusters"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "OFMrD69J6lMJ",
"outputId": "cce3cc02-46ce-4ff1-fea6-f2b223ae804a"
},
"outputs": [
{
"data": {
"text/plain": [
"(97216, 83)"
]
},
"execution_count": 36,
"metadata": {
"tags": []
},
"output_type": "execute_result"
}
],
"source": [
"X_train.shape"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "1cL28agY6lMJ",
"outputId": "8e4bcbc8-202c-4b02-b27e-e6cf3b384f7d"
},
"outputs": [
{
"data": {
"text/plain": [
"array([1, 3, 1, ..., 3, 1, 0], dtype=int32)"
]
},
"execution_count": 37,
"metadata": {
"tags": []
},
"output_type": "execute_result"
}
],
"source": [
"clf.labels_"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "Ch1u484i6lMK",
"outputId": "49276966-06c3-4bea-e1c5-8f31e68c7f82"
},
"outputs": [
{
"data": {
"text/plain": [
"0 1\n",
"1 3\n",
"2 1\n",
"3 1\n",
"4 1\n",
"5 3\n",
"6 1\n",
"7 1\n",
"8 3\n",
"9 1\n",
"10 1\n",
"11 1\n",
"12 3\n",
"13 0\n",
"14 1\n",
"15 3\n",
"16 1\n",
"17 3\n",
"18 1\n",
"19 1\n",
"20 1\n",
"21 1\n",
"22 1\n",
"23 1\n",
"24 1\n",
"25 1\n",
"26 3\n",
"27 3\n",
"28 0\n",
"29 1\n",
" ..\n",
"97186 1\n",
"97187 1\n",
"97188 1\n",
"97189 1\n",
"97190 1\n",
"97191 0\n",
"97192 3\n",
"97193 1\n",
"97194 1\n",
"97195 1\n",
"97196 0\n",
"97197 1\n",
"97198 3\n",
"97199 1\n",
"97200 1\n",
"97201 0\n",
"97202 3\n",
"97203 1\n",
"97204 1\n",
"97205 0\n",
"97206 2\n",
"97207 0\n",
"97208 3\n",
"97209 1\n",
"97210 1\n",
"97211 1\n",
"97212 1\n",
"97213 3\n",
"97214 1\n",
"97215 0\n",
"Name: km_clust, Length: 97216, dtype: int32"
]
},
"execution_count": 38,
"metadata": {
"tags": []
},
"output_type": "execute_result"
}
],
"source": [
"X_train['km_clust']\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "iaMDqxUL6lMK",
"outputId": "3b127456-ab12-41c6-d2b8-cba791462d35"
},
"outputs": [
{
"data": {
"text/plain": [
"array([1, 3, 1, ..., 3, 1, 0], dtype=int32)"
]
},
"execution_count": 39,
"metadata": {
"tags": []
},
"output_type": "execute_result"
}
],
"source": [
"y_labels_train\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "rhZkhhLr6lMK",
"outputId": "f89e0d58-96e0-4bf3-a803-657c7bb289da"
},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>sodium</th>\n",
" <th>electivesurgery</th>\n",
" <th>vent</th>\n",
" <th>dialysis</th>\n",
" <th>gcs</th>\n",
" <th>urine</th>\n",
" <th>wbc</th>\n",
" <th>temperature</th>\n",
" <th>respiratoryrate</th>\n",
" <th>heartrate</th>\n",
" <th>...</th>\n",
" <th>m12_True</th>\n",
" <th>m13_True</th>\n",
" <th>m14_True</th>\n",
" <th>m15_True</th>\n",
" <th>m16_True</th>\n",
" <th>m17_True</th>\n",
" <th>m18_True</th>\n",
" <th>m19_True</th>\n",
" <th>m20_True</th>\n",
" <th>km_clust</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>-0.681964</td>\n",
" <td>0.859496</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>-0.166369</td>\n",
" <td>-1.396133</td>\n",
" <td>0.337637</td>\n",
" <td>3.604419</td>\n",
" <td>0.782521</td>\n",
" <td>0.643651</td>\n",
" <td>...</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>-0.861765</td>\n",
" <td>1.482495</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.176378</td>\n",
" <td>0.297334</td>\n",
" <td>0.380078</td>\n",
" <td>0.293250</td>\n",
" <td>0.850101</td>\n",
" <td>0.116229</td>\n",
" <td>...</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>3</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>1.059665</td>\n",
" <td>1.000000</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>0.519125</td>\n",
" <td>-0.543367</td>\n",
" <td>-0.492726</td>\n",
" <td>-2.126451</td>\n",
" <td>-1.380049</td>\n",
" <td>0.511796</td>\n",
" <td>...</td>\n",
" <td>0.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>-0.117364</td>\n",
" <td>0.925698</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.519125</td>\n",
" <td>1.611408</td>\n",
" <td>-0.097963</td>\n",
" <td>0.165897</td>\n",
" <td>0.714940</td>\n",
" <td>0.478832</td>\n",
" <td>...</td>\n",
" <td>0.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>-0.493764</td>\n",
" <td>0.916627</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.519125</td>\n",
" <td>0.443590</td>\n",
" <td>-0.778588</td>\n",
" <td>-1.871745</td>\n",
" <td>1.931386</td>\n",
" <td>1.138110</td>\n",
" <td>...</td>\n",
" <td>0.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>1</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"<p>5 rows × 83 columns</p>\n",
"</div>"
],
"text/plain": [
" sodium electivesurgery vent dialysis gcs urine wbc \\\n",
"0 -0.681964 0.859496 0.0 0.0 -0.166369 -1.396133 0.337637 \n",
"1 -0.861765 1.482495 0.0 0.0 0.176378 0.297334 0.380078 \n",
"2 1.059665 1.000000 1.0 0.0 0.519125 -0.543367 -0.492726 \n",
"3 -0.117364 0.925698 0.0 0.0 0.519125 1.611408 -0.097963 \n",
"4 -0.493764 0.916627 0.0 0.0 0.519125 0.443590 -0.778588 \n",
"\n",
" temperature respiratoryrate heartrate ... m12_True m13_True \\\n",
"0 3.604419 0.782521 0.643651 ... 0.0 0.0 \n",
"1 0.293250 0.850101 0.116229 ... 1.0 1.0 \n",
"2 -2.126451 -1.380049 0.511796 ... 0.0 1.0 \n",
"3 0.165897 0.714940 0.478832 ... 0.0 1.0 \n",
"4 -1.871745 1.931386 1.138110 ... 0.0 1.0 \n",
"\n",
" m14_True m15_True m16_True m17_True m18_True m19_True m20_True \\\n",
"0 1.0 1.0 0.0 0.0 0.0 1.0 0.0 \n",
"1 1.0 1.0 1.0 1.0 1.0 1.0 0.0 \n",
"2 0.0 0.0 1.0 0.0 1.0 0.0 0.0 \n",
"3 1.0 1.0 0.0 0.0 1.0 1.0 0.0 \n",
"4 0.0 0.0 0.0 0.0 1.0 0.0 0.0 \n",
"\n",
" km_clust \n",
"0 1 \n",
"1 3 \n",
"2 1 \n",
"3 1 \n",
"4 1 \n",
"\n",
"[5 rows x 83 columns]"
]
},
"execution_count": 40,
"metadata": {
"tags": []
},
"output_type": "execute_result"
}
],
"source": [
"X_train.head()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "ObSkEWt66lMK"
},
"outputs": [],
"source": [
"X_train['km_clust'] = y_labels_train"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "7znT0H5x6lML",
"outputId": "e13e4742-7fa8-4c5b-d204-107bcfc8cd45"
},
"outputs": [
{
"data": {
"text/plain": [
"0 1\n",
"1 3\n",
"2 1\n",
"3 1\n",
"4 1\n",
"5 3\n",
"6 1\n",
"7 1\n",
"8 3\n",
"9 1\n",
"10 1\n",
"11 1\n",
"12 3\n",
"13 0\n",
"14 1\n",
"15 3\n",
"16 1\n",
"17 3\n",
"18 1\n",
"19 1\n",
"20 1\n",
"21 1\n",
"22 1\n",
"23 1\n",
"24 1\n",
"25 1\n",
"26 3\n",
"27 3\n",
"28 0\n",
"29 1\n",
" ..\n",
"97186 1\n",
"97187 1\n",
"97188 1\n",
"97189 1\n",
"97190 1\n",
"97191 0\n",
"97192 3\n",
"97193 1\n",
"97194 1\n",
"97195 1\n",
"97196 0\n",
"97197 1\n",
"97198 3\n",
"97199 1\n",
"97200 1\n",
"97201 0\n",
"97202 3\n",
"97203 1\n",
"97204 1\n",
"97205 0\n",
"97206 2\n",
"97207 0\n",
"97208 3\n",
"97209 1\n",
"97210 1\n",
"97211 1\n",
"97212 1\n",
"97213 3\n",
"97214 1\n",
"97215 0\n",
"Name: km_clust, Length: 97216, dtype: int32"
]
},
"execution_count": 42,
"metadata": {
"tags": []
},
"output_type": "execute_result"
}
],
"source": [
"X_train['km_clust']"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "oLPglP3n6lML",
"outputId": "f564757c-b092-40d9-f994-f495dbcfeae8"
},
"outputs": [
{
"data": {
"text/plain": [
"(97216, 83)"
]
},
"execution_count": 43,
"metadata": {
"tags": []
},
"output_type": "execute_result"
}
],
"source": [
"X_train.shape"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "XholpmwP6lML",
"outputId": "8884f13e-cc20-48df-fcf3-d679830b739d"
},
"outputs": [
{
"data": {
"text/plain": [
"array([1, 3, 1, ..., 3, 1, 0], dtype=int32)"
]
},
"execution_count": 44,
"metadata": {
"tags": []
},
"output_type": "execute_result"
}
],
"source": [
"y_labels_train"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "Cp7ECkkj6lML",
"outputId": "f5b0f3f9-f279-490c-9d3d-f0b15b52379f"
},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>sodium</th>\n",
" <th>electivesurgery</th>\n",
" <th>vent</th>\n",
" <th>dialysis</th>\n",
" <th>gcs</th>\n",
" <th>urine</th>\n",
" <th>wbc</th>\n",
" <th>temperature</th>\n",
" <th>respiratoryrate</th>\n",
" <th>heartrate</th>\n",
" <th>...</th>\n",
" <th>m12_True</th>\n",
" <th>m13_True</th>\n",
" <th>m14_True</th>\n",
" <th>m15_True</th>\n",
" <th>m16_True</th>\n",
" <th>m17_True</th>\n",
" <th>m18_True</th>\n",
" <th>m19_True</th>\n",
" <th>m20_True</th>\n",
" <th>km_clust</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>-0.681964</td>\n",
" <td>0.859496</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>-0.166369</td>\n",
" <td>-1.396133</td>\n",
" <td>0.337637</td>\n",
" <td>3.604419</td>\n",
" <td>0.782521</td>\n",
" <td>0.643651</td>\n",
" <td>...</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>-0.861765</td>\n",
" <td>1.482495</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.176378</td>\n",
" <td>0.297334</td>\n",
" <td>0.380078</td>\n",
" <td>0.293250</td>\n",
" <td>0.850101</td>\n",
" <td>0.116229</td>\n",
" <td>...</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>3</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>1.059665</td>\n",
" <td>1.000000</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>0.519125</td>\n",
" <td>-0.543367</td>\n",
" <td>-0.492726</td>\n",
" <td>-2.126451</td>\n",
" <td>-1.380049</td>\n",
" <td>0.511796</td>\n",
" <td>...</td>\n",
" <td>0.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>-0.117364</td>\n",
" <td>0.925698</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.519125</td>\n",
" <td>1.611408</td>\n",
" <td>-0.097963</td>\n",
" <td>0.165897</td>\n",
" <td>0.714940</td>\n",
" <td>0.478832</td>\n",
" <td>...</td>\n",
" <td>0.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>-0.493764</td>\n",
" <td>0.916627</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.519125</td>\n",
" <td>0.443590</td>\n",
" <td>-0.778588</td>\n",
" <td>-1.871745</td>\n",
" <td>1.931386</td>\n",
" <td>1.138110</td>\n",
" <td>...</td>\n",
" <td>0.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>1</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"<p>5 rows × 83 columns</p>\n",
"</div>"
],
"text/plain": [
" sodium electivesurgery vent dialysis gcs urine wbc \\\n",
"0 -0.681964 0.859496 0.0 0.0 -0.166369 -1.396133 0.337637 \n",
"1 -0.861765 1.482495 0.0 0.0 0.176378 0.297334 0.380078 \n",
"2 1.059665 1.000000 1.0 0.0 0.519125 -0.543367 -0.492726 \n",
"3 -0.117364 0.925698 0.0 0.0 0.519125 1.611408 -0.097963 \n",
"4 -0.493764 0.916627 0.0 0.0 0.519125 0.443590 -0.778588 \n",
"\n",
" temperature respiratoryrate heartrate ... m12_True m13_True \\\n",
"0 3.604419 0.782521 0.643651 ... 0.0 0.0 \n",
"1 0.293250 0.850101 0.116229 ... 1.0 1.0 \n",
"2 -2.126451 -1.380049 0.511796 ... 0.0 1.0 \n",
"3 0.165897 0.714940 0.478832 ... 0.0 1.0 \n",
"4 -1.871745 1.931386 1.138110 ... 0.0 1.0 \n",
"\n",
" m14_True m15_True m16_True m17_True m18_True m19_True m20_True \\\n",
"0 1.0 1.0 0.0 0.0 0.0 1.0 0.0 \n",
"1 1.0 1.0 1.0 1.0 1.0 1.0 0.0 \n",
"2 0.0 0.0 1.0 0.0 1.0 0.0 0.0 \n",
"3 1.0 1.0 0.0 0.0 1.0 1.0 0.0 \n",
"4 0.0 0.0 0.0 0.0 1.0 0.0 0.0 \n",
"\n",
" km_clust \n",
"0 1 \n",
"1 3 \n",
"2 1 \n",
"3 1 \n",
"4 1 \n",
"\n",
"[5 rows x 83 columns]"
]
},
"execution_count": 45,
"metadata": {
"tags": []
},
"output_type": "execute_result"
}
],
"source": [
"X_train.head()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "gNNDAsJI6lML"
},
"outputs": [],
"source": []
}
],
"metadata": {
"colab": {
"name": "LR-Mixed-Main.ipynb",
"provenance": []
},
"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.8.3"
}
},
"nbformat": 4,
"nbformat_minor": 4
}