Skip to content

Commit

Permalink
Merge pull request #91 from Dokkaebi10/last_fix
Browse files Browse the repository at this point in the history
added library to html
  • Loading branch information
Dokkaebi10 authored Mar 27, 2023
2 parents ff02952 + c31cf2f commit 0678e2b
Show file tree
Hide file tree
Showing 7 changed files with 508 additions and 35 deletions.
Binary file modified notebooks/_build/.doctrees/analysis.doctree
Binary file not shown.
Binary file modified notebooks/_build/.doctrees/environment.pickle
Binary file not shown.
3 changes: 2 additions & 1 deletion notebooks/_build/html/_sources/analysis.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
},
{
"cell_type": "code",
"execution_count": 14,
"execution_count": 25,
"metadata": {
"tags": [
"remove-input"
Expand Down Expand Up @@ -149,6 +149,7 @@
}
],
"source": [
"library(tidyverse)\n",
"heart_data <- read_csv('../data/processed/heart_data.csv', show_col_types = FALSE)\n",
"head(heart_data)"
]
Expand Down
105 changes: 99 additions & 6 deletions notebooks/_build/html/analysis.html
Original file line number Diff line number Diff line change
Expand Up @@ -381,11 +381,36 @@ <h2><a class="toc-backref" href="#id17">Preliminary Exploratory Data Analysis</a
<p>We combined the datasets “processed.switzerland.data,” “processed.va.data”, “processed.cleveland.data,” and “processed.hungarian.data”, to generate a longer and more complete dataset. Our complete aggregated data contains 13 different columns with an additional 8 that repeat some of the variables as factors instead of numeric types. Based on initial viewing of the data we decided to eliminate the <code class="docutils literal notranslate"><span class="pre">ST_dep</span></code> and <code class="docutils literal notranslate"><span class="pre">slope</span></code> columns as they were missing too many points.</p>
<div class="cell tag_remove-input docutils container">
<div class="cell_output docutils container">
<div class="output traceback highlight-ipythontb notranslate"><div class="highlight"><pre><span></span><span class="n">Error</span> <span class="ow">in</span> <span class="n">read_csv</span><span class="p">(</span><span class="s2">&quot;../data/processed/heart_data.csv&quot;</span><span class="p">,</span> <span class="n">show_col_types</span> <span class="o">=</span> <span class="n">FALSE</span><span class="p">):</span> <span class="n">could</span> <span class="ow">not</span> <span class="n">find</span> <span class="n">function</span> <span class="s2">&quot;read_csv&quot;</span>
<span class="ne">Traceback</span>:
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>── <span class=" -Color -Color-Bold">Attaching packages</span> ──────────────────────────────────────────────────────────────────────────────────── tidyverse 1.3.2 ──
</pre></div>
</div>
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span><span class=" -Color -Color-Green"></span> <span class=" -Color -Color-Blue">ggplot2</span> 3.3.6 <span class=" -Color -Color-Green"></span> <span class=" -Color -Color-Blue">purrr </span> 0.3.5
<span class=" -Color -Color-Green"></span> <span class=" -Color -Color-Blue">tibble </span> 3.1.8 <span class=" -Color -Color-Green"></span> <span class=" -Color -Color-Blue">dplyr </span> 1.0.10
<span class=" -Color -Color-Green"></span> <span class=" -Color -Color-Blue">tidyr </span> 1.2.1 <span class=" -Color -Color-Green"></span> <span class=" -Color -Color-Blue">stringr</span> 1.4.1
<span class=" -Color -Color-Green"></span> <span class=" -Color -Color-Blue">readr </span> 2.1.3 <span class=" -Color -Color-Green"></span> <span class=" -Color -Color-Blue">forcats</span> 0.5.2
</pre></div>
</div>
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>── <span class=" -Color -Color-Bold">Conflicts</span> ─────────────────────────────────────────────────────────────────────────────────────── tidyverse_conflicts() ──
<span class=" -Color -Color-Red"></span> <span class=" -Color -Color-Blue">dplyr</span>::<span class=" -Color -Color-Green">filter()</span> masks <span class=" -Color -Color-Blue">stats</span>::filter()
<span class=" -Color -Color-Red"></span> <span class=" -Color -Color-Blue">dplyr</span>::<span class=" -Color -Color-Green">lag()</span> masks <span class=" -Color -Color-Blue">stats</span>::lag()
</pre></div>
</div>
<div class="output text_html"><table class="dataframe">
<caption>A tibble: 6 × 21</caption>
<thead>
<tr><th scope=col>place</th><th scope=col>age</th><th scope=col>sex</th><th scope=col>chest_pain</th><th scope=col>rest_bp</th><th scope=col>cholestoral_mmHg</th><th scope=col>fasting_bs</th><th scope=col>rest_ECG</th><th scope=col>max_heart_rate</th><th scope=col>exercise</th><th scope=col></th><th scope=col>thal</th><th scope=col>diagnosis</th><th scope=col>sex_f</th><th scope=col>chest_pain_f</th><th scope=col>fasting_bs_f</th><th scope=col>rest_ECG_f</th><th scope=col>exercise_f</th><th scope=col>major_vessels_f</th><th scope=col>thal_f</th><th scope=col>diagnosis_f</th></tr>
<tr><th scope=col>&lt;chr&gt;</th><th scope=col>&lt;dbl&gt;</th><th scope=col>&lt;dbl&gt;</th><th scope=col>&lt;dbl&gt;</th><th scope=col>&lt;dbl&gt;</th><th scope=col>&lt;dbl&gt;</th><th scope=col>&lt;dbl&gt;</th><th scope=col>&lt;dbl&gt;</th><th scope=col>&lt;dbl&gt;</th><th scope=col>&lt;dbl&gt;</th><th scope=col></th><th scope=col>&lt;dbl&gt;</th><th scope=col>&lt;dbl&gt;</th><th scope=col>&lt;dbl&gt;</th><th scope=col>&lt;dbl&gt;</th><th scope=col>&lt;dbl&gt;</th><th scope=col>&lt;dbl&gt;</th><th scope=col>&lt;dbl&gt;</th><th scope=col>&lt;dbl&gt;</th><th scope=col>&lt;dbl&gt;</th><th scope=col>&lt;dbl&gt;</th></tr>
</thead>
<tbody>
<tr><td>switzerland</td><td>32</td><td>1</td><td>1</td><td> 95</td><td>0</td><td>NA</td><td> 0</td><td>127</td><td>0</td><td></td><td>NA</td><td>1</td><td>1</td><td>1</td><td>NA</td><td> 0</td><td>0</td><td>NA</td><td>NA</td><td>1</td></tr>
<tr><td>switzerland</td><td>34</td><td>1</td><td>4</td><td>115</td><td>0</td><td>NA</td><td>NA</td><td>154</td><td>0</td><td></td><td>NA</td><td>1</td><td>1</td><td>4</td><td>NA</td><td>NA</td><td>0</td><td>NA</td><td>NA</td><td>1</td></tr>
<tr><td>switzerland</td><td>35</td><td>1</td><td>4</td><td> NA</td><td>0</td><td>NA</td><td> 0</td><td>130</td><td>1</td><td></td><td> 7</td><td>3</td><td>1</td><td>4</td><td>NA</td><td> 0</td><td>1</td><td>NA</td><td> 7</td><td>3</td></tr>
<tr><td>switzerland</td><td>36</td><td>1</td><td>4</td><td>110</td><td>0</td><td>NA</td><td> 0</td><td>125</td><td>1</td><td></td><td> 6</td><td>1</td><td>1</td><td>4</td><td>NA</td><td> 0</td><td>1</td><td>NA</td><td> 6</td><td>1</td></tr>
<tr><td>switzerland</td><td>38</td><td>0</td><td>4</td><td>105</td><td>0</td><td>NA</td><td> 0</td><td>166</td><td>0</td><td></td><td>NA</td><td>2</td><td>0</td><td>4</td><td>NA</td><td> 0</td><td>0</td><td>NA</td><td>NA</td><td>2</td></tr>
<tr><td>switzerland</td><td>38</td><td>0</td><td>4</td><td>110</td><td>0</td><td> 0</td><td> 0</td><td>156</td><td>0</td><td></td><td> 3</td><td>1</td><td>0</td><td>4</td><td> 0</td><td> 0</td><td>0</td><td>NA</td><td> 3</td><td>1</td></tr>
</tbody>
</table>
</div></div>
</div>
<p><span style="color:gray"><em><strong>Table 1.</strong></em> <em>All columns with all data from the four heart disease data sets.</em></style></p>
<section id="training-and-testing-set">
Expand Down Expand Up @@ -534,10 +559,24 @@ <h2><a class="toc-backref" href="#id27">Classification Model</a><a class="header
<tr><th scope=col>&lt;dbl&gt;</th><th scope=col>&lt;chr&gt;</th><th scope=col>&lt;chr&gt;</th><th scope=col>&lt;dbl&gt;</th><th scope=col>&lt;dbl&gt;</th><th scope=col>&lt;dbl&gt;</th><th scope=col>&lt;chr&gt;</th></tr>
</thead>
<tbody>
<tr><td>1</td><td>accuracy</td><td>multiclass</td><td>0.7741329</td><td>5</td><td>0.0236634</td><td>Preprocessor1_Model01</td></tr>
<tr><td>2</td><td>accuracy</td><td>multiclass</td><td>0.7741329</td><td>5</td><td>0.0236634</td><td>Preprocessor1_Model02</td></tr>
<tr><td>3</td><td>accuracy</td><td>multiclass</td><td>0.6029462</td><td>5</td><td>0.0151404</td><td>Preprocessor1_Model03</td></tr>
<tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>
<tr><td> 1</td><td>accuracy</td><td>multiclass</td><td>0.7741329</td><td>5</td><td>0.02366340</td><td>Preprocessor1_Model01</td></tr>
<tr><td> 2</td><td>accuracy</td><td>multiclass</td><td>0.7741329</td><td>5</td><td>0.02366340</td><td>Preprocessor1_Model02</td></tr>
<tr><td> 3</td><td>accuracy</td><td>multiclass</td><td>0.6029462</td><td>5</td><td>0.01514040</td><td>Preprocessor1_Model03</td></tr>
<tr><td> 4</td><td>accuracy</td><td>multiclass</td><td>0.5385281</td><td>5</td><td>0.02673251</td><td>Preprocessor1_Model04</td></tr>
<tr><td> 5</td><td>accuracy</td><td>multiclass</td><td>0.4887989</td><td>5</td><td>0.02443692</td><td>Preprocessor1_Model05</td></tr>
<tr><td> 6</td><td>accuracy</td><td>multiclass</td><td>0.4738275</td><td>5</td><td>0.02162800</td><td>Preprocessor1_Model06</td></tr>
<tr><td> 7</td><td>accuracy</td><td>multiclass</td><td>0.4439486</td><td>5</td><td>0.02178144</td><td>Preprocessor1_Model07</td></tr>
<tr><td> 8</td><td>accuracy</td><td>multiclass</td><td>0.4293183</td><td>5</td><td>0.02294124</td><td>Preprocessor1_Model08</td></tr>
<tr><td> 9</td><td>accuracy</td><td>multiclass</td><td>0.4121262</td><td>5</td><td>0.03267083</td><td>Preprocessor1_Model09</td></tr>
<tr><td>10</td><td>accuracy</td><td>multiclass</td><td>0.3998106</td><td>5</td><td>0.03164645</td><td>Preprocessor1_Model10</td></tr>
<tr><td>11</td><td>accuracy</td><td>multiclass</td><td>0.3947775</td><td>5</td><td>0.02715977</td><td>Preprocessor1_Model11</td></tr>
<tr><td>12</td><td>accuracy</td><td>multiclass</td><td>0.3775205</td><td>5</td><td>0.03101980</td><td>Preprocessor1_Model12</td></tr>
<tr><td>13</td><td>accuracy</td><td>multiclass</td><td>0.3600483</td><td>5</td><td>0.02919724</td><td>Preprocessor1_Model13</td></tr>
<tr><td>14</td><td>accuracy</td><td>multiclass</td><td>0.3673307</td><td>5</td><td>0.01475960</td><td>Preprocessor1_Model14</td></tr>
<tr><td>15</td><td>accuracy</td><td>multiclass</td><td>0.3697072</td><td>5</td><td>0.01017029</td><td>Preprocessor1_Model15</td></tr>
<tr><td>16</td><td>accuracy</td><td>multiclass</td><td>0.3794935</td><td>5</td><td>0.01357445</td><td>Preprocessor1_Model16</td></tr>
<tr><td>17</td><td>accuracy</td><td>multiclass</td><td>0.3770868</td><td>5</td><td>0.01510417</td><td>Preprocessor1_Model17</td></tr>
<tr><td>18</td><td>accuracy</td><td>multiclass</td><td>0.3891863</td><td>5</td><td>0.01990557</td><td>Preprocessor1_Model18</td></tr>
<tr><td>19</td><td>accuracy</td><td>multiclass</td><td>0.3916246</td><td>5</td><td>0.02010759</td><td>Preprocessor1_Model19</td></tr>
<tr><td>20</td><td>accuracy</td><td>multiclass</td><td>0.3968738</td><td>5</td><td>0.01765057</td><td>Preprocessor1_Model20</td></tr>
<tr><td>21</td><td>accuracy</td><td>multiclass</td><td>0.3893414</td><td>5</td><td>0.01604878</td><td>Preprocessor1_Model21</td></tr>
Expand Down Expand Up @@ -573,7 +612,61 @@ <h3><a class="toc-backref" href="#id28">Testing the Model</a><a class="headerlin
<tr><td>2</td><td>110</td><td>38</td><td>156</td><td>1</td></tr>
<tr><td>1</td><td>115</td><td>38</td><td>128</td><td>1</td></tr>
<tr><td>0</td><td>150</td><td>38</td><td>120</td><td>1</td></tr>
<tr><td>3</td><td>105</td><td>42</td><td>128</td><td>1</td></tr>
<tr><td>4</td><td>110</td><td>45</td><td>138</td><td>0</td></tr>
<tr><td>3</td><td>100</td><td>46</td><td>133</td><td>1</td></tr>
<tr><td>1</td><td>110</td><td>47</td><td>120</td><td>1</td></tr>
<tr><td>2</td><td>120</td><td>51</td><td>104</td><td>3</td></tr>
<tr><td>1</td><td>130</td><td>51</td><td>170</td><td>2</td></tr>
<tr><td>4</td><td> 95</td><td>52</td><td> 82</td><td>2</td></tr>
<tr><td>4</td><td>120</td><td>53</td><td> 95</td><td>3</td></tr>
<tr><td>2</td><td>130</td><td>53</td><td>120</td><td>0</td></tr>
<tr><td>2</td><td> 80</td><td>53</td><td>141</td><td>0</td></tr>
<tr><td>1</td><td>120</td><td>54</td><td>155</td><td>2</td></tr>
<tr><td>0</td><td>180</td><td>54</td><td>150</td><td>1</td></tr>
<tr><td>1</td><td>140</td><td>55</td><td>150</td><td>0</td></tr>
<tr><td>1</td><td>115</td><td>55</td><td>155</td><td>1</td></tr>
<tr><td>2</td><td>120</td><td>56</td><td> 97</td><td>0</td></tr>
<tr><td>2</td><td>155</td><td>56</td><td> 99</td><td>2</td></tr>
<tr><td>1</td><td>120</td><td>56</td><td>148</td><td>2</td></tr>
<tr><td>2</td><td>140</td><td>56</td><td>121</td><td>1</td></tr>
<tr><td>1</td><td>105</td><td>57</td><td>148</td><td>1</td></tr>
<tr><td>1</td><td>140</td><td>57</td><td>100</td><td>3</td></tr>
<tr><td>0</td><td>110</td><td>59</td><td> 94</td><td>3</td></tr>
<tr><td>2</td><td>160</td><td>60</td><td> 99</td><td>3</td></tr>
<tr><td>2</td><td>160</td><td>60</td><td>149</td><td>1</td></tr>
<tr><td>3</td><td>130</td><td>61</td><td>115</td><td>3</td></tr>
<tr><td>2</td><td>130</td><td>61</td><td> 77</td><td>3</td></tr>
<tr><td>0</td><td>150</td><td>61</td><td>117</td><td>2</td></tr>
<tr><td>2</td><td>150</td><td>63</td><td>154</td><td>3</td></tr>
<tr><td></td><td></td><td></td><td></td><td></td></tr>
<tr><td>0</td><td>114</td><td>51</td><td> 96</td><td>0</td></tr>
<tr><td>1</td><td>127</td><td>54</td><td>154</td><td>1</td></tr>
<tr><td>2</td><td>140</td><td>63</td><td>112</td><td>2</td></tr>
<tr><td>2</td><td>160</td><td>60</td><td>157</td><td>1</td></tr>
<tr><td>4</td><td>170</td><td>63</td><td> 84</td><td>4</td></tr>
<tr><td>0</td><td>126</td><td>63</td><td>120</td><td>0</td></tr>
<tr><td>0</td><td>152</td><td>60</td><td>118</td><td>0</td></tr>
<tr><td>1</td><td>120</td><td>64</td><td>106</td><td>1</td></tr>
<tr><td>1</td><td>120</td><td>56</td><td>120</td><td>1</td></tr>
<tr><td>1</td><td>124</td><td>56</td><td>161</td><td>0</td></tr>
<tr><td>1</td><td>126</td><td>53</td><td>106</td><td>1</td></tr>
<tr><td>4</td><td>170</td><td>56</td><td>123</td><td>4</td></tr>
<tr><td>2</td><td>140</td><td>69</td><td>118</td><td>2</td></tr>
<tr><td>3</td><td>136</td><td>54</td><td>140</td><td>3</td></tr>
<tr><td>3</td><td>120</td><td>72</td><td>102</td><td>3</td></tr>
<tr><td>1</td><td>142</td><td>60</td><td>110</td><td>2</td></tr>
<tr><td>2</td><td>146</td><td>61</td><td>148</td><td>2</td></tr>
<tr><td>1</td><td>158</td><td>62</td><td>112</td><td>1</td></tr>
<tr><td>1</td><td>102</td><td>48</td><td>110</td><td>1</td></tr>
<tr><td>0</td><td>150</td><td>55</td><td>150</td><td>0</td></tr>
<tr><td>4</td><td>104</td><td>76</td><td>120</td><td>4</td></tr>
<tr><td>0</td><td>120</td><td>62</td><td> 86</td><td>0</td></tr>
<tr><td>2</td><td>150</td><td>58</td><td>118</td><td>2</td></tr>
<tr><td>0</td><td>160</td><td>75</td><td>112</td><td>0</td></tr>
<tr><td>2</td><td>150</td><td>64</td><td>135</td><td>2</td></tr>
<tr><td>1</td><td>180</td><td>57</td><td>120</td><td>1</td></tr>
<tr><td>3</td><td>140</td><td>67</td><td>122</td><td>3</td></tr>
<tr><td>2</td><td>130</td><td>64</td><td>130</td><td>2</td></tr>
<tr><td>3</td><td>160</td><td>58</td><td>113</td><td>3</td></tr>
<tr><td>2</td><td>150</td><td>58</td><td>118</td><td>2</td></tr>
Expand Down
Loading

0 comments on commit 0678e2b

Please sign in to comment.