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+7RMQAADquqbjjUNocjAQAGUMIAAAZQwgAABlDCAAAGUMIAAAZQwgAABlDCAAAGUMIAAAZQwgAABlDCAAAGUMIAAAZQwgAABjjmHuB9rNqxY0cWFhaybdu27Ny5c3QcAGAwJWyNLCwsZN++faNjAADrhMORAAADKGEAAAMoYQAAAyhhAAADKGEAAAMoYQAAAyhhAAADKGEAAAMoYQAAAyhhAAADKGEAAAMoYQAAAyhhAAADKGEAAAMoYQAAAyhhAAADKGEAAAMoYQAAA0xWwqrqt6vqpqp67yG2V1X9SlXtqap3V9VDp8oCALDeTDkT9jtJzllh+7lJzpj9XJTkNybMAgCwrkxWwrr7rUk+vsKQ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x432 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": "iVBORw0KGgoAAAANSUhEU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VNXpVXVskicn2b7PmD/J8lGwVNWJWT49ecNcyYE1Z+vWrXna056WrVu3jo4CsObNU8LS3buSbOjuO7r7ZUnOmeN3bk9yUZIrk1yf5PLuvraqXlhV582GXZnkI1V1XZI3Jnlud3/knvyDAOMtLS1lz549WVpaGh0FYM2bZ07YZ2dHsq6pqm1JPpz5y9uOJDv2Wff8Fe87yXNmPwAA68Y8Zeqps3EXJflMlud5fd+UoQAAFt08t6i4cfb280leMG0cYF5n//rZoyPczbEfPzbH5Jjc9PGb1lS+t/7EW0dHALibuU4rAgBwZClhAAADzF3Cquo+UwYBAFhP5rlZ67fNbiHxvtnyN1XVSyZPBgCwwOY5EvYrSb47yUeSpLvfleQRU4YCjk59n86dx9+Zvk+PjgKw5s377MibqmrlqjumiQMczb5w9hdGRwA4asxTwm6qqm9L0lV1ryTPyvId8AEAuIfmOR3540memeSkLD+A+8GzZQAA7qF5btZ6a5L/tApZAADWjQOWsKr69SQHnF3b3T85SSIAgHXgYEfCdq5aCgCAdeaAJay7X76aQQAA1pODnY781e7+qap6TfZzWrK7z5s0GQDAAjvY6cjfn72+aDWCAACsJwc7HXn17O2Du/t/rtxWVc9K8uYpgwEALLJ57hP2Q/tZ98NHOAcAwLpysDlhFyT5wSSnV9X2FZtOSPLRqYMBACyyg80J++skH05yYpIXr1j/qSTvnjIUAMCiO9icsBuT3JjkW1cvDgCHY+vWr
|
|||
|
"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+WH4yJAAAY00lEQVR4nO3de7SlZ10f8O8vM4RAGi6a0bFJMKmN2GgRcIxoFFgCNkFMWkQlFlSWEm2JIiizwqILBduu5QDVikEbkYsXQEhBBxsIVQQVBTOBcEkC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ER7uD4jx+f43Jcbvr4TXOV720//bbREQDuYE0L8wEAOLrWXMKq6p5TBgEA2EjWcrHW75h9e/H9s+1vrqoXTZ4MAGCBrWUk7FeS/LskH02S7n53kodOGQoAYNGt9d6RN1XVyl23TRMHOJb1PTu35/b0PXt0FIC5t5YSdlNVfUeSrqq7JXlqkuunjQUci754zhdHRwA4ZqxlOvKnkjwlySlZvvfjA2fbAADcSWu5WOstSf7jOmQBANgwDlnCquqFSQ65sKO7f2aSRAAAG8BqI2G71i0FAMAGc8gS1t0vX88gAAAbyWrTkb/a3T9bVa/PQaYlu/v8SZMBACyw1aYjf3f2+Pz1CAIAsJGsNh159ezpA7v7f648VlVPTfLWKYMBACyytVwn7EcPsu/HjnIOAIANZbU1YRcm+eEkZ1TVzhWHTkrysamDAQAsstXWhP1Vko8kOTnJC1bs/1SS90wZC
|
|||
|
"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": []
|
|||
|
}
|
|||
|
]
|
|||
|
}
|