Diff of /notebooks/stats.ipynb [000000] .. [23d48c]

Switch to unified view

a b/notebooks/stats.ipynb
1
{
2
 "cells": [
3
  {
4
   "cell_type": "code",
5
   "execution_count": 27,
6
   "metadata": {
7
    "scrolled": false
8
   },
9
   "outputs": [
10
    {
11
     "data": {
12
      "text/plain": [
13
       "                  dataset        cutoff    algorithm    rank_auc   \n",
14
       " geis_250.00          :30   1 visit :210   LR :210   Min.   : 1.0  \n",
15
       " geis_250.00_cutoff182:30   1 year  :210   RF :210   1st Qu.: 8.0  \n",
16
       " geis_250.00_cutoff365:30   6 months:210   XGB:210   Median :15.5  \n",
17
       " geis_250.40          :30                            Mean   :15.5  \n",
18
       " geis_250.40_cutoff182:30                            3rd Qu.:23.0  \n",
19
       " geis_250.40_cutoff365:30                            Max.   :30.0  \n",
20
       " geis_327.23          :30                                          \n",
21
       " geis_327.23_cutoff182:30                                          \n",
22
       " geis_327.23_cutoff365:30                                          \n",
23
       " geis_331.0           :30                                          \n",
24
       " geis_331.0_cutoff182 :30                                          \n",
25
       " geis_331.0_cutoff365 :30                                          \n",
26
       " geis_530.81          :30                                          \n",
27
       " geis_530.81_cutoff182:30                                          \n",
28
       " geis_530.81_cutoff365:30                                          \n",
29
       " geis_571.8           :30                                          \n",
30
       " geis_571.8_cutoff182 :30                                          \n",
31
       " geis_571.8_cutoff365 :30                                          \n",
32
       " geis_585.9           :30                                          \n",
33
       " geis_585.9_cutoff182 :30                                          \n",
34
       " geis_585.9_cutoff365 :30                                          "
35
      ]
36
     },
37
     "metadata": {},
38
     "output_type": "display_data"
39
    }
40
   ],
41
   "source": [
42
    "setwd('/media/bill/Drive/projects/geis-ehr/analysis')\n",
43
    "\n",
44
    "df <- read.csv(\"auc_rankings.csv\",header=TRUE,sep=',')\n",
45
    "# df <- subset(df,!is.na(rank))\n",
46
    "# df <- subset(df,dataset!='505_tecator')\n",
47
    "# df <- subset(df,algorithm != 'LR')\n",
48
    "summary(df,maxsum=21)\n"
49
   ]
50
  },
51
  {
52
   "cell_type": "code",
53
   "execution_count": 29,
54
   "metadata": {},
55
   "outputs": [
56
    {
57
     "data": {
58
      "text/plain": [
59
       "\n",
60
       "\tPairwise comparisons using Wilcoxon signed rank test \n",
61
       "\n",
62
       "data:  dfs$rank_auc and dfs$algorithm \n",
63
       "\n",
64
       "    LR      RF     \n",
65
       "RF  1.0e-12 -      \n",
66
       "XGB 1.1e-12 7.8e-12\n",
67
       "\n",
68
       "P value adjustment method: bonferroni "
69
      ]
70
     },
71
     "metadata": {},
72
     "output_type": "display_data"
73
    }
74
   ],
75
   "source": [
76
    "dfs <- subset(df,cutoff=='1 visit')\n",
77
    "pairwise.wilcox.test(dfs$rank_auc, dfs$algorithm, p.adjust.method = 'bonferroni',\n",
78
    "                      paired = T)"
79
   ]
80
  },
81
  {
82
   "cell_type": "code",
83
   "execution_count": 31,
84
   "metadata": {},
85
   "outputs": [
86
    {
87
     "data": {
88
      "text/plain": [
89
       "\n",
90
       "\tPairwise comparisons using Wilcoxon signed rank test \n",
91
       "\n",
92
       "data:  dfs$rank_auc and dfs$algorithm \n",
93
       "\n",
94
       "    LR      RF     \n",
95
       "RF  1.0e-12 -      \n",
96
       "XGB 1.0e-12 2.3e-12\n",
97
       "\n",
98
       "P value adjustment method: bonferroni "
99
      ]
100
     },
101
     "metadata": {},
102
     "output_type": "display_data"
103
    }
104
   ],
105
   "source": [
106
    "dfs <- subset(df,cutoff=='6 months')\n",
107
    "pairwise.wilcox.test(dfs$rank_auc, dfs$algorithm, p.adjust.method = 'bonferroni',\n",
108
    "                      paired = T)"
109
   ]
110
  },
111
  {
112
   "cell_type": "code",
113
   "execution_count": 28,
114
   "metadata": {},
115
   "outputs": [
116
    {
117
     "data": {
118
      "text/plain": [
119
       "\n",
120
       "\tPairwise comparisons using Wilcoxon signed rank test \n",
121
       "\n",
122
       "data:  dfs$rank_auc and dfs$algorithm \n",
123
       "\n",
124
       "    LR      RF     \n",
125
       "RF  1.0e-12 -      \n",
126
       "XGB 1.0e-12 9.5e-12\n",
127
       "\n",
128
       "P value adjustment method: bonferroni "
129
      ]
130
     },
131
     "metadata": {},
132
     "output_type": "display_data"
133
    }
134
   ],
135
   "source": [
136
    "dfs <- subset(df,cutoff=='1 year')\n",
137
    "pairwise.wilcox.test(dfs$rank_auc, dfs$algorithm, p.adjust.method = 'bonferroni',\n",
138
    "                      paired = T)"
139
   ]
140
  }
141
 ],
142
 "metadata": {
143
  "kernelspec": {
144
   "display_name": "R",
145
   "language": "R",
146
   "name": "ir"
147
  },
148
  "language_info": {
149
   "codemirror_mode": "r",
150
   "file_extension": ".r",
151
   "mimetype": "text/x-r-source",
152
   "name": "R",
153
   "pygments_lexer": "r",
154
   "version": "3.5.1"
155
  }
156
 },
157
 "nbformat": 4,
158
 "nbformat_minor": 2
159
}