2654 lines
118 KiB
Plaintext
2654 lines
118 KiB
Plaintext
{
|
||
"nbformat": 4,
|
||
"nbformat_minor": 0,
|
||
"metadata": {
|
||
"colab": {
|
||
"name": "IUM_1_434788.ipynb",
|
||
"provenance": [],
|
||
"collapsed_sections": [],
|
||
"toc_visible": true
|
||
},
|
||
"kernelspec": {
|
||
"name": "python3",
|
||
"display_name": "Python 3"
|
||
}
|
||
},
|
||
"cells": [
|
||
{
|
||
"cell_type": "markdown",
|
||
"metadata": {
|
||
"id": "shaFKPEixPn4"
|
||
},
|
||
"source": [
|
||
"# 1. Pobranie zbioru danych z Repozytorium"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"metadata": {
|
||
"colab": {
|
||
"base_uri": "https://localhost:8080/"
|
||
},
|
||
"id": "-03GDjWtxD7W",
|
||
"outputId": "4a000204-8cfd-43f2-a83d-a025bde4fa2c"
|
||
},
|
||
"source": [
|
||
"!curl -OL https://git.wmi.amu.edu.pl/s434788/ium_434788/raw/branch/master/winequality-red.csv"
|
||
],
|
||
"execution_count": 1,
|
||
"outputs": [
|
||
{
|
||
"output_type": "stream",
|
||
"text": [
|
||
" % Total % Received % Xferd Average Speed Time Time Time Current\n",
|
||
" Dload Upload Total Spent Left Speed\n",
|
||
"100 98k 0 98k 0 0 60997 0 --:--:-- 0:00:01 --:--:-- 60997\n"
|
||
],
|
||
"name": "stdout"
|
||
}
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"metadata": {
|
||
"colab": {
|
||
"base_uri": "https://localhost:8080/",
|
||
"height": 419
|
||
},
|
||
"id": "sAUNi0ylxWUm",
|
||
"outputId": "52b00ad4-b6e3-4d40-956d-242b29f90db1"
|
||
},
|
||
"source": [
|
||
"import pandas as pd\n",
|
||
"wine=pd.read_csv('winequality-red.csv')\n",
|
||
"wine"
|
||
],
|
||
"execution_count": 2,
|
||
"outputs": [
|
||
{
|
||
"output_type": "execute_result",
|
||
"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>fixed acidity</th>\n",
|
||
" <th>volatile acidity</th>\n",
|
||
" <th>citric acid</th>\n",
|
||
" <th>residual sugar</th>\n",
|
||
" <th>chlorides</th>\n",
|
||
" <th>free sulfur dioxide</th>\n",
|
||
" <th>total sulfur dioxide</th>\n",
|
||
" <th>density</th>\n",
|
||
" <th>pH</th>\n",
|
||
" <th>sulphates</th>\n",
|
||
" <th>alcohol</th>\n",
|
||
" <th>quality</th>\n",
|
||
" </tr>\n",
|
||
" </thead>\n",
|
||
" <tbody>\n",
|
||
" <tr>\n",
|
||
" <th>0</th>\n",
|
||
" <td>7.4</td>\n",
|
||
" <td>0.700</td>\n",
|
||
" <td>0.00</td>\n",
|
||
" <td>1.9</td>\n",
|
||
" <td>0.076</td>\n",
|
||
" <td>11.0</td>\n",
|
||
" <td>34.0</td>\n",
|
||
" <td>0.99780</td>\n",
|
||
" <td>3.51</td>\n",
|
||
" <td>0.56</td>\n",
|
||
" <td>9.4</td>\n",
|
||
" <td>5</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>1</th>\n",
|
||
" <td>7.8</td>\n",
|
||
" <td>0.880</td>\n",
|
||
" <td>0.00</td>\n",
|
||
" <td>2.6</td>\n",
|
||
" <td>0.098</td>\n",
|
||
" <td>25.0</td>\n",
|
||
" <td>67.0</td>\n",
|
||
" <td>0.99680</td>\n",
|
||
" <td>3.20</td>\n",
|
||
" <td>0.68</td>\n",
|
||
" <td>9.8</td>\n",
|
||
" <td>5</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>2</th>\n",
|
||
" <td>7.8</td>\n",
|
||
" <td>0.760</td>\n",
|
||
" <td>0.04</td>\n",
|
||
" <td>2.3</td>\n",
|
||
" <td>0.092</td>\n",
|
||
" <td>15.0</td>\n",
|
||
" <td>54.0</td>\n",
|
||
" <td>0.99700</td>\n",
|
||
" <td>3.26</td>\n",
|
||
" <td>0.65</td>\n",
|
||
" <td>9.8</td>\n",
|
||
" <td>5</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>3</th>\n",
|
||
" <td>11.2</td>\n",
|
||
" <td>0.280</td>\n",
|
||
" <td>0.56</td>\n",
|
||
" <td>1.9</td>\n",
|
||
" <td>0.075</td>\n",
|
||
" <td>17.0</td>\n",
|
||
" <td>60.0</td>\n",
|
||
" <td>0.99800</td>\n",
|
||
" <td>3.16</td>\n",
|
||
" <td>0.58</td>\n",
|
||
" <td>9.8</td>\n",
|
||
" <td>6</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>4</th>\n",
|
||
" <td>7.4</td>\n",
|
||
" <td>0.700</td>\n",
|
||
" <td>0.00</td>\n",
|
||
" <td>1.9</td>\n",
|
||
" <td>0.076</td>\n",
|
||
" <td>11.0</td>\n",
|
||
" <td>34.0</td>\n",
|
||
" <td>0.99780</td>\n",
|
||
" <td>3.51</td>\n",
|
||
" <td>0.56</td>\n",
|
||
" <td>9.4</td>\n",
|
||
" <td>5</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",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>1594</th>\n",
|
||
" <td>6.2</td>\n",
|
||
" <td>0.600</td>\n",
|
||
" <td>0.08</td>\n",
|
||
" <td>2.0</td>\n",
|
||
" <td>0.090</td>\n",
|
||
" <td>32.0</td>\n",
|
||
" <td>44.0</td>\n",
|
||
" <td>0.99490</td>\n",
|
||
" <td>3.45</td>\n",
|
||
" <td>0.58</td>\n",
|
||
" <td>10.5</td>\n",
|
||
" <td>5</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>1595</th>\n",
|
||
" <td>5.9</td>\n",
|
||
" <td>0.550</td>\n",
|
||
" <td>0.10</td>\n",
|
||
" <td>2.2</td>\n",
|
||
" <td>0.062</td>\n",
|
||
" <td>39.0</td>\n",
|
||
" <td>51.0</td>\n",
|
||
" <td>0.99512</td>\n",
|
||
" <td>3.52</td>\n",
|
||
" <td>0.76</td>\n",
|
||
" <td>11.2</td>\n",
|
||
" <td>6</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>1596</th>\n",
|
||
" <td>6.3</td>\n",
|
||
" <td>0.510</td>\n",
|
||
" <td>0.13</td>\n",
|
||
" <td>2.3</td>\n",
|
||
" <td>0.076</td>\n",
|
||
" <td>29.0</td>\n",
|
||
" <td>40.0</td>\n",
|
||
" <td>0.99574</td>\n",
|
||
" <td>3.42</td>\n",
|
||
" <td>0.75</td>\n",
|
||
" <td>11.0</td>\n",
|
||
" <td>6</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>1597</th>\n",
|
||
" <td>5.9</td>\n",
|
||
" <td>0.645</td>\n",
|
||
" <td>0.12</td>\n",
|
||
" <td>2.0</td>\n",
|
||
" <td>0.075</td>\n",
|
||
" <td>32.0</td>\n",
|
||
" <td>44.0</td>\n",
|
||
" <td>0.99547</td>\n",
|
||
" <td>3.57</td>\n",
|
||
" <td>0.71</td>\n",
|
||
" <td>10.2</td>\n",
|
||
" <td>5</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>1598</th>\n",
|
||
" <td>6.0</td>\n",
|
||
" <td>0.310</td>\n",
|
||
" <td>0.47</td>\n",
|
||
" <td>3.6</td>\n",
|
||
" <td>0.067</td>\n",
|
||
" <td>18.0</td>\n",
|
||
" <td>42.0</td>\n",
|
||
" <td>0.99549</td>\n",
|
||
" <td>3.39</td>\n",
|
||
" <td>0.66</td>\n",
|
||
" <td>11.0</td>\n",
|
||
" <td>6</td>\n",
|
||
" </tr>\n",
|
||
" </tbody>\n",
|
||
"</table>\n",
|
||
"<p>1599 rows × 12 columns</p>\n",
|
||
"</div>"
|
||
],
|
||
"text/plain": [
|
||
" fixed acidity volatile acidity citric acid ... sulphates alcohol quality\n",
|
||
"0 7.4 0.700 0.00 ... 0.56 9.4 5\n",
|
||
"1 7.8 0.880 0.00 ... 0.68 9.8 5\n",
|
||
"2 7.8 0.760 0.04 ... 0.65 9.8 5\n",
|
||
"3 11.2 0.280 0.56 ... 0.58 9.8 6\n",
|
||
"4 7.4 0.700 0.00 ... 0.56 9.4 5\n",
|
||
"... ... ... ... ... ... ... ...\n",
|
||
"1594 6.2 0.600 0.08 ... 0.58 10.5 5\n",
|
||
"1595 5.9 0.550 0.10 ... 0.76 11.2 6\n",
|
||
"1596 6.3 0.510 0.13 ... 0.75 11.0 6\n",
|
||
"1597 5.9 0.645 0.12 ... 0.71 10.2 5\n",
|
||
"1598 6.0 0.310 0.47 ... 0.66 11.0 6\n",
|
||
"\n",
|
||
"[1599 rows x 12 columns]"
|
||
]
|
||
},
|
||
"metadata": {
|
||
"tags": []
|
||
},
|
||
"execution_count": 2
|
||
}
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "markdown",
|
||
"metadata": {
|
||
"id": "4H-i6DJlxduP"
|
||
},
|
||
"source": [
|
||
"# 2. Podział na zbiory test/train przy pomocy SciKit"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"metadata": {
|
||
"id": "X88VMhb0x3gJ"
|
||
},
|
||
"source": [
|
||
"from sklearn.model_selection import train_test_split\n",
|
||
"\n",
|
||
"wine_train, wine_test = train_test_split(wine, test_size=360,train_size=959, random_state=1)"
|
||
],
|
||
"execution_count": 3,
|
||
"outputs": []
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"metadata": {
|
||
"colab": {
|
||
"base_uri": "https://localhost:8080/"
|
||
},
|
||
"id": "OzjEfgNOyAWs",
|
||
"outputId": "39aeff13-72b4-4a88-fc0d-97a8456fc86b"
|
||
},
|
||
"source": [
|
||
"wine_test[\"quality\"].value_counts()"
|
||
],
|
||
"execution_count": 4,
|
||
"outputs": [
|
||
{
|
||
"output_type": "execute_result",
|
||
"data": {
|
||
"text/plain": [
|
||
"5 155\n",
|
||
"6 149\n",
|
||
"7 37\n",
|
||
"4 16\n",
|
||
"8 2\n",
|
||
"3 1\n",
|
||
"Name: quality, dtype: int64"
|
||
]
|
||
},
|
||
"metadata": {
|
||
"tags": []
|
||
},
|
||
"execution_count": 4
|
||
}
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"metadata": {
|
||
"colab": {
|
||
"base_uri": "https://localhost:8080/"
|
||
},
|
||
"id": "SpQZIuSxyAd0",
|
||
"outputId": "76cfa3e6-18ff-460e-f954-fc3ad9e8d3ae"
|
||
},
|
||
"source": [
|
||
"wine_train[\"quality\"].value_counts()"
|
||
],
|
||
"execution_count": 5,
|
||
"outputs": [
|
||
{
|
||
"output_type": "execute_result",
|
||
"data": {
|
||
"text/plain": [
|
||
"5 400\n",
|
||
"6 388\n",
|
||
"7 125\n",
|
||
"4 30\n",
|
||
"8 11\n",
|
||
"3 5\n",
|
||
"Name: quality, dtype: int64"
|
||
]
|
||
},
|
||
"metadata": {
|
||
"tags": []
|
||
},
|
||
"execution_count": 5
|
||
}
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "markdown",
|
||
"metadata": {
|
||
"id": "wAq8KmNdyNOm"
|
||
},
|
||
"source": [
|
||
"# 3. Statystyki dla zbior"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"metadata": {
|
||
"id": "Wcq9YSTfXbs1"
|
||
},
|
||
"source": [
|
||
"from matplotlib import pyplot as plt\n",
|
||
"import seaborn as sns"
|
||
],
|
||
"execution_count": 6,
|
||
"outputs": []
|
||
},
|
||
{
|
||
"cell_type": "markdown",
|
||
"metadata": {
|
||
"id": "EjDFpgdPy_of"
|
||
},
|
||
"source": [
|
||
"## 3.1. Zbiór Train"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"metadata": {
|
||
"colab": {
|
||
"base_uri": "https://localhost:8080/",
|
||
"height": 419
|
||
},
|
||
"id": "SscUak3AydG0",
|
||
"outputId": "71c407d9-388a-4528-cbf6-f34a8aa23c23"
|
||
},
|
||
"source": [
|
||
"wine_train"
|
||
],
|
||
"execution_count": 7,
|
||
"outputs": [
|
||
{
|
||
"output_type": "execute_result",
|
||
"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>fixed acidity</th>\n",
|
||
" <th>volatile acidity</th>\n",
|
||
" <th>citric acid</th>\n",
|
||
" <th>residual sugar</th>\n",
|
||
" <th>chlorides</th>\n",
|
||
" <th>free sulfur dioxide</th>\n",
|
||
" <th>total sulfur dioxide</th>\n",
|
||
" <th>density</th>\n",
|
||
" <th>pH</th>\n",
|
||
" <th>sulphates</th>\n",
|
||
" <th>alcohol</th>\n",
|
||
" <th>quality</th>\n",
|
||
" </tr>\n",
|
||
" </thead>\n",
|
||
" <tbody>\n",
|
||
" <tr>\n",
|
||
" <th>1589</th>\n",
|
||
" <td>6.6</td>\n",
|
||
" <td>0.725</td>\n",
|
||
" <td>0.20</td>\n",
|
||
" <td>7.8</td>\n",
|
||
" <td>0.073</td>\n",
|
||
" <td>29.0</td>\n",
|
||
" <td>79.0</td>\n",
|
||
" <td>0.99770</td>\n",
|
||
" <td>3.29</td>\n",
|
||
" <td>0.54</td>\n",
|
||
" <td>9.2</td>\n",
|
||
" <td>5</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>854</th>\n",
|
||
" <td>9.3</td>\n",
|
||
" <td>0.360</td>\n",
|
||
" <td>0.39</td>\n",
|
||
" <td>1.5</td>\n",
|
||
" <td>0.080</td>\n",
|
||
" <td>41.0</td>\n",
|
||
" <td>55.0</td>\n",
|
||
" <td>0.99652</td>\n",
|
||
" <td>3.47</td>\n",
|
||
" <td>0.73</td>\n",
|
||
" <td>10.9</td>\n",
|
||
" <td>6</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>83</th>\n",
|
||
" <td>7.3</td>\n",
|
||
" <td>0.670</td>\n",
|
||
" <td>0.26</td>\n",
|
||
" <td>1.8</td>\n",
|
||
" <td>0.401</td>\n",
|
||
" <td>16.0</td>\n",
|
||
" <td>51.0</td>\n",
|
||
" <td>0.99690</td>\n",
|
||
" <td>3.16</td>\n",
|
||
" <td>1.14</td>\n",
|
||
" <td>9.4</td>\n",
|
||
" <td>5</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>1106</th>\n",
|
||
" <td>8.2</td>\n",
|
||
" <td>0.230</td>\n",
|
||
" <td>0.42</td>\n",
|
||
" <td>1.9</td>\n",
|
||
" <td>0.069</td>\n",
|
||
" <td>9.0</td>\n",
|
||
" <td>17.0</td>\n",
|
||
" <td>0.99376</td>\n",
|
||
" <td>3.21</td>\n",
|
||
" <td>0.54</td>\n",
|
||
" <td>12.3</td>\n",
|
||
" <td>6</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>650</th>\n",
|
||
" <td>10.7</td>\n",
|
||
" <td>0.430</td>\n",
|
||
" <td>0.39</td>\n",
|
||
" <td>2.2</td>\n",
|
||
" <td>0.106</td>\n",
|
||
" <td>8.0</td>\n",
|
||
" <td>32.0</td>\n",
|
||
" <td>0.99860</td>\n",
|
||
" <td>2.89</td>\n",
|
||
" <td>0.50</td>\n",
|
||
" <td>9.6</td>\n",
|
||
" <td>5</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",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>526</th>\n",
|
||
" <td>7.3</td>\n",
|
||
" <td>0.365</td>\n",
|
||
" <td>0.49</td>\n",
|
||
" <td>2.5</td>\n",
|
||
" <td>0.088</td>\n",
|
||
" <td>39.0</td>\n",
|
||
" <td>106.0</td>\n",
|
||
" <td>0.99660</td>\n",
|
||
" <td>3.36</td>\n",
|
||
" <td>0.78</td>\n",
|
||
" <td>11.0</td>\n",
|
||
" <td>5</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>583</th>\n",
|
||
" <td>12.0</td>\n",
|
||
" <td>0.280</td>\n",
|
||
" <td>0.49</td>\n",
|
||
" <td>1.9</td>\n",
|
||
" <td>0.074</td>\n",
|
||
" <td>10.0</td>\n",
|
||
" <td>21.0</td>\n",
|
||
" <td>0.99760</td>\n",
|
||
" <td>2.98</td>\n",
|
||
" <td>0.66</td>\n",
|
||
" <td>9.9</td>\n",
|
||
" <td>7</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>975</th>\n",
|
||
" <td>7.2</td>\n",
|
||
" <td>0.410</td>\n",
|
||
" <td>0.30</td>\n",
|
||
" <td>2.1</td>\n",
|
||
" <td>0.083</td>\n",
|
||
" <td>35.0</td>\n",
|
||
" <td>72.0</td>\n",
|
||
" <td>0.99700</td>\n",
|
||
" <td>3.44</td>\n",
|
||
" <td>0.52</td>\n",
|
||
" <td>9.4</td>\n",
|
||
" <td>5</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>566</th>\n",
|
||
" <td>8.7</td>\n",
|
||
" <td>0.700</td>\n",
|
||
" <td>0.24</td>\n",
|
||
" <td>2.5</td>\n",
|
||
" <td>0.226</td>\n",
|
||
" <td>5.0</td>\n",
|
||
" <td>15.0</td>\n",
|
||
" <td>0.99910</td>\n",
|
||
" <td>3.32</td>\n",
|
||
" <td>0.60</td>\n",
|
||
" <td>9.0</td>\n",
|
||
" <td>6</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>1232</th>\n",
|
||
" <td>7.6</td>\n",
|
||
" <td>0.430</td>\n",
|
||
" <td>0.29</td>\n",
|
||
" <td>2.1</td>\n",
|
||
" <td>0.075</td>\n",
|
||
" <td>19.0</td>\n",
|
||
" <td>66.0</td>\n",
|
||
" <td>0.99718</td>\n",
|
||
" <td>3.40</td>\n",
|
||
" <td>0.64</td>\n",
|
||
" <td>9.5</td>\n",
|
||
" <td>5</td>\n",
|
||
" </tr>\n",
|
||
" </tbody>\n",
|
||
"</table>\n",
|
||
"<p>959 rows × 12 columns</p>\n",
|
||
"</div>"
|
||
],
|
||
"text/plain": [
|
||
" fixed acidity volatile acidity citric acid ... sulphates alcohol quality\n",
|
||
"1589 6.6 0.725 0.20 ... 0.54 9.2 5\n",
|
||
"854 9.3 0.360 0.39 ... 0.73 10.9 6\n",
|
||
"83 7.3 0.670 0.26 ... 1.14 9.4 5\n",
|
||
"1106 8.2 0.230 0.42 ... 0.54 12.3 6\n",
|
||
"650 10.7 0.430 0.39 ... 0.50 9.6 5\n",
|
||
"... ... ... ... ... ... ... ...\n",
|
||
"526 7.3 0.365 0.49 ... 0.78 11.0 5\n",
|
||
"583 12.0 0.280 0.49 ... 0.66 9.9 7\n",
|
||
"975 7.2 0.410 0.30 ... 0.52 9.4 5\n",
|
||
"566 8.7 0.700 0.24 ... 0.60 9.0 6\n",
|
||
"1232 7.6 0.430 0.29 ... 0.64 9.5 5\n",
|
||
"\n",
|
||
"[959 rows x 12 columns]"
|
||
]
|
||
},
|
||
"metadata": {
|
||
"tags": []
|
||
},
|
||
"execution_count": 7
|
||
}
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"metadata": {
|
||
"colab": {
|
||
"base_uri": "https://localhost:8080/"
|
||
},
|
||
"id": "hZAn8j4byMF2",
|
||
"outputId": "f0b9e807-8058-4c00-8276-5bbfc50efea8"
|
||
},
|
||
"source": [
|
||
"wine_train[\"quality\"].value_counts()"
|
||
],
|
||
"execution_count": 8,
|
||
"outputs": [
|
||
{
|
||
"output_type": "execute_result",
|
||
"data": {
|
||
"text/plain": [
|
||
"5 400\n",
|
||
"6 388\n",
|
||
"7 125\n",
|
||
"4 30\n",
|
||
"8 11\n",
|
||
"3 5\n",
|
||
"Name: quality, dtype: int64"
|
||
]
|
||
},
|
||
"metadata": {
|
||
"tags": []
|
||
},
|
||
"execution_count": 8
|
||
}
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"metadata": {
|
||
"colab": {
|
||
"base_uri": "https://localhost:8080/",
|
||
"height": 297
|
||
},
|
||
"id": "EOEuj8sRyL8v",
|
||
"outputId": "0e2a980b-5a28-4ea0-e1f5-f33d93499525"
|
||
},
|
||
"source": [
|
||
"wine_train.describe(include='all')"
|
||
],
|
||
"execution_count": 9,
|
||
"outputs": [
|
||
{
|
||
"output_type": "execute_result",
|
||
"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>fixed acidity</th>\n",
|
||
" <th>volatile acidity</th>\n",
|
||
" <th>citric acid</th>\n",
|
||
" <th>residual sugar</th>\n",
|
||
" <th>chlorides</th>\n",
|
||
" <th>free sulfur dioxide</th>\n",
|
||
" <th>total sulfur dioxide</th>\n",
|
||
" <th>density</th>\n",
|
||
" <th>pH</th>\n",
|
||
" <th>sulphates</th>\n",
|
||
" <th>alcohol</th>\n",
|
||
" <th>quality</th>\n",
|
||
" </tr>\n",
|
||
" </thead>\n",
|
||
" <tbody>\n",
|
||
" <tr>\n",
|
||
" <th>count</th>\n",
|
||
" <td>959.000000</td>\n",
|
||
" <td>959.000000</td>\n",
|
||
" <td>959.000000</td>\n",
|
||
" <td>959.000000</td>\n",
|
||
" <td>959.000000</td>\n",
|
||
" <td>959.000000</td>\n",
|
||
" <td>959.000000</td>\n",
|
||
" <td>959.000000</td>\n",
|
||
" <td>959.00000</td>\n",
|
||
" <td>959.000000</td>\n",
|
||
" <td>959.000000</td>\n",
|
||
" <td>959.000000</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>mean</th>\n",
|
||
" <td>8.329093</td>\n",
|
||
" <td>0.526809</td>\n",
|
||
" <td>0.269864</td>\n",
|
||
" <td>2.493743</td>\n",
|
||
" <td>0.088230</td>\n",
|
||
" <td>15.883733</td>\n",
|
||
" <td>45.738790</td>\n",
|
||
" <td>0.996736</td>\n",
|
||
" <td>3.31048</td>\n",
|
||
" <td>0.661481</td>\n",
|
||
" <td>10.433160</td>\n",
|
||
" <td>5.657977</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>std</th>\n",
|
||
" <td>1.808394</td>\n",
|
||
" <td>0.175221</td>\n",
|
||
" <td>0.198377</td>\n",
|
||
" <td>1.262329</td>\n",
|
||
" <td>0.050555</td>\n",
|
||
" <td>10.485739</td>\n",
|
||
" <td>31.897095</td>\n",
|
||
" <td>0.001925</td>\n",
|
||
" <td>0.15462</td>\n",
|
||
" <td>0.171639</td>\n",
|
||
" <td>1.084349</td>\n",
|
||
" <td>0.805654</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>min</th>\n",
|
||
" <td>4.600000</td>\n",
|
||
" <td>0.120000</td>\n",
|
||
" <td>0.000000</td>\n",
|
||
" <td>0.900000</td>\n",
|
||
" <td>0.012000</td>\n",
|
||
" <td>1.000000</td>\n",
|
||
" <td>6.000000</td>\n",
|
||
" <td>0.990070</td>\n",
|
||
" <td>2.74000</td>\n",
|
||
" <td>0.370000</td>\n",
|
||
" <td>8.400000</td>\n",
|
||
" <td>3.000000</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>25%</th>\n",
|
||
" <td>7.100000</td>\n",
|
||
" <td>0.400000</td>\n",
|
||
" <td>0.090000</td>\n",
|
||
" <td>1.900000</td>\n",
|
||
" <td>0.070000</td>\n",
|
||
" <td>7.000000</td>\n",
|
||
" <td>22.000000</td>\n",
|
||
" <td>0.995540</td>\n",
|
||
" <td>3.21000</td>\n",
|
||
" <td>0.550000</td>\n",
|
||
" <td>9.500000</td>\n",
|
||
" <td>5.000000</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>50%</th>\n",
|
||
" <td>7.900000</td>\n",
|
||
" <td>0.520000</td>\n",
|
||
" <td>0.250000</td>\n",
|
||
" <td>2.200000</td>\n",
|
||
" <td>0.079000</td>\n",
|
||
" <td>14.000000</td>\n",
|
||
" <td>37.000000</td>\n",
|
||
" <td>0.996770</td>\n",
|
||
" <td>3.31000</td>\n",
|
||
" <td>0.620000</td>\n",
|
||
" <td>10.100000</td>\n",
|
||
" <td>6.000000</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>75%</th>\n",
|
||
" <td>9.300000</td>\n",
|
||
" <td>0.635000</td>\n",
|
||
" <td>0.430000</td>\n",
|
||
" <td>2.600000</td>\n",
|
||
" <td>0.090000</td>\n",
|
||
" <td>22.000000</td>\n",
|
||
" <td>61.000000</td>\n",
|
||
" <td>0.997870</td>\n",
|
||
" <td>3.40000</td>\n",
|
||
" <td>0.730000</td>\n",
|
||
" <td>11.100000</td>\n",
|
||
" <td>6.000000</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>max</th>\n",
|
||
" <td>15.900000</td>\n",
|
||
" <td>1.330000</td>\n",
|
||
" <td>1.000000</td>\n",
|
||
" <td>15.400000</td>\n",
|
||
" <td>0.610000</td>\n",
|
||
" <td>72.000000</td>\n",
|
||
" <td>278.000000</td>\n",
|
||
" <td>1.003690</td>\n",
|
||
" <td>4.01000</td>\n",
|
||
" <td>2.000000</td>\n",
|
||
" <td>14.900000</td>\n",
|
||
" <td>8.000000</td>\n",
|
||
" </tr>\n",
|
||
" </tbody>\n",
|
||
"</table>\n",
|
||
"</div>"
|
||
],
|
||
"text/plain": [
|
||
" fixed acidity volatile acidity ... alcohol quality\n",
|
||
"count 959.000000 959.000000 ... 959.000000 959.000000\n",
|
||
"mean 8.329093 0.526809 ... 10.433160 5.657977\n",
|
||
"std 1.808394 0.175221 ... 1.084349 0.805654\n",
|
||
"min 4.600000 0.120000 ... 8.400000 3.000000\n",
|
||
"25% 7.100000 0.400000 ... 9.500000 5.000000\n",
|
||
"50% 7.900000 0.520000 ... 10.100000 6.000000\n",
|
||
"75% 9.300000 0.635000 ... 11.100000 6.000000\n",
|
||
"max 15.900000 1.330000 ... 14.900000 8.000000\n",
|
||
"\n",
|
||
"[8 rows x 12 columns]"
|
||
]
|
||
},
|
||
"metadata": {
|
||
"tags": []
|
||
},
|
||
"execution_count": 9
|
||
}
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"metadata": {
|
||
"colab": {
|
||
"base_uri": "https://localhost:8080/",
|
||
"height": 405
|
||
},
|
||
"id": "HbsfwCL7XpNe",
|
||
"outputId": "8bfc8dbc-d2d8-447b-991c-617d8196a7de"
|
||
},
|
||
"source": [
|
||
"fig = plt.figure(figsize = (10,6))\n",
|
||
"sns.barplot(x = 'quality', y = 'volatile acidity', data = wine)"
|
||
],
|
||
"execution_count": 10,
|
||
"outputs": [
|
||
{
|
||
"output_type": "execute_result",
|
||
"data": {
|
||
"text/plain": [
|
||
"<matplotlib.axes._subplots.AxesSubplot at 0x7f24136185d0>"
|
||
]
|
||
},
|
||
"metadata": {
|
||
"tags": []
|
||
},
|
||
"execution_count": 10
|
||
},
|
||
{
|
||
"output_type": "display_data",
|
||
"data": {
|
||
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAmEAAAFzCAYAAAB2A95GAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4yLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+WH4yJAAAYxklEQVR4nO3de5BmZ10n8O8vM8RANlx0Zh1Ngsm6ATcqAo4RjQIloAlisougiQso5RLdJcpFmYJiCwXdrXWA9Yq6WRTxRgxZ0OAOhlVuihIzgXANWGMgZEbaTEDuYEjy2z/6Hex0Znp6kjn99Lz9+VR1ve855+nzfvNWKvn2c27V3QEAYG0dNzoAAMBGpIQBAAyghAEADKCEAQAMoIQBAAyghAEADLB5dIAjtWXLlj7ttNNGxwAAOKxrrrnm5u7eerBtx1wJO+2007J79+7RMQAADquqbjjUNocjAQAGUMIAAAZQwgAABlDCAAAGUMIAAAZQw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q+lBV3WM27t5LlwFWy0wYcMyrqm/O4iOqHpzF/669I8lKD3C/KcljuvsLVXVGFh9Bs/1gA7v7w1X1m0k+090vmX3em5N8b5I/nn3ua2bPtQNYNTNhwDz4ziSv7e7PdfenklxxmPH3SPK/q+o9SV6d5Mwj/LyX518eEfTUJK84wt8HMBMGzLVb8y9/bJ6wZP2zkvxjkm+abf/Ckey0u982O6T5yCSbutvDyoEjZiYMmAdvTfLvq+qeVXVSku+brf9wkm+evX/CkvH3SfLR7r49yZOTbDrM/j+d5KRl6343yR/GLBhwFylhwDGvu9+R5I+SvCvJ65NcPdv0kiT/uaremWTLkl/59SQ/XFXvSvJ1ST57mI94XZL/cODE/Nm6P0hyvyyeTwZwxKq7R2cAOKqq6mez5ET6iT7jCUnO7+4nT/UZwHxzThjAEaqqX01ybpLHjs4CHLvMhAEADOCcMACAAZQwAIABlDAAgAGUMACAAZQwAIABlDAAgAH+P8QchNlEr4FQAAAAAElFTkSuQmCC\n",
|
||
"text/plain": [
|
||
"<Figure size 720x432 with 1 Axes>"
|
||
]
|
||
},
|
||
"metadata": {
|
||
"tags": [],
|
||
"needs_background": "light"
|
||
}
|
||
}
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "markdown",
|
||
"metadata": {
|
||
"id": "1W_oRCVczIgJ"
|
||
},
|
||
"source": [
|
||
"## 3.2. Zbiór Test"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"metadata": {
|
||
"colab": {
|
||
"base_uri": "https://localhost:8080/",
|
||
"height": 419
|
||
},
|
||
"id": "LJzygNqKzOWY",
|
||
"outputId": "ad080f20-e3b3-4078-ad6a-3829cbe3829f"
|
||
},
|
||
"source": [
|
||
"wine_test"
|
||
],
|
||
"execution_count": 11,
|
||
"outputs": [
|
||
{
|
||
"output_type": "execute_result",
|
||
"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>fixed acidity</th>\n",
|
||
" <th>volatile acidity</th>\n",
|
||
" <th>citric acid</th>\n",
|
||
" <th>residual sugar</th>\n",
|
||
" <th>chlorides</th>\n",
|
||
" <th>free sulfur dioxide</th>\n",
|
||
" <th>total sulfur dioxide</th>\n",
|
||
" <th>density</th>\n",
|
||
" <th>pH</th>\n",
|
||
" <th>sulphates</th>\n",
|
||
" <th>alcohol</th>\n",
|
||
" <th>quality</th>\n",
|
||
" </tr>\n",
|
||
" </thead>\n",
|
||
" <tbody>\n",
|
||
" <tr>\n",
|
||
" <th>75</th>\n",
|
||
" <td>8.8</td>\n",
|
||
" <td>0.410</td>\n",
|
||
" <td>0.64</td>\n",
|
||
" <td>2.2</td>\n",
|
||
" <td>0.093</td>\n",
|
||
" <td>9.0</td>\n",
|
||
" <td>42.0</td>\n",
|
||
" <td>0.99860</td>\n",
|
||
" <td>3.54</td>\n",
|
||
" <td>0.66</td>\n",
|
||
" <td>10.5</td>\n",
|
||
" <td>5</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>1283</th>\n",
|
||
" <td>8.7</td>\n",
|
||
" <td>0.630</td>\n",
|
||
" <td>0.28</td>\n",
|
||
" <td>2.7</td>\n",
|
||
" <td>0.096</td>\n",
|
||
" <td>17.0</td>\n",
|
||
" <td>69.0</td>\n",
|
||
" <td>0.99734</td>\n",
|
||
" <td>3.26</td>\n",
|
||
" <td>0.63</td>\n",
|
||
" <td>10.2</td>\n",
|
||
" <td>6</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>408</th>\n",
|
||
" <td>10.4</td>\n",
|
||
" <td>0.340</td>\n",
|
||
" <td>0.58</td>\n",
|
||
" <td>3.7</td>\n",
|
||
" <td>0.174</td>\n",
|
||
" <td>6.0</td>\n",
|
||
" <td>16.0</td>\n",
|
||
" <td>0.99700</td>\n",
|
||
" <td>3.19</td>\n",
|
||
" <td>0.70</td>\n",
|
||
" <td>11.3</td>\n",
|
||
" <td>6</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>1281</th>\n",
|
||
" <td>7.1</td>\n",
|
||
" <td>0.460</td>\n",
|
||
" <td>0.20</td>\n",
|
||
" <td>1.9</td>\n",
|
||
" <td>0.077</td>\n",
|
||
" <td>28.0</td>\n",
|
||
" <td>54.0</td>\n",
|
||
" <td>0.99560</td>\n",
|
||
" <td>3.37</td>\n",
|
||
" <td>0.64</td>\n",
|
||
" <td>10.4</td>\n",
|
||
" <td>6</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>1118</th>\n",
|
||
" <td>7.1</td>\n",
|
||
" <td>0.390</td>\n",
|
||
" <td>0.12</td>\n",
|
||
" <td>2.1</td>\n",
|
||
" <td>0.065</td>\n",
|
||
" <td>14.0</td>\n",
|
||
" <td>24.0</td>\n",
|
||
" <td>0.99252</td>\n",
|
||
" <td>3.30</td>\n",
|
||
" <td>0.53</td>\n",
|
||
" <td>13.3</td>\n",
|
||
" <td>6</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",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>1461</th>\n",
|
||
" <td>6.2</td>\n",
|
||
" <td>0.785</td>\n",
|
||
" <td>0.00</td>\n",
|
||
" <td>2.1</td>\n",
|
||
" <td>0.060</td>\n",
|
||
" <td>6.0</td>\n",
|
||
" <td>13.0</td>\n",
|
||
" <td>0.99664</td>\n",
|
||
" <td>3.59</td>\n",
|
||
" <td>0.61</td>\n",
|
||
" <td>10.0</td>\n",
|
||
" <td>4</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>1016</th>\n",
|
||
" <td>8.9</td>\n",
|
||
" <td>0.380</td>\n",
|
||
" <td>0.40</td>\n",
|
||
" <td>2.2</td>\n",
|
||
" <td>0.068</td>\n",
|
||
" <td>12.0</td>\n",
|
||
" <td>28.0</td>\n",
|
||
" <td>0.99486</td>\n",
|
||
" <td>3.27</td>\n",
|
||
" <td>0.75</td>\n",
|
||
" <td>12.6</td>\n",
|
||
" <td>7</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>1412</th>\n",
|
||
" <td>8.2</td>\n",
|
||
" <td>0.240</td>\n",
|
||
" <td>0.34</td>\n",
|
||
" <td>5.1</td>\n",
|
||
" <td>0.062</td>\n",
|
||
" <td>8.0</td>\n",
|
||
" <td>22.0</td>\n",
|
||
" <td>0.99740</td>\n",
|
||
" <td>3.22</td>\n",
|
||
" <td>0.94</td>\n",
|
||
" <td>10.9</td>\n",
|
||
" <td>6</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>424</th>\n",
|
||
" <td>7.7</td>\n",
|
||
" <td>0.960</td>\n",
|
||
" <td>0.20</td>\n",
|
||
" <td>2.0</td>\n",
|
||
" <td>0.047</td>\n",
|
||
" <td>15.0</td>\n",
|
||
" <td>60.0</td>\n",
|
||
" <td>0.99550</td>\n",
|
||
" <td>3.36</td>\n",
|
||
" <td>0.44</td>\n",
|
||
" <td>10.9</td>\n",
|
||
" <td>5</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>120</th>\n",
|
||
" <td>7.3</td>\n",
|
||
" <td>1.070</td>\n",
|
||
" <td>0.09</td>\n",
|
||
" <td>1.7</td>\n",
|
||
" <td>0.178</td>\n",
|
||
" <td>10.0</td>\n",
|
||
" <td>89.0</td>\n",
|
||
" <td>0.99620</td>\n",
|
||
" <td>3.30</td>\n",
|
||
" <td>0.57</td>\n",
|
||
" <td>9.0</td>\n",
|
||
" <td>5</td>\n",
|
||
" </tr>\n",
|
||
" </tbody>\n",
|
||
"</table>\n",
|
||
"<p>360 rows × 12 columns</p>\n",
|
||
"</div>"
|
||
],
|
||
"text/plain": [
|
||
" fixed acidity volatile acidity citric acid ... sulphates alcohol quality\n",
|
||
"75 8.8 0.410 0.64 ... 0.66 10.5 5\n",
|
||
"1283 8.7 0.630 0.28 ... 0.63 10.2 6\n",
|
||
"408 10.4 0.340 0.58 ... 0.70 11.3 6\n",
|
||
"1281 7.1 0.460 0.20 ... 0.64 10.4 6\n",
|
||
"1118 7.1 0.390 0.12 ... 0.53 13.3 6\n",
|
||
"... ... ... ... ... ... ... ...\n",
|
||
"1461 6.2 0.785 0.00 ... 0.61 10.0 4\n",
|
||
"1016 8.9 0.380 0.40 ... 0.75 12.6 7\n",
|
||
"1412 8.2 0.240 0.34 ... 0.94 10.9 6\n",
|
||
"424 7.7 0.960 0.20 ... 0.44 10.9 5\n",
|
||
"120 7.3 1.070 0.09 ... 0.57 9.0 5\n",
|
||
"\n",
|
||
"[360 rows x 12 columns]"
|
||
]
|
||
},
|
||
"metadata": {
|
||
"tags": []
|
||
},
|
||
"execution_count": 11
|
||
}
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"metadata": {
|
||
"colab": {
|
||
"base_uri": "https://localhost:8080/"
|
||
},
|
||
"id": "1IAtBylEzS8w",
|
||
"outputId": "c7e29abc-1e4b-41ef-8a2e-6185ac8180fe"
|
||
},
|
||
"source": [
|
||
"wine_test[\"quality\"].value_counts()"
|
||
],
|
||
"execution_count": 12,
|
||
"outputs": [
|
||
{
|
||
"output_type": "execute_result",
|
||
"data": {
|
||
"text/plain": [
|
||
"5 155\n",
|
||
"6 149\n",
|
||
"7 37\n",
|
||
"4 16\n",
|
||
"8 2\n",
|
||
"3 1\n",
|
||
"Name: quality, dtype: int64"
|
||
]
|
||
},
|
||
"metadata": {
|
||
"tags": []
|
||
},
|
||
"execution_count": 12
|
||
}
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"metadata": {
|
||
"colab": {
|
||
"base_uri": "https://localhost:8080/",
|
||
"height": 297
|
||
},
|
||
"id": "V-9cwcrczS-3",
|
||
"outputId": "93893d4d-4dca-4e15-8dd3-c16aa7414462"
|
||
},
|
||
"source": [
|
||
"wine_test.describe(include='all')"
|
||
],
|
||
"execution_count": 13,
|
||
"outputs": [
|
||
{
|
||
"output_type": "execute_result",
|
||
"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>fixed acidity</th>\n",
|
||
" <th>volatile acidity</th>\n",
|
||
" <th>citric acid</th>\n",
|
||
" <th>residual sugar</th>\n",
|
||
" <th>chlorides</th>\n",
|
||
" <th>free sulfur dioxide</th>\n",
|
||
" <th>total sulfur dioxide</th>\n",
|
||
" <th>density</th>\n",
|
||
" <th>pH</th>\n",
|
||
" <th>sulphates</th>\n",
|
||
" <th>alcohol</th>\n",
|
||
" <th>quality</th>\n",
|
||
" </tr>\n",
|
||
" </thead>\n",
|
||
" <tbody>\n",
|
||
" <tr>\n",
|
||
" <th>count</th>\n",
|
||
" <td>360.000000</td>\n",
|
||
" <td>360.000000</td>\n",
|
||
" <td>360.000000</td>\n",
|
||
" <td>360.000000</td>\n",
|
||
" <td>360.000000</td>\n",
|
||
" <td>360.000000</td>\n",
|
||
" <td>360.000000</td>\n",
|
||
" <td>360.000000</td>\n",
|
||
" <td>360.000000</td>\n",
|
||
" <td>360.000000</td>\n",
|
||
" <td>360.000000</td>\n",
|
||
" <td>360.000000</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>mean</th>\n",
|
||
" <td>8.348611</td>\n",
|
||
" <td>0.518764</td>\n",
|
||
" <td>0.275444</td>\n",
|
||
" <td>2.542222</td>\n",
|
||
" <td>0.086114</td>\n",
|
||
" <td>16.093056</td>\n",
|
||
" <td>48.777778</td>\n",
|
||
" <td>0.996747</td>\n",
|
||
" <td>3.301083</td>\n",
|
||
" <td>0.653833</td>\n",
|
||
" <td>10.368889</td>\n",
|
||
" <td>5.586111</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>std</th>\n",
|
||
" <td>1.580574</td>\n",
|
||
" <td>0.182554</td>\n",
|
||
" <td>0.182508</td>\n",
|
||
" <td>1.528465</td>\n",
|
||
" <td>0.043445</td>\n",
|
||
" <td>10.421097</td>\n",
|
||
" <td>35.005778</td>\n",
|
||
" <td>0.001792</td>\n",
|
||
" <td>0.145379</td>\n",
|
||
" <td>0.168306</td>\n",
|
||
" <td>1.041729</td>\n",
|
||
" <td>0.767245</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>min</th>\n",
|
||
" <td>5.000000</td>\n",
|
||
" <td>0.120000</td>\n",
|
||
" <td>0.000000</td>\n",
|
||
" <td>0.900000</td>\n",
|
||
" <td>0.042000</td>\n",
|
||
" <td>3.000000</td>\n",
|
||
" <td>6.000000</td>\n",
|
||
" <td>0.990070</td>\n",
|
||
" <td>2.870000</td>\n",
|
||
" <td>0.370000</td>\n",
|
||
" <td>8.700000</td>\n",
|
||
" <td>3.000000</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>25%</th>\n",
|
||
" <td>7.200000</td>\n",
|
||
" <td>0.380000</td>\n",
|
||
" <td>0.120000</td>\n",
|
||
" <td>1.900000</td>\n",
|
||
" <td>0.070000</td>\n",
|
||
" <td>8.000000</td>\n",
|
||
" <td>23.000000</td>\n",
|
||
" <td>0.995760</td>\n",
|
||
" <td>3.210000</td>\n",
|
||
" <td>0.550000</td>\n",
|
||
" <td>9.500000</td>\n",
|
||
" <td>5.000000</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>50%</th>\n",
|
||
" <td>8.000000</td>\n",
|
||
" <td>0.500000</td>\n",
|
||
" <td>0.270000</td>\n",
|
||
" <td>2.150000</td>\n",
|
||
" <td>0.079000</td>\n",
|
||
" <td>14.000000</td>\n",
|
||
" <td>40.000000</td>\n",
|
||
" <td>0.996645</td>\n",
|
||
" <td>3.300000</td>\n",
|
||
" <td>0.620000</td>\n",
|
||
" <td>10.100000</td>\n",
|
||
" <td>6.000000</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>75%</th>\n",
|
||
" <td>9.200000</td>\n",
|
||
" <td>0.640000</td>\n",
|
||
" <td>0.420000</td>\n",
|
||
" <td>2.600000</td>\n",
|
||
" <td>0.090000</td>\n",
|
||
" <td>21.000000</td>\n",
|
||
" <td>65.750000</td>\n",
|
||
" <td>0.997683</td>\n",
|
||
" <td>3.390000</td>\n",
|
||
" <td>0.720000</td>\n",
|
||
" <td>11.000000</td>\n",
|
||
" <td>6.000000</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>max</th>\n",
|
||
" <td>15.600000</td>\n",
|
||
" <td>1.115000</td>\n",
|
||
" <td>0.790000</td>\n",
|
||
" <td>15.500000</td>\n",
|
||
" <td>0.611000</td>\n",
|
||
" <td>68.000000</td>\n",
|
||
" <td>289.000000</td>\n",
|
||
" <td>1.003690</td>\n",
|
||
" <td>3.750000</td>\n",
|
||
" <td>1.950000</td>\n",
|
||
" <td>14.000000</td>\n",
|
||
" <td>8.000000</td>\n",
|
||
" </tr>\n",
|
||
" </tbody>\n",
|
||
"</table>\n",
|
||
"</div>"
|
||
],
|
||
"text/plain": [
|
||
" fixed acidity volatile acidity ... alcohol quality\n",
|
||
"count 360.000000 360.000000 ... 360.000000 360.000000\n",
|
||
"mean 8.348611 0.518764 ... 10.368889 5.586111\n",
|
||
"std 1.580574 0.182554 ... 1.041729 0.767245\n",
|
||
"min 5.000000 0.120000 ... 8.700000 3.000000\n",
|
||
"25% 7.200000 0.380000 ... 9.500000 5.000000\n",
|
||
"50% 8.000000 0.500000 ... 10.100000 6.000000\n",
|
||
"75% 9.200000 0.640000 ... 11.000000 6.000000\n",
|
||
"max 15.600000 1.115000 ... 14.000000 8.000000\n",
|
||
"\n",
|
||
"[8 rows x 12 columns]"
|
||
]
|
||
},
|
||
"metadata": {
|
||
"tags": []
|
||
},
|
||
"execution_count": 13
|
||
}
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"metadata": {
|
||
"colab": {
|
||
"base_uri": "https://localhost:8080/",
|
||
"height": 405
|
||
},
|
||
"id": "3GksWzExaHV7",
|
||
"outputId": "43e5e6bc-42c2-4684-d1bf-66af4ba4d0da"
|
||
},
|
||
"source": [
|
||
"fig = plt.figure(figsize = (10,6))\n",
|
||
"sns.barplot(x = 'quality', y = 'volatile acidity', data = wine)"
|
||
],
|
||
"execution_count": 14,
|
||
"outputs": [
|
||
{
|
||
"output_type": "execute_result",
|
||
"data": {
|
||
"text/plain": [
|
||
"<matplotlib.axes._subplots.AxesSubplot at 0x7f2413878cd0>"
|
||
]
|
||
},
|
||
"metadata": {
|
||
"tags": []
|
||
},
|
||
"execution_count": 14
|
||
},
|
||
{
|
||
"output_type": "display_data",
|
||
"data": {
|
||
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAmEAAAFzCAYAAAB2A95GAAAABHNC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Vbaqq+8/e3zvJY5O8b2yqxdbdP9vdJ3f3aVk+ZfCG7l6Yv5zWoqo6vqpO2Ps+yXclee/YVIutu5eS3FRVD5ytenSS6wZGWk8uiFORq+VDSR5eVfeZXej26CTXD850xEx6x3ySJF+Z5OWzK2mOSXJ5d7tlAovmK5K8evm/kdmY5BXd/bqxkdaFn0jyh7PTYzckefrgPAtv9kfGY5P82Ogs60F3v72qrkjyjiS3J3lnFujO+W5RAQAwgNORAAADKGEAAAMoYQAAAyhhAAADKGEAAAMoYQAzVXVaVb139n5LVf3a7P2jqmphbhAJrA3uEwawH929M8nO2eKjknw6yV8PCwQsHEfCgIVQVc+rqr+rqr+qqldW1c9U1Zuqasts+4mzR1ntPeL1l1X1jtnP3Y5yzY5+/VlVnZbkx5M8u6quqarvqKoPVNW9ZuPuu3IZYF6OhAFHvar65iw/ourBWf7v2juSHOwB7jcneWx3f76qzsjyI2i27G9gd3+wqn4ryae7+0Wz73tTku9J8iez733V7Ll2AHNzJAxYBN+R5NXd/dnu/mSS7YcYf68k/7uq3pPkj5OceZjf99L86yOCnp7kZYf5+wCOhAEL7fb86x+bx61Y/+wk/5Tkm2bbP384H9rdb52d0nxUkg3d7WHlwGFzJAxYBG9J8h+q6t5VdUKS752t/2CSb569f+KK8fdL8uHuvjPJU5NsOMTnfyrJCfus+70kr4ijYMA9pIQBR73ufkeSP0ryriSvTXLVbNOLkvznqnpnkhNX/MpLkvxQVb0rydcl+cwhvuI1Sf7j3on5s3V/mOQBWZ5PBnDYqrtHZwA4oqrq57NiIv1E3/HEJOd391On+g5gsZkTBnCYqurXk5yb5HGjswBHL0fCAAAGMCcMAGAAJQwAYAAlDABgACUMAGAAJQwAYAAlDABggP8PDVCRsMwy1LoAAAAASUVORK5CYII=\n",
|
||
"text/plain": [
|
||
"<Figure size 720x432 with 1 Axes>"
|
||
]
|
||
},
|
||
"metadata": {
|
||
"tags": [],
|
||
"needs_background": "light"
|
||
}
|
||
}
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "markdown",
|
||
"metadata": {
|
||
"id": "w5xmkUgGzdxs"
|
||
},
|
||
"source": [
|
||
"## 3.3. Cały zbiór"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"metadata": {
|
||
"colab": {
|
||
"base_uri": "https://localhost:8080/",
|
||
"height": 419
|
||
},
|
||
"id": "thGHHVJXzeGe",
|
||
"outputId": "c50d4be9-db0d-438f-8a97-54a8a96d180c"
|
||
},
|
||
"source": [
|
||
"wine"
|
||
],
|
||
"execution_count": 15,
|
||
"outputs": [
|
||
{
|
||
"output_type": "execute_result",
|
||
"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>fixed acidity</th>\n",
|
||
" <th>volatile acidity</th>\n",
|
||
" <th>citric acid</th>\n",
|
||
" <th>residual sugar</th>\n",
|
||
" <th>chlorides</th>\n",
|
||
" <th>free sulfur dioxide</th>\n",
|
||
" <th>total sulfur dioxide</th>\n",
|
||
" <th>density</th>\n",
|
||
" <th>pH</th>\n",
|
||
" <th>sulphates</th>\n",
|
||
" <th>alcohol</th>\n",
|
||
" <th>quality</th>\n",
|
||
" </tr>\n",
|
||
" </thead>\n",
|
||
" <tbody>\n",
|
||
" <tr>\n",
|
||
" <th>0</th>\n",
|
||
" <td>7.4</td>\n",
|
||
" <td>0.700</td>\n",
|
||
" <td>0.00</td>\n",
|
||
" <td>1.9</td>\n",
|
||
" <td>0.076</td>\n",
|
||
" <td>11.0</td>\n",
|
||
" <td>34.0</td>\n",
|
||
" <td>0.99780</td>\n",
|
||
" <td>3.51</td>\n",
|
||
" <td>0.56</td>\n",
|
||
" <td>9.4</td>\n",
|
||
" <td>5</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>1</th>\n",
|
||
" <td>7.8</td>\n",
|
||
" <td>0.880</td>\n",
|
||
" <td>0.00</td>\n",
|
||
" <td>2.6</td>\n",
|
||
" <td>0.098</td>\n",
|
||
" <td>25.0</td>\n",
|
||
" <td>67.0</td>\n",
|
||
" <td>0.99680</td>\n",
|
||
" <td>3.20</td>\n",
|
||
" <td>0.68</td>\n",
|
||
" <td>9.8</td>\n",
|
||
" <td>5</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>2</th>\n",
|
||
" <td>7.8</td>\n",
|
||
" <td>0.760</td>\n",
|
||
" <td>0.04</td>\n",
|
||
" <td>2.3</td>\n",
|
||
" <td>0.092</td>\n",
|
||
" <td>15.0</td>\n",
|
||
" <td>54.0</td>\n",
|
||
" <td>0.99700</td>\n",
|
||
" <td>3.26</td>\n",
|
||
" <td>0.65</td>\n",
|
||
" <td>9.8</td>\n",
|
||
" <td>5</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>3</th>\n",
|
||
" <td>11.2</td>\n",
|
||
" <td>0.280</td>\n",
|
||
" <td>0.56</td>\n",
|
||
" <td>1.9</td>\n",
|
||
" <td>0.075</td>\n",
|
||
" <td>17.0</td>\n",
|
||
" <td>60.0</td>\n",
|
||
" <td>0.99800</td>\n",
|
||
" <td>3.16</td>\n",
|
||
" <td>0.58</td>\n",
|
||
" <td>9.8</td>\n",
|
||
" <td>6</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>4</th>\n",
|
||
" <td>7.4</td>\n",
|
||
" <td>0.700</td>\n",
|
||
" <td>0.00</td>\n",
|
||
" <td>1.9</td>\n",
|
||
" <td>0.076</td>\n",
|
||
" <td>11.0</td>\n",
|
||
" <td>34.0</td>\n",
|
||
" <td>0.99780</td>\n",
|
||
" <td>3.51</td>\n",
|
||
" <td>0.56</td>\n",
|
||
" <td>9.4</td>\n",
|
||
" <td>5</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",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>1594</th>\n",
|
||
" <td>6.2</td>\n",
|
||
" <td>0.600</td>\n",
|
||
" <td>0.08</td>\n",
|
||
" <td>2.0</td>\n",
|
||
" <td>0.090</td>\n",
|
||
" <td>32.0</td>\n",
|
||
" <td>44.0</td>\n",
|
||
" <td>0.99490</td>\n",
|
||
" <td>3.45</td>\n",
|
||
" <td>0.58</td>\n",
|
||
" <td>10.5</td>\n",
|
||
" <td>5</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>1595</th>\n",
|
||
" <td>5.9</td>\n",
|
||
" <td>0.550</td>\n",
|
||
" <td>0.10</td>\n",
|
||
" <td>2.2</td>\n",
|
||
" <td>0.062</td>\n",
|
||
" <td>39.0</td>\n",
|
||
" <td>51.0</td>\n",
|
||
" <td>0.99512</td>\n",
|
||
" <td>3.52</td>\n",
|
||
" <td>0.76</td>\n",
|
||
" <td>11.2</td>\n",
|
||
" <td>6</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>1596</th>\n",
|
||
" <td>6.3</td>\n",
|
||
" <td>0.510</td>\n",
|
||
" <td>0.13</td>\n",
|
||
" <td>2.3</td>\n",
|
||
" <td>0.076</td>\n",
|
||
" <td>29.0</td>\n",
|
||
" <td>40.0</td>\n",
|
||
" <td>0.99574</td>\n",
|
||
" <td>3.42</td>\n",
|
||
" <td>0.75</td>\n",
|
||
" <td>11.0</td>\n",
|
||
" <td>6</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>1597</th>\n",
|
||
" <td>5.9</td>\n",
|
||
" <td>0.645</td>\n",
|
||
" <td>0.12</td>\n",
|
||
" <td>2.0</td>\n",
|
||
" <td>0.075</td>\n",
|
||
" <td>32.0</td>\n",
|
||
" <td>44.0</td>\n",
|
||
" <td>0.99547</td>\n",
|
||
" <td>3.57</td>\n",
|
||
" <td>0.71</td>\n",
|
||
" <td>10.2</td>\n",
|
||
" <td>5</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>1598</th>\n",
|
||
" <td>6.0</td>\n",
|
||
" <td>0.310</td>\n",
|
||
" <td>0.47</td>\n",
|
||
" <td>3.6</td>\n",
|
||
" <td>0.067</td>\n",
|
||
" <td>18.0</td>\n",
|
||
" <td>42.0</td>\n",
|
||
" <td>0.99549</td>\n",
|
||
" <td>3.39</td>\n",
|
||
" <td>0.66</td>\n",
|
||
" <td>11.0</td>\n",
|
||
" <td>6</td>\n",
|
||
" </tr>\n",
|
||
" </tbody>\n",
|
||
"</table>\n",
|
||
"<p>1599 rows × 12 columns</p>\n",
|
||
"</div>"
|
||
],
|
||
"text/plain": [
|
||
" fixed acidity volatile acidity citric acid ... sulphates alcohol quality\n",
|
||
"0 7.4 0.700 0.00 ... 0.56 9.4 5\n",
|
||
"1 7.8 0.880 0.00 ... 0.68 9.8 5\n",
|
||
"2 7.8 0.760 0.04 ... 0.65 9.8 5\n",
|
||
"3 11.2 0.280 0.56 ... 0.58 9.8 6\n",
|
||
"4 7.4 0.700 0.00 ... 0.56 9.4 5\n",
|
||
"... ... ... ... ... ... ... ...\n",
|
||
"1594 6.2 0.600 0.08 ... 0.58 10.5 5\n",
|
||
"1595 5.9 0.550 0.10 ... 0.76 11.2 6\n",
|
||
"1596 6.3 0.510 0.13 ... 0.75 11.0 6\n",
|
||
"1597 5.9 0.645 0.12 ... 0.71 10.2 5\n",
|
||
"1598 6.0 0.310 0.47 ... 0.66 11.0 6\n",
|
||
"\n",
|
||
"[1599 rows x 12 columns]"
|
||
]
|
||
},
|
||
"metadata": {
|
||
"tags": []
|
||
},
|
||
"execution_count": 15
|
||
}
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"metadata": {
|
||
"colab": {
|
||
"base_uri": "https://localhost:8080/"
|
||
},
|
||
"id": "Ua_ctPpVzeKJ",
|
||
"outputId": "a43a2d6a-68dd-45b3-d51d-c8310d0ffe80"
|
||
},
|
||
"source": [
|
||
"wine[\"quality\"].value_counts()"
|
||
],
|
||
"execution_count": 16,
|
||
"outputs": [
|
||
{
|
||
"output_type": "execute_result",
|
||
"data": {
|
||
"text/plain": [
|
||
"5 681\n",
|
||
"6 638\n",
|
||
"7 199\n",
|
||
"4 53\n",
|
||
"8 18\n",
|
||
"3 10\n",
|
||
"Name: quality, dtype: int64"
|
||
]
|
||
},
|
||
"metadata": {
|
||
"tags": []
|
||
},
|
||
"execution_count": 16
|
||
}
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"metadata": {
|
||
"colab": {
|
||
"base_uri": "https://localhost:8080/",
|
||
"height": 297
|
||
},
|
||
"id": "-06v1i7XzeOz",
|
||
"outputId": "91fa4c86-5f1c-4897-ac77-0771a60de93c"
|
||
},
|
||
"source": [
|
||
"wine.describe(include='all')"
|
||
],
|
||
"execution_count": 17,
|
||
"outputs": [
|
||
{
|
||
"output_type": "execute_result",
|
||
"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>fixed acidity</th>\n",
|
||
" <th>volatile acidity</th>\n",
|
||
" <th>citric acid</th>\n",
|
||
" <th>residual sugar</th>\n",
|
||
" <th>chlorides</th>\n",
|
||
" <th>free sulfur dioxide</th>\n",
|
||
" <th>total sulfur dioxide</th>\n",
|
||
" <th>density</th>\n",
|
||
" <th>pH</th>\n",
|
||
" <th>sulphates</th>\n",
|
||
" <th>alcohol</th>\n",
|
||
" <th>quality</th>\n",
|
||
" </tr>\n",
|
||
" </thead>\n",
|
||
" <tbody>\n",
|
||
" <tr>\n",
|
||
" <th>count</th>\n",
|
||
" <td>1599.000000</td>\n",
|
||
" <td>1599.000000</td>\n",
|
||
" <td>1599.000000</td>\n",
|
||
" <td>1599.000000</td>\n",
|
||
" <td>1599.000000</td>\n",
|
||
" <td>1599.000000</td>\n",
|
||
" <td>1599.000000</td>\n",
|
||
" <td>1599.000000</td>\n",
|
||
" <td>1599.000000</td>\n",
|
||
" <td>1599.000000</td>\n",
|
||
" <td>1599.000000</td>\n",
|
||
" <td>1599.000000</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>mean</th>\n",
|
||
" <td>8.319637</td>\n",
|
||
" <td>0.527821</td>\n",
|
||
" <td>0.270976</td>\n",
|
||
" <td>2.538806</td>\n",
|
||
" <td>0.087467</td>\n",
|
||
" <td>15.874922</td>\n",
|
||
" <td>46.467792</td>\n",
|
||
" <td>0.996747</td>\n",
|
||
" <td>3.311113</td>\n",
|
||
" <td>0.658149</td>\n",
|
||
" <td>10.422983</td>\n",
|
||
" <td>5.636023</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>std</th>\n",
|
||
" <td>1.741096</td>\n",
|
||
" <td>0.179060</td>\n",
|
||
" <td>0.194801</td>\n",
|
||
" <td>1.409928</td>\n",
|
||
" <td>0.047065</td>\n",
|
||
" <td>10.460157</td>\n",
|
||
" <td>32.895324</td>\n",
|
||
" <td>0.001887</td>\n",
|
||
" <td>0.154386</td>\n",
|
||
" <td>0.169507</td>\n",
|
||
" <td>1.065668</td>\n",
|
||
" <td>0.807569</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>min</th>\n",
|
||
" <td>4.600000</td>\n",
|
||
" <td>0.120000</td>\n",
|
||
" <td>0.000000</td>\n",
|
||
" <td>0.900000</td>\n",
|
||
" <td>0.012000</td>\n",
|
||
" <td>1.000000</td>\n",
|
||
" <td>6.000000</td>\n",
|
||
" <td>0.990070</td>\n",
|
||
" <td>2.740000</td>\n",
|
||
" <td>0.330000</td>\n",
|
||
" <td>8.400000</td>\n",
|
||
" <td>3.000000</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>25%</th>\n",
|
||
" <td>7.100000</td>\n",
|
||
" <td>0.390000</td>\n",
|
||
" <td>0.090000</td>\n",
|
||
" <td>1.900000</td>\n",
|
||
" <td>0.070000</td>\n",
|
||
" <td>7.000000</td>\n",
|
||
" <td>22.000000</td>\n",
|
||
" <td>0.995600</td>\n",
|
||
" <td>3.210000</td>\n",
|
||
" <td>0.550000</td>\n",
|
||
" <td>9.500000</td>\n",
|
||
" <td>5.000000</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>50%</th>\n",
|
||
" <td>7.900000</td>\n",
|
||
" <td>0.520000</td>\n",
|
||
" <td>0.260000</td>\n",
|
||
" <td>2.200000</td>\n",
|
||
" <td>0.079000</td>\n",
|
||
" <td>14.000000</td>\n",
|
||
" <td>38.000000</td>\n",
|
||
" <td>0.996750</td>\n",
|
||
" <td>3.310000</td>\n",
|
||
" <td>0.620000</td>\n",
|
||
" <td>10.200000</td>\n",
|
||
" <td>6.000000</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>75%</th>\n",
|
||
" <td>9.200000</td>\n",
|
||
" <td>0.640000</td>\n",
|
||
" <td>0.420000</td>\n",
|
||
" <td>2.600000</td>\n",
|
||
" <td>0.090000</td>\n",
|
||
" <td>21.000000</td>\n",
|
||
" <td>62.000000</td>\n",
|
||
" <td>0.997835</td>\n",
|
||
" <td>3.400000</td>\n",
|
||
" <td>0.730000</td>\n",
|
||
" <td>11.100000</td>\n",
|
||
" <td>6.000000</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>max</th>\n",
|
||
" <td>15.900000</td>\n",
|
||
" <td>1.580000</td>\n",
|
||
" <td>1.000000</td>\n",
|
||
" <td>15.500000</td>\n",
|
||
" <td>0.611000</td>\n",
|
||
" <td>72.000000</td>\n",
|
||
" <td>289.000000</td>\n",
|
||
" <td>1.003690</td>\n",
|
||
" <td>4.010000</td>\n",
|
||
" <td>2.000000</td>\n",
|
||
" <td>14.900000</td>\n",
|
||
" <td>8.000000</td>\n",
|
||
" </tr>\n",
|
||
" </tbody>\n",
|
||
"</table>\n",
|
||
"</div>"
|
||
],
|
||
"text/plain": [
|
||
" fixed acidity volatile acidity ... alcohol quality\n",
|
||
"count 1599.000000 1599.000000 ... 1599.000000 1599.000000\n",
|
||
"mean 8.319637 0.527821 ... 10.422983 5.636023\n",
|
||
"std 1.741096 0.179060 ... 1.065668 0.807569\n",
|
||
"min 4.600000 0.120000 ... 8.400000 3.000000\n",
|
||
"25% 7.100000 0.390000 ... 9.500000 5.000000\n",
|
||
"50% 7.900000 0.520000 ... 10.200000 6.000000\n",
|
||
"75% 9.200000 0.640000 ... 11.100000 6.000000\n",
|
||
"max 15.900000 1.580000 ... 14.900000 8.000000\n",
|
||
"\n",
|
||
"[8 rows x 12 columns]"
|
||
]
|
||
},
|
||
"metadata": {
|
||
"tags": []
|
||
},
|
||
"execution_count": 17
|
||
}
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"metadata": {
|
||
"colab": {
|
||
"base_uri": "https://localhost:8080/",
|
||
"height": 405
|
||
},
|
||
"id": "hEe3BYcJaKnF",
|
||
"outputId": "8ca44337-6615-47a5-e3c9-b3ad02c37bd0"
|
||
},
|
||
"source": [
|
||
"fig = plt.figure(figsize = (10,6))\n",
|
||
"sns.barplot(x = 'quality', y = 'volatile acidity', data = wine)"
|
||
],
|
||
"execution_count": 18,
|
||
"outputs": [
|
||
{
|
||
"output_type": "execute_result",
|
||
"data": {
|
||
"text/plain": [
|
||
"<matplotlib.axes._subplots.AxesSubplot at 0x7f2412b3acd0>"
|
||
]
|
||
},
|
||
"metadata": {
|
||
"tags": []
|
||
},
|
||
"execution_count": 18
|
||
},
|
||
{
|
||
"output_type": "display_data",
|
||
"data": {
|
||
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAmEAAAFzCAYAAAB2A95GAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4yLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+WH4yJAAAY00lEQVR4nO3de7SlZ10f8O8vM4RAGi6a0bFJMKmN2GgRcIxoFFgCNkFMWkQlFlSWEm2JIiizwqILBduu5QDVikEbkYsXQEhBBxsIVQQVBTOBcEkCdgyEzMgxE5A7CEl+/ePswcNk5syZZN7z7Nnn81nrrL3fy9n7m72yku95nme/b3V3AABYX8eNDgAAsBEpYQAAAyhhAAADKGEAAAMoYQAAAyhhAAADbB4d4EidfPLJffrpp4+OAQBwWFdfffUt3b3lYMeOuRJ2+umnZ9euXaNjAAAcVlXdeKhjpiMBAAZQwgAABlDCAAAGUMIAAAZQwgAABlDCAAAGUMIAAAZQwgAABlDCAAAGUMIAAAZQwgAABlDCAAAGOOZu4H2s2r59e5aWlrJ169bs2LFjdBwAYDAlbJ0sLS1l7969o2MAAHPCdCQAwABKGADAAEoYAMAAShgAwABKGADAAEoYAMAAShgAwABKGADAAEoYAMAAShgAwABKGADAAEoYAMAAShgAw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3//JG8aHe/bTal+fAkm7rbzcqBI2YkDFgEf57k31fVParqpCTfN9v/oSTfMnv+uBXn3zvJR7r79iRPTLLpMK//qSQnHbDvd5K8IkbBgDtJCQOOed39ziR/kOTdSd6Q5KrZoecn+U9V9a4kJ6/4lRcl+dGqeneSb0jymcO8xeuT/If9C/Nn+34/yX2zvJ4M4IhVd4/OAHBUVdUvZsVC+one43FJLujuJ071HsBisyYM4AhV1QuTnJfk0aOzAMcuI2EAAANYEwYAMIASBgAwgBIGADCAEgYAMIASBgAwgBIGADDA/wf6N46jVdGylQAAAABJRU5ErkJggg==\n",
|
||
"text/plain": [
|
||
"<Figure size 720x432 with 1 Axes>"
|
||
]
|
||
},
|
||
"metadata": {
|
||
"tags": [],
|
||
"needs_background": "light"
|
||
}
|
||
}
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "markdown",
|
||
"metadata": {
|
||
"id": "ftWOC-do2Pq-"
|
||
},
|
||
"source": [
|
||
"# 4. Normalizacja"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "markdown",
|
||
"metadata": {
|
||
"id": "Wm0EM2hj4s6V"
|
||
},
|
||
"source": [
|
||
"Normalizacja kolumny 'quality' na wartości od 0 do 20. Nie jest ona konieczna ale została stworzona w celach demonstracyjnych"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"metadata": {
|
||
"id": "EkZQ6Hpy2Tj_"
|
||
},
|
||
"source": [
|
||
"wine[\"quality\"]=((wine[\"quality\"]-wine[\"quality\"].min())/(wine[\"quality\"].max()-wine[\"quality\"].min()))*20"
|
||
],
|
||
"execution_count": 19,
|
||
"outputs": []
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"metadata": {
|
||
"colab": {
|
||
"base_uri": "https://localhost:8080/",
|
||
"height": 419
|
||
},
|
||
"id": "_bQgYfct3Tir",
|
||
"outputId": "24dd9365-4398-4556-8c1b-ac78ef515718"
|
||
},
|
||
"source": [
|
||
"wine"
|
||
],
|
||
"execution_count": 20,
|
||
"outputs": [
|
||
{
|
||
"output_type": "execute_result",
|
||
"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>fixed acidity</th>\n",
|
||
" <th>volatile acidity</th>\n",
|
||
" <th>citric acid</th>\n",
|
||
" <th>residual sugar</th>\n",
|
||
" <th>chlorides</th>\n",
|
||
" <th>free sulfur dioxide</th>\n",
|
||
" <th>total sulfur dioxide</th>\n",
|
||
" <th>density</th>\n",
|
||
" <th>pH</th>\n",
|
||
" <th>sulphates</th>\n",
|
||
" <th>alcohol</th>\n",
|
||
" <th>quality</th>\n",
|
||
" </tr>\n",
|
||
" </thead>\n",
|
||
" <tbody>\n",
|
||
" <tr>\n",
|
||
" <th>0</th>\n",
|
||
" <td>7.4</td>\n",
|
||
" <td>0.700</td>\n",
|
||
" <td>0.00</td>\n",
|
||
" <td>1.9</td>\n",
|
||
" <td>0.076</td>\n",
|
||
" <td>11.0</td>\n",
|
||
" <td>34.0</td>\n",
|
||
" <td>0.99780</td>\n",
|
||
" <td>3.51</td>\n",
|
||
" <td>0.56</td>\n",
|
||
" <td>9.4</td>\n",
|
||
" <td>8.0</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>1</th>\n",
|
||
" <td>7.8</td>\n",
|
||
" <td>0.880</td>\n",
|
||
" <td>0.00</td>\n",
|
||
" <td>2.6</td>\n",
|
||
" <td>0.098</td>\n",
|
||
" <td>25.0</td>\n",
|
||
" <td>67.0</td>\n",
|
||
" <td>0.99680</td>\n",
|
||
" <td>3.20</td>\n",
|
||
" <td>0.68</td>\n",
|
||
" <td>9.8</td>\n",
|
||
" <td>8.0</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>2</th>\n",
|
||
" <td>7.8</td>\n",
|
||
" <td>0.760</td>\n",
|
||
" <td>0.04</td>\n",
|
||
" <td>2.3</td>\n",
|
||
" <td>0.092</td>\n",
|
||
" <td>15.0</td>\n",
|
||
" <td>54.0</td>\n",
|
||
" <td>0.99700</td>\n",
|
||
" <td>3.26</td>\n",
|
||
" <td>0.65</td>\n",
|
||
" <td>9.8</td>\n",
|
||
" <td>8.0</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>3</th>\n",
|
||
" <td>11.2</td>\n",
|
||
" <td>0.280</td>\n",
|
||
" <td>0.56</td>\n",
|
||
" <td>1.9</td>\n",
|
||
" <td>0.075</td>\n",
|
||
" <td>17.0</td>\n",
|
||
" <td>60.0</td>\n",
|
||
" <td>0.99800</td>\n",
|
||
" <td>3.16</td>\n",
|
||
" <td>0.58</td>\n",
|
||
" <td>9.8</td>\n",
|
||
" <td>12.0</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>4</th>\n",
|
||
" <td>7.4</td>\n",
|
||
" <td>0.700</td>\n",
|
||
" <td>0.00</td>\n",
|
||
" <td>1.9</td>\n",
|
||
" <td>0.076</td>\n",
|
||
" <td>11.0</td>\n",
|
||
" <td>34.0</td>\n",
|
||
" <td>0.99780</td>\n",
|
||
" <td>3.51</td>\n",
|
||
" <td>0.56</td>\n",
|
||
" <td>9.4</td>\n",
|
||
" <td>8.0</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",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>1594</th>\n",
|
||
" <td>6.2</td>\n",
|
||
" <td>0.600</td>\n",
|
||
" <td>0.08</td>\n",
|
||
" <td>2.0</td>\n",
|
||
" <td>0.090</td>\n",
|
||
" <td>32.0</td>\n",
|
||
" <td>44.0</td>\n",
|
||
" <td>0.99490</td>\n",
|
||
" <td>3.45</td>\n",
|
||
" <td>0.58</td>\n",
|
||
" <td>10.5</td>\n",
|
||
" <td>8.0</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>1595</th>\n",
|
||
" <td>5.9</td>\n",
|
||
" <td>0.550</td>\n",
|
||
" <td>0.10</td>\n",
|
||
" <td>2.2</td>\n",
|
||
" <td>0.062</td>\n",
|
||
" <td>39.0</td>\n",
|
||
" <td>51.0</td>\n",
|
||
" <td>0.99512</td>\n",
|
||
" <td>3.52</td>\n",
|
||
" <td>0.76</td>\n",
|
||
" <td>11.2</td>\n",
|
||
" <td>12.0</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>1596</th>\n",
|
||
" <td>6.3</td>\n",
|
||
" <td>0.510</td>\n",
|
||
" <td>0.13</td>\n",
|
||
" <td>2.3</td>\n",
|
||
" <td>0.076</td>\n",
|
||
" <td>29.0</td>\n",
|
||
" <td>40.0</td>\n",
|
||
" <td>0.99574</td>\n",
|
||
" <td>3.42</td>\n",
|
||
" <td>0.75</td>\n",
|
||
" <td>11.0</td>\n",
|
||
" <td>12.0</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>1597</th>\n",
|
||
" <td>5.9</td>\n",
|
||
" <td>0.645</td>\n",
|
||
" <td>0.12</td>\n",
|
||
" <td>2.0</td>\n",
|
||
" <td>0.075</td>\n",
|
||
" <td>32.0</td>\n",
|
||
" <td>44.0</td>\n",
|
||
" <td>0.99547</td>\n",
|
||
" <td>3.57</td>\n",
|
||
" <td>0.71</td>\n",
|
||
" <td>10.2</td>\n",
|
||
" <td>8.0</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>1598</th>\n",
|
||
" <td>6.0</td>\n",
|
||
" <td>0.310</td>\n",
|
||
" <td>0.47</td>\n",
|
||
" <td>3.6</td>\n",
|
||
" <td>0.067</td>\n",
|
||
" <td>18.0</td>\n",
|
||
" <td>42.0</td>\n",
|
||
" <td>0.99549</td>\n",
|
||
" <td>3.39</td>\n",
|
||
" <td>0.66</td>\n",
|
||
" <td>11.0</td>\n",
|
||
" <td>12.0</td>\n",
|
||
" </tr>\n",
|
||
" </tbody>\n",
|
||
"</table>\n",
|
||
"<p>1599 rows × 12 columns</p>\n",
|
||
"</div>"
|
||
],
|
||
"text/plain": [
|
||
" fixed acidity volatile acidity citric acid ... sulphates alcohol quality\n",
|
||
"0 7.4 0.700 0.00 ... 0.56 9.4 8.0\n",
|
||
"1 7.8 0.880 0.00 ... 0.68 9.8 8.0\n",
|
||
"2 7.8 0.760 0.04 ... 0.65 9.8 8.0\n",
|
||
"3 11.2 0.280 0.56 ... 0.58 9.8 12.0\n",
|
||
"4 7.4 0.700 0.00 ... 0.56 9.4 8.0\n",
|
||
"... ... ... ... ... ... ... ...\n",
|
||
"1594 6.2 0.600 0.08 ... 0.58 10.5 8.0\n",
|
||
"1595 5.9 0.550 0.10 ... 0.76 11.2 12.0\n",
|
||
"1596 6.3 0.510 0.13 ... 0.75 11.0 12.0\n",
|
||
"1597 5.9 0.645 0.12 ... 0.71 10.2 8.0\n",
|
||
"1598 6.0 0.310 0.47 ... 0.66 11.0 12.0\n",
|
||
"\n",
|
||
"[1599 rows x 12 columns]"
|
||
]
|
||
},
|
||
"metadata": {
|
||
"tags": []
|
||
},
|
||
"execution_count": 20
|
||
}
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"metadata": {
|
||
"colab": {
|
||
"base_uri": "https://localhost:8080/"
|
||
},
|
||
"id": "I1AwZoyN4RHs",
|
||
"outputId": "490528b2-44c0-41c1-ae79-cee03f40740d"
|
||
},
|
||
"source": [
|
||
"wine[\"quality\"].value_counts()"
|
||
],
|
||
"execution_count": 21,
|
||
"outputs": [
|
||
{
|
||
"output_type": "execute_result",
|
||
"data": {
|
||
"text/plain": [
|
||
"8.0 681\n",
|
||
"12.0 638\n",
|
||
"16.0 199\n",
|
||
"4.0 53\n",
|
||
"20.0 18\n",
|
||
"0.0 10\n",
|
||
"Name: quality, dtype: int64"
|
||
]
|
||
},
|
||
"metadata": {
|
||
"tags": []
|
||
},
|
||
"execution_count": 21
|
||
}
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "markdown",
|
||
"metadata": {
|
||
"id": "XBU3z_of414w"
|
||
},
|
||
"source": [
|
||
"# 5. Usuwanie artefaktów"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "markdown",
|
||
"metadata": {
|
||
"id": "KCstRwQp5-X1"
|
||
},
|
||
"source": [
|
||
"### Całe szczęscie nie ma w moim zbiorze ani pustych linijek, ani przykładów z niepoprawnymi wartościami"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"metadata": {
|
||
"id": "EJqksTP545UV"
|
||
},
|
||
"source": [
|
||
"# Znajdźmy pustą linijkę:\n",
|
||
"! grep -P \"^$\" -n winequality-red.csv"
|
||
],
|
||
"execution_count": 22,
|
||
"outputs": []
|
||
},
|
||
{
|
||
"cell_type": "markdown",
|
||
"metadata": {
|
||
"id": "8DuoPn3Fa0kP"
|
||
},
|
||
"source": [
|
||
"Szukanie wartości \"NA\": https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.dropna.html"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"metadata": {
|
||
"colab": {
|
||
"base_uri": "https://localhost:8080/"
|
||
},
|
||
"id": "REYF2AWjz_lr",
|
||
"outputId": "ac466088-829e-4b5a-88b4-b657c91a8de0"
|
||
},
|
||
"source": [
|
||
"wine.isnull().sum()"
|
||
],
|
||
"execution_count": 23,
|
||
"outputs": [
|
||
{
|
||
"output_type": "execute_result",
|
||
"data": {
|
||
"text/plain": [
|
||
"fixed acidity 0\n",
|
||
"volatile acidity 0\n",
|
||
"citric acid 0\n",
|
||
"residual sugar 0\n",
|
||
"chlorides 0\n",
|
||
"free sulfur dioxide 0\n",
|
||
"total sulfur dioxide 0\n",
|
||
"density 0\n",
|
||
"pH 0\n",
|
||
"sulphates 0\n",
|
||
"alcohol 0\n",
|
||
"quality 0\n",
|
||
"dtype: int64"
|
||
]
|
||
},
|
||
"metadata": {
|
||
"tags": []
|
||
},
|
||
"execution_count": 23
|
||
}
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"metadata": {
|
||
"id": "RbkqNj9_akcU"
|
||
},
|
||
"source": [
|
||
"wine.dropna(inplace=True) "
|
||
],
|
||
"execution_count": 24,
|
||
"outputs": []
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"metadata": {
|
||
"colab": {
|
||
"base_uri": "https://localhost:8080/",
|
||
"height": 419
|
||
},
|
||
"id": "4WylJo9malyG",
|
||
"outputId": "b830d411-939e-4429-df7b-92672165cf2d"
|
||
},
|
||
"source": [
|
||
"wine"
|
||
],
|
||
"execution_count": 25,
|
||
"outputs": [
|
||
{
|
||
"output_type": "execute_result",
|
||
"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>fixed acidity</th>\n",
|
||
" <th>volatile acidity</th>\n",
|
||
" <th>citric acid</th>\n",
|
||
" <th>residual sugar</th>\n",
|
||
" <th>chlorides</th>\n",
|
||
" <th>free sulfur dioxide</th>\n",
|
||
" <th>total sulfur dioxide</th>\n",
|
||
" <th>density</th>\n",
|
||
" <th>pH</th>\n",
|
||
" <th>sulphates</th>\n",
|
||
" <th>alcohol</th>\n",
|
||
" <th>quality</th>\n",
|
||
" </tr>\n",
|
||
" </thead>\n",
|
||
" <tbody>\n",
|
||
" <tr>\n",
|
||
" <th>0</th>\n",
|
||
" <td>7.4</td>\n",
|
||
" <td>0.700</td>\n",
|
||
" <td>0.00</td>\n",
|
||
" <td>1.9</td>\n",
|
||
" <td>0.076</td>\n",
|
||
" <td>11.0</td>\n",
|
||
" <td>34.0</td>\n",
|
||
" <td>0.99780</td>\n",
|
||
" <td>3.51</td>\n",
|
||
" <td>0.56</td>\n",
|
||
" <td>9.4</td>\n",
|
||
" <td>8.0</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>1</th>\n",
|
||
" <td>7.8</td>\n",
|
||
" <td>0.880</td>\n",
|
||
" <td>0.00</td>\n",
|
||
" <td>2.6</td>\n",
|
||
" <td>0.098</td>\n",
|
||
" <td>25.0</td>\n",
|
||
" <td>67.0</td>\n",
|
||
" <td>0.99680</td>\n",
|
||
" <td>3.20</td>\n",
|
||
" <td>0.68</td>\n",
|
||
" <td>9.8</td>\n",
|
||
" <td>8.0</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>2</th>\n",
|
||
" <td>7.8</td>\n",
|
||
" <td>0.760</td>\n",
|
||
" <td>0.04</td>\n",
|
||
" <td>2.3</td>\n",
|
||
" <td>0.092</td>\n",
|
||
" <td>15.0</td>\n",
|
||
" <td>54.0</td>\n",
|
||
" <td>0.99700</td>\n",
|
||
" <td>3.26</td>\n",
|
||
" <td>0.65</td>\n",
|
||
" <td>9.8</td>\n",
|
||
" <td>8.0</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>3</th>\n",
|
||
" <td>11.2</td>\n",
|
||
" <td>0.280</td>\n",
|
||
" <td>0.56</td>\n",
|
||
" <td>1.9</td>\n",
|
||
" <td>0.075</td>\n",
|
||
" <td>17.0</td>\n",
|
||
" <td>60.0</td>\n",
|
||
" <td>0.99800</td>\n",
|
||
" <td>3.16</td>\n",
|
||
" <td>0.58</td>\n",
|
||
" <td>9.8</td>\n",
|
||
" <td>12.0</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>4</th>\n",
|
||
" <td>7.4</td>\n",
|
||
" <td>0.700</td>\n",
|
||
" <td>0.00</td>\n",
|
||
" <td>1.9</td>\n",
|
||
" <td>0.076</td>\n",
|
||
" <td>11.0</td>\n",
|
||
" <td>34.0</td>\n",
|
||
" <td>0.99780</td>\n",
|
||
" <td>3.51</td>\n",
|
||
" <td>0.56</td>\n",
|
||
" <td>9.4</td>\n",
|
||
" <td>8.0</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",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>1594</th>\n",
|
||
" <td>6.2</td>\n",
|
||
" <td>0.600</td>\n",
|
||
" <td>0.08</td>\n",
|
||
" <td>2.0</td>\n",
|
||
" <td>0.090</td>\n",
|
||
" <td>32.0</td>\n",
|
||
" <td>44.0</td>\n",
|
||
" <td>0.99490</td>\n",
|
||
" <td>3.45</td>\n",
|
||
" <td>0.58</td>\n",
|
||
" <td>10.5</td>\n",
|
||
" <td>8.0</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>1595</th>\n",
|
||
" <td>5.9</td>\n",
|
||
" <td>0.550</td>\n",
|
||
" <td>0.10</td>\n",
|
||
" <td>2.2</td>\n",
|
||
" <td>0.062</td>\n",
|
||
" <td>39.0</td>\n",
|
||
" <td>51.0</td>\n",
|
||
" <td>0.99512</td>\n",
|
||
" <td>3.52</td>\n",
|
||
" <td>0.76</td>\n",
|
||
" <td>11.2</td>\n",
|
||
" <td>12.0</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>1596</th>\n",
|
||
" <td>6.3</td>\n",
|
||
" <td>0.510</td>\n",
|
||
" <td>0.13</td>\n",
|
||
" <td>2.3</td>\n",
|
||
" <td>0.076</td>\n",
|
||
" <td>29.0</td>\n",
|
||
" <td>40.0</td>\n",
|
||
" <td>0.99574</td>\n",
|
||
" <td>3.42</td>\n",
|
||
" <td>0.75</td>\n",
|
||
" <td>11.0</td>\n",
|
||
" <td>12.0</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>1597</th>\n",
|
||
" <td>5.9</td>\n",
|
||
" <td>0.645</td>\n",
|
||
" <td>0.12</td>\n",
|
||
" <td>2.0</td>\n",
|
||
" <td>0.075</td>\n",
|
||
" <td>32.0</td>\n",
|
||
" <td>44.0</td>\n",
|
||
" <td>0.99547</td>\n",
|
||
" <td>3.57</td>\n",
|
||
" <td>0.71</td>\n",
|
||
" <td>10.2</td>\n",
|
||
" <td>8.0</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>1598</th>\n",
|
||
" <td>6.0</td>\n",
|
||
" <td>0.310</td>\n",
|
||
" <td>0.47</td>\n",
|
||
" <td>3.6</td>\n",
|
||
" <td>0.067</td>\n",
|
||
" <td>18.0</td>\n",
|
||
" <td>42.0</td>\n",
|
||
" <td>0.99549</td>\n",
|
||
" <td>3.39</td>\n",
|
||
" <td>0.66</td>\n",
|
||
" <td>11.0</td>\n",
|
||
" <td>12.0</td>\n",
|
||
" </tr>\n",
|
||
" </tbody>\n",
|
||
"</table>\n",
|
||
"<p>1599 rows × 12 columns</p>\n",
|
||
"</div>"
|
||
],
|
||
"text/plain": [
|
||
" fixed acidity volatile acidity citric acid ... sulphates alcohol quality\n",
|
||
"0 7.4 0.700 0.00 ... 0.56 9.4 8.0\n",
|
||
"1 7.8 0.880 0.00 ... 0.68 9.8 8.0\n",
|
||
"2 7.8 0.760 0.04 ... 0.65 9.8 8.0\n",
|
||
"3 11.2 0.280 0.56 ... 0.58 9.8 12.0\n",
|
||
"4 7.4 0.700 0.00 ... 0.56 9.4 8.0\n",
|
||
"... ... ... ... ... ... ... ...\n",
|
||
"1594 6.2 0.600 0.08 ... 0.58 10.5 8.0\n",
|
||
"1595 5.9 0.550 0.10 ... 0.76 11.2 12.0\n",
|
||
"1596 6.3 0.510 0.13 ... 0.75 11.0 12.0\n",
|
||
"1597 5.9 0.645 0.12 ... 0.71 10.2 8.0\n",
|
||
"1598 6.0 0.310 0.47 ... 0.66 11.0 12.0\n",
|
||
"\n",
|
||
"[1599 rows x 12 columns]"
|
||
]
|
||
},
|
||
"metadata": {
|
||
"tags": []
|
||
},
|
||
"execution_count": 25
|
||
}
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"metadata": {
|
||
"id": "5WvWtALhayKM"
|
||
},
|
||
"source": [
|
||
""
|
||
],
|
||
"execution_count": null,
|
||
"outputs": []
|
||
}
|
||
]
|
||
} |