Skip to content

Instantly share code, notes, and snippets.

@genya0407
Created May 18, 2017 11:43
Show Gist options
  • Save genya0407/755426d225d993ba9ff7ef6ad3d93264 to your computer and use it in GitHub Desktop.
Save genya0407/755426d225d993ba9ff7ef6ad3d93264 to your computer and use it in GitHub Desktop.
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# 赤ワインと白ワインのどっちがおいしい?\n",
"\n",
"https://archive.ics.uci.edu/ml/datasets/wine\n",
"←このデータから、赤ワインの評価と白ワインの評価に差があるかを調べる"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
"data": {
"application/javascript": [
"if(window['d3'] === undefined ||\n",
" window['Nyaplot'] === undefined){\n",
" var path = {\"d3\":\"https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.5/d3.min\",\"downloadable\":\"http://cdn.rawgit.com/domitry/d3-downloadable/master/d3-downloadable\"};\n",
"\n",
"\n",
"\n",
" var shim = {\"d3\":{\"exports\":\"d3\"},\"downloadable\":{\"exports\":\"downloadable\"}};\n",
"\n",
" require.config({paths: path, shim:shim});\n",
"\n",
"\n",
"require(['d3'], function(d3){window['d3']=d3;console.log('finished loading d3');require(['downloadable'], function(downloadable){window['downloadable']=downloadable;console.log('finished loading downloadable');\n",
"\n",
"\tvar script = d3.select(\"head\")\n",
"\t .append(\"script\")\n",
"\t .attr(\"src\", \"http://cdn.rawgit.com/domitry/Nyaplotjs/master/release/nyaplot.js\")\n",
"\t .attr(\"async\", true);\n",
"\n",
"\tscript[0][0].onload = script[0][0].onreadystatechange = function(){\n",
"\n",
"\n",
"\t var event = document.createEvent(\"HTMLEvents\");\n",
"\t event.initEvent(\"load_nyaplot\",false,false);\n",
"\t window.dispatchEvent(event);\n",
"\t console.log('Finished loading Nyaplotjs');\n",
"\n",
"\t};\n",
"\n",
"\n",
"});});\n",
"}\n"
],
"text/plain": [
"\"if(window['d3'] === undefined ||\\n window['Nyaplot'] === undefined){\\n var path = {\\\"d3\\\":\\\"https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.5/d3.min\\\",\\\"downloadable\\\":\\\"http://cdn.rawgit.com/domitry/d3-downloadable/master/d3-downloadable\\\"};\\n\\n\\n\\n var shim = {\\\"d3\\\":{\\\"exports\\\":\\\"d3\\\"},\\\"downloadable\\\":{\\\"exports\\\":\\\"downloadable\\\"}};\\n\\n require.config({paths: path, shim:shim});\\n\\n\\nrequire(['d3'], function(d3){window['d3']=d3;console.log('finished loading d3');require(['downloadable'], function(downloadable){window['downloadable']=downloadable;console.log('finished loading downloadable');\\n\\n\\tvar script = d3.select(\\\"head\\\")\\n\\t .append(\\\"script\\\")\\n\\t .attr(\\\"src\\\", \\\"http://cdn.rawgit.com/domitry/Nyaplotjs/master/release/nyaplot.js\\\")\\n\\t .attr(\\\"async\\\", true);\\n\\n\\tscript[0][0].onload = script[0][0].onreadystatechange = function(){\\n\\n\\n\\t var event = document.createEvent(\\\"HTMLEvents\\\");\\n\\t event.initEvent(\\\"load_nyaplot\\\",false,false);\\n\\t window.dispatchEvent(event);\\n\\t console.log('Finished loading Nyaplotjs');\\n\\n\\t};\\n\\n\\n});});\\n}\\n\""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"true"
]
},
"execution_count": 1,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"require 'daru'\n",
"require 'rbplotly'\n",
"require 'daru_plotly'\n",
"require 'statsample'"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## csvを読み込む"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<table>\n",
" <tr>\n",
" <th colspan='14'>Daru::DataFrame(10x13)</th>\n",
" </tr>\n",
"\n",
" \n",
" <tr>\n",
" <th></th>\n",
" \n",
" <th>type</th>\n",
" \n",
" <th>fixed acidity</th>\n",
" \n",
" <th>volatile acidity</th>\n",
" \n",
" <th>citric acid</th>\n",
" \n",
" <th>residual sugar</th>\n",
" \n",
" <th>chlorides</th>\n",
" \n",
" <th>free sulfur dioxide</th>\n",
" \n",
" <th>total sulfur dioxide</th>\n",
" \n",
" <th>density</th>\n",
" \n",
" <th>pH</th>\n",
" \n",
" <th>sulphates</th>\n",
" \n",
" <th>alcohol</th>\n",
" \n",
" <th>quality</th>\n",
" \n",
" </tr>\n",
" \n",
"\n",
" \n",
" <tr>\n",
" <td>0</td>\n",
" \n",
" <td>red</td>\n",
" \n",
" <td>7.4</td>\n",
" \n",
" <td>0.7</td>\n",
" \n",
" <td>0</td>\n",
" \n",
" <td>1.9</td>\n",
" \n",
" <td>0.076</td>\n",
" \n",
" <td>11</td>\n",
" \n",
" <td>34</td>\n",
" \n",
" <td>0.9978</td>\n",
" \n",
" <td>3.51</td>\n",
" \n",
" <td>0.56</td>\n",
" \n",
" <td>9.4</td>\n",
" \n",
" <td>5</td>\n",
" \n",
" </tr>\n",
" \n",
" <tr>\n",
" <td>1</td>\n",
" \n",
" <td>red</td>\n",
" \n",
" <td>7.8</td>\n",
" \n",
" <td>0.88</td>\n",
" \n",
" <td>0</td>\n",
" \n",
" <td>2.6</td>\n",
" \n",
" <td>0.098</td>\n",
" \n",
" <td>25</td>\n",
" \n",
" <td>67</td>\n",
" \n",
" <td>0.9968</td>\n",
" \n",
" <td>3.2</td>\n",
" \n",
" <td>0.68</td>\n",
" \n",
" <td>9.8</td>\n",
" \n",
" <td>5</td>\n",
" \n",
" </tr>\n",
" \n",
" <tr>\n",
" <td>2</td>\n",
" \n",
" <td>red</td>\n",
" \n",
" <td>7.8</td>\n",
" \n",
" <td>0.76</td>\n",
" \n",
" <td>0.04</td>\n",
" \n",
" <td>2.3</td>\n",
" \n",
" <td>0.092</td>\n",
" \n",
" <td>15</td>\n",
" \n",
" <td>54</td>\n",
" \n",
" <td>0.997</td>\n",
" \n",
" <td>3.26</td>\n",
" \n",
" <td>0.65</td>\n",
" \n",
" <td>9.8</td>\n",
" \n",
" <td>5</td>\n",
" \n",
" </tr>\n",
" \n",
" <tr>\n",
" <td>3</td>\n",
" \n",
" <td>red</td>\n",
" \n",
" <td>11.2</td>\n",
" \n",
" <td>0.28</td>\n",
" \n",
" <td>0.56</td>\n",
" \n",
" <td>1.9</td>\n",
" \n",
" <td>0.075</td>\n",
" \n",
" <td>17</td>\n",
" \n",
" <td>60</td>\n",
" \n",
" <td>0.998</td>\n",
" \n",
" <td>3.16</td>\n",
" \n",
" <td>0.58</td>\n",
" \n",
" <td>9.8</td>\n",
" \n",
" <td>6</td>\n",
" \n",
" </tr>\n",
" \n",
" <tr>\n",
" <td>4</td>\n",
" \n",
" <td>red</td>\n",
" \n",
" <td>7.4</td>\n",
" \n",
" <td>0.7</td>\n",
" \n",
" <td>0</td>\n",
" \n",
" <td>1.9</td>\n",
" \n",
" <td>0.076</td>\n",
" \n",
" <td>11</td>\n",
" \n",
" <td>34</td>\n",
" \n",
" <td>0.9978</td>\n",
" \n",
" <td>3.51</td>\n",
" \n",
" <td>0.56</td>\n",
" \n",
" <td>9.4</td>\n",
" \n",
" <td>5</td>\n",
" \n",
" </tr>\n",
" \n",
" <tr>\n",
" <td>5</td>\n",
" \n",
" <td>red</td>\n",
" \n",
" <td>7.4</td>\n",
" \n",
" <td>0.66</td>\n",
" \n",
" <td>0</td>\n",
" \n",
" <td>1.8</td>\n",
" \n",
" <td>0.075</td>\n",
" \n",
" <td>13</td>\n",
" \n",
" <td>40</td>\n",
" \n",
" <td>0.9978</td>\n",
" \n",
" <td>3.51</td>\n",
" \n",
" <td>0.56</td>\n",
" \n",
" <td>9.4</td>\n",
" \n",
" <td>5</td>\n",
" \n",
" </tr>\n",
" \n",
" <tr>\n",
" <td>6</td>\n",
" \n",
" <td>red</td>\n",
" \n",
" <td>7.9</td>\n",
" \n",
" <td>0.6</td>\n",
" \n",
" <td>0.06</td>\n",
" \n",
" <td>1.6</td>\n",
" \n",
" <td>0.069</td>\n",
" \n",
" <td>15</td>\n",
" \n",
" <td>59</td>\n",
" \n",
" <td>0.9964</td>\n",
" \n",
" <td>3.3</td>\n",
" \n",
" <td>0.46</td>\n",
" \n",
" <td>9.4</td>\n",
" \n",
" <td>5</td>\n",
" \n",
" </tr>\n",
" \n",
" <tr>\n",
" <td>7</td>\n",
" \n",
" <td>red</td>\n",
" \n",
" <td>7.3</td>\n",
" \n",
" <td>0.65</td>\n",
" \n",
" <td>0</td>\n",
" \n",
" <td>1.2</td>\n",
" \n",
" <td>0.065</td>\n",
" \n",
" <td>15</td>\n",
" \n",
" <td>21</td>\n",
" \n",
" <td>0.9946</td>\n",
" \n",
" <td>3.39</td>\n",
" \n",
" <td>0.47</td>\n",
" \n",
" <td>10</td>\n",
" \n",
" <td>7</td>\n",
" \n",
" </tr>\n",
" \n",
" <tr>\n",
" <td>8</td>\n",
" \n",
" <td>red</td>\n",
" \n",
" <td>7.8</td>\n",
" \n",
" <td>0.58</td>\n",
" \n",
" <td>0.02</td>\n",
" \n",
" <td>2</td>\n",
" \n",
" <td>0.073</td>\n",
" \n",
" <td>9</td>\n",
" \n",
" <td>18</td>\n",
" \n",
" <td>0.9968</td>\n",
" \n",
" <td>3.36</td>\n",
" \n",
" <td>0.57</td>\n",
" \n",
" <td>9.5</td>\n",
" \n",
" <td>7</td>\n",
" \n",
" </tr>\n",
" \n",
" <tr>\n",
" <td>9</td>\n",
" \n",
" <td>red</td>\n",
" \n",
" <td>7.5</td>\n",
" \n",
" <td>0.5</td>\n",
" \n",
" <td>0.36</td>\n",
" \n",
" <td>6.1</td>\n",
" \n",
" <td>0.071</td>\n",
" \n",
" <td>17</td>\n",
" \n",
" <td>102</td>\n",
" \n",
" <td>0.9978</td>\n",
" \n",
" <td>3.35</td>\n",
" \n",
" <td>0.8</td>\n",
" \n",
" <td>10.5</td>\n",
" \n",
" <td>5</td>\n",
" \n",
" </tr>\n",
" \n",
"\n",
" \n",
"</table>"
],
"text/plain": [
"#<Daru::DataFrame(10x13)>\n",
" type fixed acid volatile a citric aci residual s chlorides free sulfu total sulf density pH sulphates alcohol quality\n",
" 0 red 7.4 0.7 0 1.9 0.076 11 34 0.9978 3.51 0.56 9.4 5\n",
" 1 red 7.8 0.88 0 2.6 0.098 25 67 0.9968 3.2 0.68 9.8 5\n",
" 2 red 7.8 0.76 0.04 2.3 0.092 15 54 0.997 3.26 0.65 9.8 5\n",
" 3 red 11.2 0.28 0.56 1.9 0.075 17 60 0.998 3.16 0.58 9.8 6\n",
" 4 red 7.4 0.7 0 1.9 0.076 11 34 0.9978 3.51 0.56 9.4 5\n",
" 5 red 7.4 0.66 0 1.8 0.075 13 40 0.9978 3.51 0.56 9.4 5\n",
" 6 red 7.9 0.6 0.06 1.6 0.069 15 59 0.9964 3.3 0.46 9.4 5\n",
" 7 red 7.3 0.65 0 1.2 0.065 15 21 0.9946 3.39 0.47 10 7\n",
" 8 red 7.8 0.58 0.02 2 0.073 9 18 0.9968 3.36 0.57 9.5 7\n",
" 9 red 7.5 0.5 0.36 6.1 0.071 17 102 0.9978 3.35 0.8 10.5 5"
]
},
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"wine = Daru::DataFrame.from_csv('./winequality-both.csv')\n",
"wine.head 10 # 最初の10行を表示"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[\"red\", \"white\"]"
]
},
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"wine['type'].uniq.to_a"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[3, 4, 5, 6, 7, 8, 9]"
]
},
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"\n",
"wine['quality'].uniq.to_a.sort"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"Object"
]
},
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"include Daru::Plotly::Initializer # plot"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\n",
" <script>\n",
" requirejs.config({paths: { 'plotly': ['https://cdn.plot.ly/plotly-latest.min'] }})\n",
" </script>\n",
"\n",
"\n",
"<div id=\"36a74bbd-dcab-4486-a8d7-56afbdfe4991\" style=\"height: 100%; width: 100%;\"></div>\n",
"\n",
"<script>\n",
" require(['plotly'], function(Plotly) { \n",
"Plotly.newPlot(\n",
" '36a74bbd-dcab-4486-a8d7-56afbdfe4991',\n",
" [{\"x\":[5,5,5,6,5,5,5,7,7,5,5,5,5,5,5,5,7,5,4,6,6,5,5,5,6,5,5,5,5,6,5,6,5,6,5,6,6,7,4,5,5,4,6,5,5,4,5,5,5,5,5,6,6,5,6,5,5,5,5,6,5,5,7,5,5,5,5,5,5,6,6,5,5,4,5,5,5,6,5,4,5,5,5,5,6,5,6,5,5,5,5,6,5,5,4,6,5,5,5,6,6,6,6,5,5,5,5,5,6,5,5,5,5,6,5,6,6,6,6,6,5,6,5,5,5,5,5,5,7,5,5,5,5,6,6,5,5,5,5,5,5,5,6,5,6,5,5,5,6,6,6,4,5,5,5,5,5,5,5,6,5,4,6,5,5,5,5,4,6,5,4,6,6,6,5,5,5,6,5,5,5,5,5,5,6,5,5,5,5,5,5,6,5,5,5,5,5,6,7,4,7,5,5,5,6,7,7,5,5,7,6,6,6,5,6,5,5,5,5,5,6,5,5,6,4,6,6,5,6,5,7,6,6,5,6,6,6,6,6,6,5,6,6,7,7,6,5,5,6,6,6,6,5,5,6,5,5,5,5,7,5,4,5,5,5,7,4,8,6,6,6,6,5,5,5,6,6,6,8,7,6,7,5,7,5,5,6,6,7,5,7,5,6,6,6,5,5,5,5,5,6,6,5,5,5,6,5,6,6,6,6,6,6,5,5,6,5,6,7,6,7,5,5,6,6,6,7,5,6,5,6,6,6,5,7,7,6,5,6,7,6,6,6,6,6,5,7,6,6,6,6,6,5,5,6,6,5,7,7,6,5,6,5,5,7,6,7,5,5,7,5,6,6,5,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"linkText\":\"Export to plot.ly\",\"showLink\":true}\n",
")\n",
"\n",
"window.addEventListener('resize', function() {\n",
" Plotly.Plots.resize(document.getElementById('36a74bbd-dcab-4486-a8d7-56afbdfe4991'))\n",
"})\n",
" }) \n",
"</script>"
],
"text/plain": [
"#<Plotly::Offline::HTML:0x007fd4230e04f8 @id=\"36a74bbd-dcab-4486-a8d7-56afbdfe4991\", @data=[{:x=>[5, 5, 5, 6, 5, 5, 5, 7, 7, 5, 5, 5, 5, 5, 5, 5, 7, 5, 4, 6, 6, 5, 5, 5, 6, 5, 5, 5, 5, 6, 5, 6, 5, 6, 5, 6, 6, 7, 4, 5, 5, 4, 6, 5, 5, 4, 5, 5, 5, 5, 5, 6, 6, 5, 6, 5, 5, 5, 5, 6, 5, 5, 7, 5, 5, 5, 5, 5, 5, 6, 6, 5, 5, 4, 5, 5, 5, 6, 5, 4, 5, 5, 5, 5, 6, 5, 6, 5, 5, 5, 5, 6, 5, 5, 4, 6, 5, 5, 5, 6, 6, 6, 6, 5, 5, 5, 5, 5, 6, 5, 5, 5, 5, 6, 5, 6, 6, 6, 6, 6, 5, 6, 5, 5, 5, 5, 5, 5, 7, 5, 5, 5, 5, 6, 6, 5, 5, 5, 5, 5, 5, 5, 6, 5, 6, 5, 5, 5, 6, 6, 6, 4, 5, 5, 5, 5, 5, 5, 5, 6, 5, 4, 6, 5, 5, 5, 5, 4, 6, 5, 4, 6, 6, 6, 5, 5, 5, 6, 5, 5, 5, 5, 5, 5, 6, 5, 5, 5, 5, 5, 5, 6, 5, 5, 5, 5, 5, 6, 7, 4, 7, 5, 5, 5, 6, 7, 7, 5, 5, 7, 6, 6, 6, 5, 6, 5, 5, 5, 5, 5, 6, 5, 5, 6, 4, 6, 6, 5, 6, 5, 7, 6, 6, 5, 6, 6, 6, 6, 6, 6, 5, 6, 6, 7, 7, 6, 5, 5, 6, 6, 6, 6, 5, 5, 6, 5, 5, 5, 5, 7, 5, 4, 5, 5, 5, 7, 4, 8, 6, 6, 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7, 6, 6, 6, 6, 5, 6, 6, 7, 5, 6, 6, 6, 5, 7, 6, 6, 5, 6, 7, 6, 5, 6, 6, 4, 7, 6, 6, 5, 6, 5, 6, 7, 6, 5, 6, 5, 5, 5, 6, 6, 6, 6, 5, 6, 6, 6, 6, 7, 5, 6, 6, 6, 6, 6, 7, 6, 5, 6, 6, 6, 7, 5, 4, 6, 6, 6, 5, 6, 5, 6, 7, 7, 5, 6, 6, 6, 5, 6, 5, 6, 7, 6], :type=>:histogram}], @layout={:width=>1000, :height=>500}, @config={:linkText=>\"Export to plot.ly\", :showLink=>true}, @embedded=true>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"#<CZTop::Socket::PUB:0x7fd4227a76a0 last_endpoint=\"tcp://127.0.0.1:52017\">"
]
},
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"plot(wine['quality'], type: :histogram, x: :quality).show"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## 赤ワインと白ワインを分ける"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<table>\n",
" <tr>\n",
" <th colspan='14'>Daru::DataFrame(10x13)</th>\n",
" </tr>\n",
"\n",
" \n",
" <tr>\n",
" <th></th>\n",
" \n",
" <th>type</th>\n",
" \n",
" <th>fixed acidity</th>\n",
" \n",
" <th>volatile acidity</th>\n",
" \n",
" <th>citric acid</th>\n",
" \n",
" <th>residual sugar</th>\n",
" \n",
" <th>chlorides</th>\n",
" \n",
" <th>free sulfur dioxide</th>\n",
" \n",
" <th>total sulfur dioxide</th>\n",
" \n",
" <th>density</th>\n",
" \n",
" <th>pH</th>\n",
" \n",
" <th>sulphates</th>\n",
" \n",
" <th>alcohol</th>\n",
" \n",
" <th>quality</th>\n",
" \n",
" </tr>\n",
" \n",
"\n",
" \n",
" <tr>\n",
" <td>0</td>\n",
" \n",
" <td>red</td>\n",
" \n",
" <td>7.4</td>\n",
" \n",
" <td>0.7</td>\n",
" \n",
" <td>0</td>\n",
" \n",
" <td>1.9</td>\n",
" \n",
" <td>0.076</td>\n",
" \n",
" <td>11</td>\n",
" \n",
" <td>34</td>\n",
" \n",
" <td>0.9978</td>\n",
" \n",
" <td>3.51</td>\n",
" \n",
" <td>0.56</td>\n",
" \n",
" <td>9.4</td>\n",
" \n",
" <td>5</td>\n",
" \n",
" </tr>\n",
" \n",
" <tr>\n",
" <td>1</td>\n",
" \n",
" <td>red</td>\n",
" \n",
" <td>7.8</td>\n",
" \n",
" <td>0.88</td>\n",
" \n",
" <td>0</td>\n",
" \n",
" <td>2.6</td>\n",
" \n",
" <td>0.098</td>\n",
" \n",
" <td>25</td>\n",
" \n",
" <td>67</td>\n",
" \n",
" <td>0.9968</td>\n",
" \n",
" <td>3.2</td>\n",
" \n",
" <td>0.68</td>\n",
" \n",
" <td>9.8</td>\n",
" \n",
" <td>5</td>\n",
" \n",
" </tr>\n",
" \n",
" <tr>\n",
" <td>2</td>\n",
" \n",
" <td>red</td>\n",
" \n",
" <td>7.8</td>\n",
" \n",
" <td>0.76</td>\n",
" \n",
" <td>0.04</td>\n",
" \n",
" <td>2.3</td>\n",
" \n",
" <td>0.092</td>\n",
" \n",
" <td>15</td>\n",
" \n",
" <td>54</td>\n",
" \n",
" <td>0.997</td>\n",
" \n",
" <td>3.26</td>\n",
" \n",
" <td>0.65</td>\n",
" \n",
" <td>9.8</td>\n",
" \n",
" <td>5</td>\n",
" \n",
" </tr>\n",
" \n",
" <tr>\n",
" <td>3</td>\n",
" \n",
" <td>red</td>\n",
" \n",
" <td>11.2</td>\n",
" \n",
" <td>0.28</td>\n",
" \n",
" <td>0.56</td>\n",
" \n",
" <td>1.9</td>\n",
" \n",
" <td>0.075</td>\n",
" \n",
" <td>17</td>\n",
" \n",
" <td>60</td>\n",
" \n",
" <td>0.998</td>\n",
" \n",
" <td>3.16</td>\n",
" \n",
" <td>0.58</td>\n",
" \n",
" <td>9.8</td>\n",
" \n",
" <td>6</td>\n",
" \n",
" </tr>\n",
" \n",
" <tr>\n",
" <td>4</td>\n",
" \n",
" <td>red</td>\n",
" \n",
" <td>7.4</td>\n",
" \n",
" <td>0.7</td>\n",
" \n",
" <td>0</td>\n",
" \n",
" <td>1.9</td>\n",
" \n",
" <td>0.076</td>\n",
" \n",
" <td>11</td>\n",
" \n",
" <td>34</td>\n",
" \n",
" <td>0.9978</td>\n",
" \n",
" <td>3.51</td>\n",
" \n",
" <td>0.56</td>\n",
" \n",
" <td>9.4</td>\n",
" \n",
" <td>5</td>\n",
" \n",
" </tr>\n",
" \n",
" <tr>\n",
" <td>5</td>\n",
" \n",
" <td>red</td>\n",
" \n",
" <td>7.4</td>\n",
" \n",
" <td>0.66</td>\n",
" \n",
" <td>0</td>\n",
" \n",
" <td>1.8</td>\n",
" \n",
" <td>0.075</td>\n",
" \n",
" <td>13</td>\n",
" \n",
" <td>40</td>\n",
" \n",
" <td>0.9978</td>\n",
" \n",
" <td>3.51</td>\n",
" \n",
" <td>0.56</td>\n",
" \n",
" <td>9.4</td>\n",
" \n",
" <td>5</td>\n",
" \n",
" </tr>\n",
" \n",
" <tr>\n",
" <td>6</td>\n",
" \n",
" <td>red</td>\n",
" \n",
" <td>7.9</td>\n",
" \n",
" <td>0.6</td>\n",
" \n",
" <td>0.06</td>\n",
" \n",
" <td>1.6</td>\n",
" \n",
" <td>0.069</td>\n",
" \n",
" <td>15</td>\n",
" \n",
" <td>59</td>\n",
" \n",
" <td>0.9964</td>\n",
" \n",
" <td>3.3</td>\n",
" \n",
" <td>0.46</td>\n",
" \n",
" <td>9.4</td>\n",
" \n",
" <td>5</td>\n",
" \n",
" </tr>\n",
" \n",
" <tr>\n",
" <td>7</td>\n",
" \n",
" <td>red</td>\n",
" \n",
" <td>7.3</td>\n",
" \n",
" <td>0.65</td>\n",
" \n",
" <td>0</td>\n",
" \n",
" <td>1.2</td>\n",
" \n",
" <td>0.065</td>\n",
" \n",
" <td>15</td>\n",
" \n",
" <td>21</td>\n",
" \n",
" <td>0.9946</td>\n",
" \n",
" <td>3.39</td>\n",
" \n",
" <td>0.47</td>\n",
" \n",
" <td>10</td>\n",
" \n",
" <td>7</td>\n",
" \n",
" </tr>\n",
" \n",
" <tr>\n",
" <td>8</td>\n",
" \n",
" <td>red</td>\n",
" \n",
" <td>7.8</td>\n",
" \n",
" <td>0.58</td>\n",
" \n",
" <td>0.02</td>\n",
" \n",
" <td>2</td>\n",
" \n",
" <td>0.073</td>\n",
" \n",
" <td>9</td>\n",
" \n",
" <td>18</td>\n",
" \n",
" <td>0.9968</td>\n",
" \n",
" <td>3.36</td>\n",
" \n",
" <td>0.57</td>\n",
" \n",
" <td>9.5</td>\n",
" \n",
" <td>7</td>\n",
" \n",
" </tr>\n",
" \n",
" <tr>\n",
" <td>9</td>\n",
" \n",
" <td>red</td>\n",
" \n",
" <td>7.5</td>\n",
" \n",
" <td>0.5</td>\n",
" \n",
" <td>0.36</td>\n",
" \n",
" <td>6.1</td>\n",
" \n",
" <td>0.071</td>\n",
" \n",
" <td>17</td>\n",
" \n",
" <td>102</td>\n",
" \n",
" <td>0.9978</td>\n",
" \n",
" <td>3.35</td>\n",
" \n",
" <td>0.8</td>\n",
" \n",
" <td>10.5</td>\n",
" \n",
" <td>5</td>\n",
" \n",
" </tr>\n",
" \n",
"\n",
" \n",
"</table>"
],
"text/plain": [
"#<Daru::DataFrame(10x13)>\n",
" type fixed acid volatile a citric aci residual s chlorides free sulfu total sulf density pH sulphates alcohol quality\n",
" 0 red 7.4 0.7 0 1.9 0.076 11 34 0.9978 3.51 0.56 9.4 5\n",
" 1 red 7.8 0.88 0 2.6 0.098 25 67 0.9968 3.2 0.68 9.8 5\n",
" 2 red 7.8 0.76 0.04 2.3 0.092 15 54 0.997 3.26 0.65 9.8 5\n",
" 3 red 11.2 0.28 0.56 1.9 0.075 17 60 0.998 3.16 0.58 9.8 6\n",
" 4 red 7.4 0.7 0 1.9 0.076 11 34 0.9978 3.51 0.56 9.4 5\n",
" 5 red 7.4 0.66 0 1.8 0.075 13 40 0.9978 3.51 0.56 9.4 5\n",
" 6 red 7.9 0.6 0.06 1.6 0.069 15 59 0.9964 3.3 0.46 9.4 5\n",
" 7 red 7.3 0.65 0 1.2 0.065 15 21 0.9946 3.39 0.47 10 7\n",
" 8 red 7.8 0.58 0.02 2 0.073 9 18 0.9968 3.36 0.57 9.5 7\n",
" 9 red 7.5 0.5 0.36 6.1 0.071 17 102 0.9978 3.35 0.8 10.5 5"
]
},
"execution_count": 7,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"reds = wine.where(wine['type'].eq('red'))\n",
"reds.head 10"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<table>\n",
" <tr>\n",
" <th colspan='14'>Daru::DataFrame(10x13)</th>\n",
" </tr>\n",
"\n",
" \n",
" <tr>\n",
" <th></th>\n",
" \n",
" <th>type</th>\n",
" \n",
" <th>fixed acidity</th>\n",
" \n",
" <th>volatile acidity</th>\n",
" \n",
" <th>citric acid</th>\n",
" \n",
" <th>residual sugar</th>\n",
" \n",
" <th>chlorides</th>\n",
" \n",
" <th>free sulfur dioxide</th>\n",
" \n",
" <th>total sulfur dioxide</th>\n",
" \n",
" <th>density</th>\n",
" \n",
" <th>pH</th>\n",
" \n",
" <th>sulphates</th>\n",
" \n",
" <th>alcohol</th>\n",
" \n",
" <th>quality</th>\n",
" \n",
" </tr>\n",
" \n",
"\n",
" \n",
" <tr>\n",
" <td>1599</td>\n",
" \n",
" <td>white</td>\n",
" \n",
" <td>7</td>\n",
" \n",
" <td>0.27</td>\n",
" \n",
" <td>0.36</td>\n",
" \n",
" <td>20.7</td>\n",
" \n",
" <td>0.045</td>\n",
" \n",
" <td>45</td>\n",
" \n",
" <td>170</td>\n",
" \n",
" <td>1.001</td>\n",
" \n",
" <td>3</td>\n",
" \n",
" <td>0.45</td>\n",
" \n",
" <td>8.8</td>\n",
" \n",
" <td>6</td>\n",
" \n",
" </tr>\n",
" \n",
" <tr>\n",
" <td>1600</td>\n",
" \n",
" <td>white</td>\n",
" \n",
" <td>6.3</td>\n",
" \n",
" <td>0.3</td>\n",
" \n",
" <td>0.34</td>\n",
" \n",
" <td>1.6</td>\n",
" \n",
" <td>0.049</td>\n",
" \n",
" <td>14</td>\n",
" \n",
" <td>132</td>\n",
" \n",
" <td>0.994</td>\n",
" \n",
" <td>3.3</td>\n",
" \n",
" <td>0.49</td>\n",
" \n",
" <td>9.5</td>\n",
" \n",
" <td>6</td>\n",
" \n",
" </tr>\n",
" \n",
" <tr>\n",
" <td>1601</td>\n",
" \n",
" <td>white</td>\n",
" \n",
" <td>8.1</td>\n",
" \n",
" <td>0.28</td>\n",
" \n",
" <td>0.4</td>\n",
" \n",
" <td>6.9</td>\n",
" \n",
" <td>0.05</td>\n",
" \n",
" <td>30</td>\n",
" \n",
" <td>97</td>\n",
" \n",
" <td>0.9951</td>\n",
" \n",
" <td>3.26</td>\n",
" \n",
" <td>0.44</td>\n",
" \n",
" <td>10.1</td>\n",
" \n",
" <td>6</td>\n",
" \n",
" </tr>\n",
" \n",
" <tr>\n",
" <td>1602</td>\n",
" \n",
" <td>white</td>\n",
" \n",
" <td>7.2</td>\n",
" \n",
" <td>0.23</td>\n",
" \n",
" <td>0.32</td>\n",
" \n",
" <td>8.5</td>\n",
" \n",
" <td>0.058</td>\n",
" \n",
" <td>47</td>\n",
" \n",
" <td>186</td>\n",
" \n",
" <td>0.9956</td>\n",
" \n",
" <td>3.19</td>\n",
" \n",
" <td>0.4</td>\n",
" \n",
" <td>9.9</td>\n",
" \n",
" <td>6</td>\n",
" \n",
" </tr>\n",
" \n",
" <tr>\n",
" <td>1603</td>\n",
" \n",
" <td>white</td>\n",
" \n",
" <td>7.2</td>\n",
" \n",
" <td>0.23</td>\n",
" \n",
" <td>0.32</td>\n",
" \n",
" <td>8.5</td>\n",
" \n",
" <td>0.058</td>\n",
" \n",
" <td>47</td>\n",
" \n",
" <td>186</td>\n",
" \n",
" <td>0.9956</td>\n",
" \n",
" <td>3.19</td>\n",
" \n",
" <td>0.4</td>\n",
" \n",
" <td>9.9</td>\n",
" \n",
" <td>6</td>\n",
" \n",
" </tr>\n",
" \n",
" <tr>\n",
" <td>1604</td>\n",
" \n",
" <td>white</td>\n",
" \n",
" <td>8.1</td>\n",
" \n",
" <td>0.28</td>\n",
" \n",
" <td>0.4</td>\n",
" \n",
" <td>6.9</td>\n",
" \n",
" <td>0.05</td>\n",
" \n",
" <td>30</td>\n",
" \n",
" <td>97</td>\n",
" \n",
" <td>0.9951</td>\n",
" \n",
" <td>3.26</td>\n",
" \n",
" <td>0.44</td>\n",
" \n",
" <td>10.1</td>\n",
" \n",
" <td>6</td>\n",
" \n",
" </tr>\n",
" \n",
" <tr>\n",
" <td>1605</td>\n",
" \n",
" <td>white</td>\n",
" \n",
" <td>6.2</td>\n",
" \n",
" <td>0.32</td>\n",
" \n",
" <td>0.16</td>\n",
" \n",
" <td>7</td>\n",
" \n",
" <td>0.045</td>\n",
" \n",
" <td>30</td>\n",
" \n",
" <td>136</td>\n",
" \n",
" <td>0.9949</td>\n",
" \n",
" <td>3.18</td>\n",
" \n",
" <td>0.47</td>\n",
" \n",
" <td>9.6</td>\n",
" \n",
" <td>6</td>\n",
" \n",
" </tr>\n",
" \n",
" <tr>\n",
" <td>1606</td>\n",
" \n",
" <td>white</td>\n",
" \n",
" <td>7</td>\n",
" \n",
" <td>0.27</td>\n",
" \n",
" <td>0.36</td>\n",
" \n",
" <td>20.7</td>\n",
" \n",
" <td>0.045</td>\n",
" \n",
" <td>45</td>\n",
" \n",
" <td>170</td>\n",
" \n",
" <td>1.001</td>\n",
" \n",
" <td>3</td>\n",
" \n",
" <td>0.45</td>\n",
" \n",
" <td>8.8</td>\n",
" \n",
" <td>6</td>\n",
" \n",
" </tr>\n",
" \n",
" <tr>\n",
" <td>1607</td>\n",
" \n",
" <td>white</td>\n",
" \n",
" <td>6.3</td>\n",
" \n",
" <td>0.3</td>\n",
" \n",
" <td>0.34</td>\n",
" \n",
" <td>1.6</td>\n",
" \n",
" <td>0.049</td>\n",
" \n",
" <td>14</td>\n",
" \n",
" <td>132</td>\n",
" \n",
" <td>0.994</td>\n",
" \n",
" <td>3.3</td>\n",
" \n",
" <td>0.49</td>\n",
" \n",
" <td>9.5</td>\n",
" \n",
" <td>6</td>\n",
" \n",
" </tr>\n",
" \n",
" <tr>\n",
" <td>1608</td>\n",
" \n",
" <td>white</td>\n",
" \n",
" <td>8.1</td>\n",
" \n",
" <td>0.22</td>\n",
" \n",
" <td>0.43</td>\n",
" \n",
" <td>1.5</td>\n",
" \n",
" <td>0.044</td>\n",
" \n",
" <td>28</td>\n",
" \n",
" <td>129</td>\n",
" \n",
" <td>0.9938</td>\n",
" \n",
" <td>3.22</td>\n",
" \n",
" <td>0.45</td>\n",
" \n",
" <td>11</td>\n",
" \n",
" <td>6</td>\n",
" \n",
" </tr>\n",
" \n",
"\n",
" \n",
"</table>"
],
"text/plain": [
"#<Daru::DataFrame(10x13)>\n",
" type fixed acid volatile a citric aci residual s chlorides free sulfu total sulf density pH sulphates alcohol quality\n",
" 1599 white 7 0.27 0.36 20.7 0.045 45 170 1.001 3 0.45 8.8 6\n",
" 1600 white 6.3 0.3 0.34 1.6 0.049 14 132 0.994 3.3 0.49 9.5 6\n",
" 1601 white 8.1 0.28 0.4 6.9 0.05 30 97 0.9951 3.26 0.44 10.1 6\n",
" 1602 white 7.2 0.23 0.32 8.5 0.058 47 186 0.9956 3.19 0.4 9.9 6\n",
" 1603 white 7.2 0.23 0.32 8.5 0.058 47 186 0.9956 3.19 0.4 9.9 6\n",
" 1604 white 8.1 0.28 0.4 6.9 0.05 30 97 0.9951 3.26 0.44 10.1 6\n",
" 1605 white 6.2 0.32 0.16 7 0.045 30 136 0.9949 3.18 0.47 9.6 6\n",
" 1606 white 7 0.27 0.36 20.7 0.045 45 170 1.001 3 0.45 8.8 6\n",
" 1607 white 6.3 0.3 0.34 1.6 0.049 14 132 0.994 3.3 0.49 9.5 6\n",
" 1608 white 8.1 0.22 0.43 1.5 0.044 28 129 0.9938 3.22 0.45 11 6"
]
},
"execution_count": 8,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"whites = wine.where(wine['type'].eq('white'))\n",
"whites.head 10"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## qualityのヒストグラムを書く"
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"#<Plotly::Plot:0x007fd42165b3d0 @data=[], @layout=#<Plotly::Layout:0x007fd42165b2e0>>"
]
},
"execution_count": 9,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"red_quality = {\n",
" x: reds['quality'].to_a,\n",
" type: :histogram,\n",
" marker: {\n",
" color: 'red'\n",
" }\n",
"}\n",
"white_quality = {\n",
" x: whites['quality'].to_a,\n",
" type: :histogram,\n",
" marker: {\n",
" color: 'blue'\n",
" }\n",
"}\n",
"\n",
"Plotly::Plot.new()"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Ruby 2.3.2",
"language": "ruby",
"name": "ruby"
},
"language_info": {
"file_extension": ".rb",
"mimetype": "application/x-ruby",
"name": "ruby",
"version": "2.3.2"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment