ium_487176/zad1.ipynb
Maciej Tyczyński a526a45cd7 initial commit
2023-03-25 11:59:49 +01:00

1622 lines
63 KiB
Plaintext

{
"cells": [
{
"cell_type": "code",
"execution_count": 45,
"metadata": {},
"outputs": [],
"source": [
"import pandas as pd\n",
"import sklearn.model_selection"
]
},
{
"cell_type": "code",
"execution_count": 46,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"Found cached dataset wine (C:/Users/s487176/.cache/huggingface/datasets/mstz___wine/wine/1.0.0/0913b614badc418a000d75d098776831f39ebf5ee208ecd3cfad4d5db1418d76)\n"
]
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "a8f1b9db0c8b41e1904e16e22ae351e0",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
" 0%| | 0/1 [00:00<?, ?it/s]"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"from datasets import load_dataset\n",
"\n",
"dataset = load_dataset(\"mstz/wine\", \"wine\")"
]
},
{
"cell_type": "code",
"execution_count": 47,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"Dataset({\n",
" features: ['fixed_acidity', 'volatile_acidity', 'citric_acid', 'residual_sugar', 'chlorides', 'free_sulfur_dioxide', 'total_sulfur_dioxide', 'density', 'pH', 'sulphates', 'alcohol', 'quality', 'color'],\n",
" num_rows: 6497\n",
"})"
]
},
"execution_count": 47,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"dataset[\"train\"]"
]
},
{
"cell_type": "code",
"execution_count": 48,
"metadata": {},
"outputs": [],
"source": [
"wine_dataset = pd.DataFrame(dataset[\"train\"])"
]
},
{
"cell_type": "code",
"execution_count": 49,
"metadata": {},
"outputs": [
{
"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",
" <th>color</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>7.4</td>\n",
" <td>0.70</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.9978</td>\n",
" <td>3.51</td>\n",
" <td>0.56</td>\n",
" <td>9.4</td>\n",
" <td>5</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>7.8</td>\n",
" <td>0.88</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.9968</td>\n",
" <td>3.20</td>\n",
" <td>0.68</td>\n",
" <td>9.8</td>\n",
" <td>5</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>7.8</td>\n",
" <td>0.76</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.9970</td>\n",
" <td>3.26</td>\n",
" <td>0.65</td>\n",
" <td>9.8</td>\n",
" <td>5</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>11.2</td>\n",
" <td>0.28</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.9980</td>\n",
" <td>3.16</td>\n",
" <td>0.58</td>\n",
" <td>9.8</td>\n",
" <td>6</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>7.4</td>\n",
" <td>0.70</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.9978</td>\n",
" <td>3.51</td>\n",
" <td>0.56</td>\n",
" <td>9.4</td>\n",
" <td>5</td>\n",
" <td>0</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" fixed_acidity volatile_acidity citric_acid residual_sugar chlorides \\\n",
"0 7.4 0.70 0.00 1.9 0.076 \n",
"1 7.8 0.88 0.00 2.6 0.098 \n",
"2 7.8 0.76 0.04 2.3 0.092 \n",
"3 11.2 0.28 0.56 1.9 0.075 \n",
"4 7.4 0.70 0.00 1.9 0.076 \n",
"\n",
" free_sulfur_dioxide total_sulfur_dioxide density pH sulphates \\\n",
"0 11.0 34.0 0.9978 3.51 0.56 \n",
"1 25.0 67.0 0.9968 3.20 0.68 \n",
"2 15.0 54.0 0.9970 3.26 0.65 \n",
"3 17.0 60.0 0.9980 3.16 0.58 \n",
"4 11.0 34.0 0.9978 3.51 0.56 \n",
"\n",
" alcohol quality color \n",
"0 9.4 5 0 \n",
"1 9.8 5 0 \n",
"2 9.8 5 0 \n",
"3 9.8 6 0 \n",
"4 9.4 5 0 "
]
},
"execution_count": 49,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"wine_dataset.head()# podgląd danych"
]
},
{
"cell_type": "code",
"execution_count": 50,
"metadata": {},
"outputs": [
{
"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",
" <th>color</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>count</th>\n",
" <td>6497.000000</td>\n",
" <td>6497.000000</td>\n",
" <td>6497.000000</td>\n",
" <td>6497.000000</td>\n",
" <td>6497.000000</td>\n",
" <td>6497.000000</td>\n",
" <td>6497.000000</td>\n",
" <td>6497.000000</td>\n",
" <td>6497.000000</td>\n",
" <td>6497.000000</td>\n",
" <td>6497.000000</td>\n",
" <td>6497.000000</td>\n",
" <td>6497.000000</td>\n",
" </tr>\n",
" <tr>\n",
" <th>mean</th>\n",
" <td>7.215307</td>\n",
" <td>0.339666</td>\n",
" <td>0.318633</td>\n",
" <td>5.443235</td>\n",
" <td>0.056034</td>\n",
" <td>30.525319</td>\n",
" <td>115.744574</td>\n",
" <td>0.994697</td>\n",
" <td>3.218501</td>\n",
" <td>0.531268</td>\n",
" <td>10.491801</td>\n",
" <td>5.818378</td>\n",
" <td>0.753886</td>\n",
" </tr>\n",
" <tr>\n",
" <th>std</th>\n",
" <td>1.296434</td>\n",
" <td>0.164636</td>\n",
" <td>0.145318</td>\n",
" <td>4.757804</td>\n",
" <td>0.035034</td>\n",
" <td>17.749400</td>\n",
" <td>56.521855</td>\n",
" <td>0.002999</td>\n",
" <td>0.160787</td>\n",
" <td>0.148806</td>\n",
" <td>1.192712</td>\n",
" <td>0.873255</td>\n",
" <td>0.430779</td>\n",
" </tr>\n",
" <tr>\n",
" <th>min</th>\n",
" <td>3.800000</td>\n",
" <td>0.080000</td>\n",
" <td>0.000000</td>\n",
" <td>0.600000</td>\n",
" <td>0.009000</td>\n",
" <td>1.000000</td>\n",
" <td>6.000000</td>\n",
" <td>0.987110</td>\n",
" <td>2.720000</td>\n",
" <td>0.220000</td>\n",
" <td>8.000000</td>\n",
" <td>3.000000</td>\n",
" <td>0.000000</td>\n",
" </tr>\n",
" <tr>\n",
" <th>25%</th>\n",
" <td>6.400000</td>\n",
" <td>0.230000</td>\n",
" <td>0.250000</td>\n",
" <td>1.800000</td>\n",
" <td>0.038000</td>\n",
" <td>17.000000</td>\n",
" <td>77.000000</td>\n",
" <td>0.992340</td>\n",
" <td>3.110000</td>\n",
" <td>0.430000</td>\n",
" <td>9.500000</td>\n",
" <td>5.000000</td>\n",
" <td>1.000000</td>\n",
" </tr>\n",
" <tr>\n",
" <th>50%</th>\n",
" <td>7.000000</td>\n",
" <td>0.290000</td>\n",
" <td>0.310000</td>\n",
" <td>3.000000</td>\n",
" <td>0.047000</td>\n",
" <td>29.000000</td>\n",
" <td>118.000000</td>\n",
" <td>0.994890</td>\n",
" <td>3.210000</td>\n",
" <td>0.510000</td>\n",
" <td>10.300000</td>\n",
" <td>6.000000</td>\n",
" <td>1.000000</td>\n",
" </tr>\n",
" <tr>\n",
" <th>75%</th>\n",
" <td>7.700000</td>\n",
" <td>0.400000</td>\n",
" <td>0.390000</td>\n",
" <td>8.100000</td>\n",
" <td>0.065000</td>\n",
" <td>41.000000</td>\n",
" <td>156.000000</td>\n",
" <td>0.996990</td>\n",
" <td>3.320000</td>\n",
" <td>0.600000</td>\n",
" <td>11.300000</td>\n",
" <td>6.000000</td>\n",
" <td>1.000000</td>\n",
" </tr>\n",
" <tr>\n",
" <th>max</th>\n",
" <td>15.900000</td>\n",
" <td>1.580000</td>\n",
" <td>1.660000</td>\n",
" <td>65.800000</td>\n",
" <td>0.611000</td>\n",
" <td>289.000000</td>\n",
" <td>440.000000</td>\n",
" <td>1.038980</td>\n",
" <td>4.010000</td>\n",
" <td>2.000000</td>\n",
" <td>14.900000</td>\n",
" <td>9.000000</td>\n",
" <td>1.000000</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" fixed_acidity volatile_acidity citric_acid residual_sugar \\\n",
"count 6497.000000 6497.000000 6497.000000 6497.000000 \n",
"mean 7.215307 0.339666 0.318633 5.443235 \n",
"std 1.296434 0.164636 0.145318 4.757804 \n",
"min 3.800000 0.080000 0.000000 0.600000 \n",
"25% 6.400000 0.230000 0.250000 1.800000 \n",
"50% 7.000000 0.290000 0.310000 3.000000 \n",
"75% 7.700000 0.400000 0.390000 8.100000 \n",
"max 15.900000 1.580000 1.660000 65.800000 \n",
"\n",
" chlorides free_sulfur_dioxide total_sulfur_dioxide density \\\n",
"count 6497.000000 6497.000000 6497.000000 6497.000000 \n",
"mean 0.056034 30.525319 115.744574 0.994697 \n",
"std 0.035034 17.749400 56.521855 0.002999 \n",
"min 0.009000 1.000000 6.000000 0.987110 \n",
"25% 0.038000 17.000000 77.000000 0.992340 \n",
"50% 0.047000 29.000000 118.000000 0.994890 \n",
"75% 0.065000 41.000000 156.000000 0.996990 \n",
"max 0.611000 289.000000 440.000000 1.038980 \n",
"\n",
" pH sulphates alcohol quality color \n",
"count 6497.000000 6497.000000 6497.000000 6497.000000 6497.000000 \n",
"mean 3.218501 0.531268 10.491801 5.818378 0.753886 \n",
"std 0.160787 0.148806 1.192712 0.873255 0.430779 \n",
"min 2.720000 0.220000 8.000000 3.000000 0.000000 \n",
"25% 3.110000 0.430000 9.500000 5.000000 1.000000 \n",
"50% 3.210000 0.510000 10.300000 6.000000 1.000000 \n",
"75% 3.320000 0.600000 11.300000 6.000000 1.000000 \n",
"max 4.010000 2.000000 14.900000 9.000000 1.000000 "
]
},
"execution_count": 50,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"wine_dataset.describe(include='all')"
]
},
{
"cell_type": "code",
"execution_count": 51,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<Axes: >"
]
},
"execution_count": 51,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAjMAAAGbCAYAAAAx9RHcAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy88F64QAAAACXBIWXMAAA9hAAAPYQGoP6dpAAAeNklEQVR4nO3df0xV9/3H8de9XH4J3g5RuLSG1uHEkW1F6zWQDMdMvqzZ3BZGl2URs7pqWWdGh2Omi/SXzq5LUTubudaotaYSZwbp1nRZTU2WtYtSYO2aFVmrVWM7gVIptyJwy733+4e5d15tC5dJL2/u85EY5ZzP+eRjOYc+PfdwcYRCoZAAAACMcsZ7AQAAAP8LYgYAAJhGzAAAANOIGQAAYBoxAwAATCNmAACAacQMAAAwjZgBAACmETMAAMA0V7wX8GkIhUIKBnmj40ThdDr4fAPTFNd34nA6HXI4HOMamxAxEwyGdP78YLyXgU+By+VUVlaGfL6LGh0Nxns5AK4hru/EMmtWhpKSxhczvMwEAABMI2YAAIBpxAwAADAt5pjp6elRYWHhVb9aWlokScePH1d1dbWKi4u1fPly7d+/P+r4YDCoHTt2qKysTMXFxVq7dq3Onj0bNWasOQAAAMJifgC4q6tLqampeuGFF6KeMp45c6b6+/u1evVqLV++XA8++KBeffVVPfjgg8rIyFBVVZUkaefOnWpqatLDDz8sj8ejRx55RGvWrNGzzz6rlJSUcc0BAAAQFnPMvPHGG7rpppuUk5Nz1b6nnnpKycnJ2rRpk1wulwoKCnTmzBnt2rVLVVVV8vv92rt3r+rr61VeXi5J2r59u8rKynT48GGtWLFChw4d+sQ5AAAALhfzy0z//ve/VVBQ8JH72tvbtXTpUrlc/22kkpISnT59Wn19ferq6tLg4KBKS0sj+91ut4qKitTW1jauOQAAAC43oTszWVlZWrlypU6dOqUbb7xRd911l5Y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d6AQCA6WbKPTMDAAAQC2IGAACYRswAAADTiBkAAGAaMQMAAEwjZgAAgGnEDAAAMI2YAQAApk3JdwAGACS20dFRHT58WG1tbTp37pz8fr/S09OVm5srr9eriooKJSUlxXuZmCJ4B2AAwJTy9ttv64477lBPT4+KioqUk5Oj1NRUjYyMqLe3V52dnbr++uu1e/duXX/99fFeLqYAYgYAMKXceeedCgQCevTRRzVz5syr9vt8PtXV1Sk5OVmPP/54HFaIqYaYgVmrVq2Sw+EY19j9+/dP8moAXCuLFi3SwYMHVVhY+LFjurq6tHLlSnV0dHyKK8NUxTMzMOvLX/6yfvOb32jevHn60pe+FO/lALhGZs6cqZ6enk+Mmf/85z9KS0v7FFeFqYyYgVk1NTXKzMzU1q1b9cQTT2ju3LnxXhKAa+C2227TPffco7vvvlslJSXKy8tTSkqK/H6/enp69PLLL6uxsVG33XZbvJeKKYKXmWDej370I6WkpGjHjh3xXgqAayAUCum3v/2tnnzySV28ePGq/RkZGVq5cqXuvvtuOZ28wwiIGUwDvb29ev311/XVr3413ksBcA19+OGHOn78uHp6ejQ0NKS0tDR5PB4tXLhQKSkp8V4ephBiBgAAmMb9OQAAYBoxAwAATCNmAACAacQMAAAwjZgBAACmETMAAMA0YgYAAJhGzAAAANP+Hw4CsDavedeFAAAAAElFTkSuQmCC",
"text/plain": [
"<Figure size 640x480 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"wine_dataset[\"color\"].value_counts().plot(kind=\"bar\")\n",
"\n",
"\n"
]
},
{
"cell_type": "code",
"execution_count": 52,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"1.2964337577998153"
]
},
"execution_count": 52,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"wine_dataset[\"fixed_acidity\"].std()"
]
},
{
"cell_type": "code",
"execution_count": 53,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"(array([], dtype=int64), array([], dtype=int64))"
]
},
"execution_count": 53,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"import numpy as np\n",
"np.where(pd.isnull(wine_dataset))## sprawdzanie czy istnieją puste wartości"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": 54,
"metadata": {},
"outputs": [],
"source": [
"for column in wine_dataset.columns:\n",
" wine_dataset[column] = wine_dataset[column] / wine_dataset[column].abs().max() # normalizacja"
]
},
{
"cell_type": "code",
"execution_count": 55,
"metadata": {},
"outputs": [
{
"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",
" <th>color</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>count</th>\n",
" <td>6497.000000</td>\n",
" <td>6497.000000</td>\n",
" <td>6497.000000</td>\n",
" <td>6497.000000</td>\n",
" <td>6497.000000</td>\n",
" <td>6497.000000</td>\n",
" <td>6497.000000</td>\n",
" <td>6497.000000</td>\n",
" <td>6497.000000</td>\n",
" <td>6497.000000</td>\n",
" <td>6497.000000</td>\n",
" <td>6497.000000</td>\n",
" <td>6497.000000</td>\n",
" </tr>\n",
" <tr>\n",
" <th>mean</th>\n",
" <td>0.453793</td>\n",
" <td>0.214978</td>\n",
" <td>0.191948</td>\n",
" <td>0.082724</td>\n",
" <td>0.091708</td>\n",
" <td>0.105624</td>\n",
" <td>0.263056</td>\n",
" <td>0.957378</td>\n",
" <td>0.802619</td>\n",
" <td>0.265634</td>\n",
" <td>0.704148</td>\n",
" <td>0.646486</td>\n",
" <td>0.753886</td>\n",
" </tr>\n",
" <tr>\n",
" <th>std</th>\n",
" <td>0.081537</td>\n",
" <td>0.104200</td>\n",
" <td>0.087541</td>\n",
" <td>0.072307</td>\n",
" <td>0.057338</td>\n",
" <td>0.061417</td>\n",
" <td>0.128459</td>\n",
" <td>0.002886</td>\n",
" <td>0.040097</td>\n",
" <td>0.074403</td>\n",
" <td>0.080048</td>\n",
" <td>0.097028</td>\n",
" <td>0.430779</td>\n",
" </tr>\n",
" <tr>\n",
" <th>min</th>\n",
" <td>0.238994</td>\n",
" <td>0.050633</td>\n",
" <td>0.000000</td>\n",
" <td>0.009119</td>\n",
" <td>0.014730</td>\n",
" <td>0.003460</td>\n",
" <td>0.013636</td>\n",
" <td>0.950076</td>\n",
" <td>0.678304</td>\n",
" <td>0.110000</td>\n",
" <td>0.536913</td>\n",
" <td>0.333333</td>\n",
" <td>0.000000</td>\n",
" </tr>\n",
" <tr>\n",
" <th>25%</th>\n",
" <td>0.402516</td>\n",
" <td>0.145570</td>\n",
" <td>0.150602</td>\n",
" <td>0.027356</td>\n",
" <td>0.062193</td>\n",
" <td>0.058824</td>\n",
" <td>0.175000</td>\n",
" <td>0.955110</td>\n",
" <td>0.775561</td>\n",
" <td>0.215000</td>\n",
" <td>0.637584</td>\n",
" <td>0.555556</td>\n",
" <td>1.000000</td>\n",
" </tr>\n",
" <tr>\n",
" <th>50%</th>\n",
" <td>0.440252</td>\n",
" <td>0.183544</td>\n",
" <td>0.186747</td>\n",
" <td>0.045593</td>\n",
" <td>0.076923</td>\n",
" <td>0.100346</td>\n",
" <td>0.268182</td>\n",
" <td>0.957564</td>\n",
" <td>0.800499</td>\n",
" <td>0.255000</td>\n",
" <td>0.691275</td>\n",
" <td>0.666667</td>\n",
" <td>1.000000</td>\n",
" </tr>\n",
" <tr>\n",
" <th>75%</th>\n",
" <td>0.484277</td>\n",
" <td>0.253165</td>\n",
" <td>0.234940</td>\n",
" <td>0.123100</td>\n",
" <td>0.106383</td>\n",
" <td>0.141869</td>\n",
" <td>0.354545</td>\n",
" <td>0.959585</td>\n",
" <td>0.827930</td>\n",
" <td>0.300000</td>\n",
" <td>0.758389</td>\n",
" <td>0.666667</td>\n",
" <td>1.000000</td>\n",
" </tr>\n",
" <tr>\n",
" <th>max</th>\n",
" <td>1.000000</td>\n",
" <td>1.000000</td>\n",
" <td>1.000000</td>\n",
" <td>1.000000</td>\n",
" <td>1.000000</td>\n",
" <td>1.000000</td>\n",
" <td>1.000000</td>\n",
" <td>1.000000</td>\n",
" <td>1.000000</td>\n",
" <td>1.000000</td>\n",
" <td>1.000000</td>\n",
" <td>1.000000</td>\n",
" <td>1.000000</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" fixed_acidity volatile_acidity citric_acid residual_sugar \\\n",
"count 6497.000000 6497.000000 6497.000000 6497.000000 \n",
"mean 0.453793 0.214978 0.191948 0.082724 \n",
"std 0.081537 0.104200 0.087541 0.072307 \n",
"min 0.238994 0.050633 0.000000 0.009119 \n",
"25% 0.402516 0.145570 0.150602 0.027356 \n",
"50% 0.440252 0.183544 0.186747 0.045593 \n",
"75% 0.484277 0.253165 0.234940 0.123100 \n",
"max 1.000000 1.000000 1.000000 1.000000 \n",
"\n",
" chlorides free_sulfur_dioxide total_sulfur_dioxide density \\\n",
"count 6497.000000 6497.000000 6497.000000 6497.000000 \n",
"mean 0.091708 0.105624 0.263056 0.957378 \n",
"std 0.057338 0.061417 0.128459 0.002886 \n",
"min 0.014730 0.003460 0.013636 0.950076 \n",
"25% 0.062193 0.058824 0.175000 0.955110 \n",
"50% 0.076923 0.100346 0.268182 0.957564 \n",
"75% 0.106383 0.141869 0.354545 0.959585 \n",
"max 1.000000 1.000000 1.000000 1.000000 \n",
"\n",
" pH sulphates alcohol quality color \n",
"count 6497.000000 6497.000000 6497.000000 6497.000000 6497.000000 \n",
"mean 0.802619 0.265634 0.704148 0.646486 0.753886 \n",
"std 0.040097 0.074403 0.080048 0.097028 0.430779 \n",
"min 0.678304 0.110000 0.536913 0.333333 0.000000 \n",
"25% 0.775561 0.215000 0.637584 0.555556 1.000000 \n",
"50% 0.800499 0.255000 0.691275 0.666667 1.000000 \n",
"75% 0.827930 0.300000 0.758389 0.666667 1.000000 \n",
"max 1.000000 1.000000 1.000000 1.000000 1.000000 "
]
},
"execution_count": 55,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"wine_dataset.describe(include='all') # sprawdzanie wartości po znormalizowaniu"
]
},
{
"cell_type": "code",
"execution_count": 56,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"652 1.000000\n",
"442 0.981132\n",
"557 0.981132\n",
"554 0.974843\n",
"555 0.974843\n",
"243 0.943396\n",
"244 0.943396\n",
"544 0.899371\n",
"3125 0.893082\n",
"374 0.880503\n",
"Name: fixed_acidity, dtype: float64"
]
},
"execution_count": 56,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"wine_dataset[\"fixed_acidity\"].nlargest(10) #sprawdza czy najwyższe wartości mają sens"
]
},
{
"cell_type": "code",
"execution_count": 57,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"1.0 4408\n",
"0.0 1439\n",
"Name: color, dtype: int64"
]
},
"execution_count": 57,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"from sklearn.model_selection import train_test_split\n",
"wine_train, wine_test = sklearn.model_selection.train_test_split(wine_dataset, test_size=0.1, random_state=1, stratify=wine_dataset[\"color\"])\n",
"wine_train[\"color\"].value_counts() \n",
"# podzielenie na train i test"
]
},
{
"cell_type": "code",
"execution_count": 58,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"1.0 490\n",
"0.0 160\n",
"Name: color, dtype: int64"
]
},
"execution_count": 58,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"wine_test[\"color\"].value_counts()"
]
},
{
"cell_type": "code",
"execution_count": 59,
"metadata": {},
"outputs": [],
"source": [
"wine_test, wine_val = sklearn.model_selection.train_test_split(wine_test, test_size=0.5, random_state=1, stratify=wine_test[\"color\"]) # podzielenie na test i validation"
]
},
{
"cell_type": "code",
"execution_count": 60,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"1.0 245\n",
"0.0 80\n",
"Name: color, dtype: int64"
]
},
"execution_count": 60,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"wine_test[\"color\"].value_counts()"
]
},
{
"cell_type": "code",
"execution_count": 61,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"1.0 245\n",
"0.0 80\n",
"Name: color, dtype: int64"
]
},
"execution_count": 61,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"wine_val[\"color\"].value_counts()"
]
},
{
"cell_type": "code",
"execution_count": 62,
"metadata": {},
"outputs": [],
"source": [
"import seaborn as sns\n",
"sns.set_theme()"
]
},
{
"cell_type": "code",
"execution_count": 63,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"13"
]
},
"execution_count": 63,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"len(wine_dataset.columns)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": 64,
"metadata": {},
"outputs": [],
"source": [
"sns.pairplot(data=wine_dataset, hue=\"color\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [
{
"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",
" <th>color</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>count</th>\n",
" <td>325.000000</td>\n",
" <td>325.000000</td>\n",
" <td>325.000000</td>\n",
" <td>325.000000</td>\n",
" <td>325.000000</td>\n",
" <td>325.000000</td>\n",
" <td>325.000000</td>\n",
" <td>325.000000</td>\n",
" <td>325.000000</td>\n",
" <td>325.000000</td>\n",
" <td>325.000000</td>\n",
" <td>325.000000</td>\n",
" <td>325.000000</td>\n",
" </tr>\n",
" <tr>\n",
" <th>mean</th>\n",
" <td>7.127077</td>\n",
" <td>0.342969</td>\n",
" <td>0.299846</td>\n",
" <td>5.197538</td>\n",
" <td>0.054222</td>\n",
" <td>29.773846</td>\n",
" <td>113.283077</td>\n",
" <td>0.994568</td>\n",
" <td>3.222246</td>\n",
" <td>0.527754</td>\n",
" <td>10.488564</td>\n",
" <td>5.815385</td>\n",
" <td>0.753846</td>\n",
" </tr>\n",
" <tr>\n",
" <th>std</th>\n",
" <td>1.181391</td>\n",
" <td>0.170050</td>\n",
" <td>0.129556</td>\n",
" <td>4.608978</td>\n",
" <td>0.031405</td>\n",
" <td>15.822670</td>\n",
" <td>55.072566</td>\n",
" <td>0.002895</td>\n",
" <td>0.159630</td>\n",
" <td>0.144550</td>\n",
" <td>1.172682</td>\n",
" <td>0.855128</td>\n",
" <td>0.431433</td>\n",
" </tr>\n",
" <tr>\n",
" <th>min</th>\n",
" <td>5.000000</td>\n",
" <td>0.100000</td>\n",
" <td>0.000000</td>\n",
" <td>0.800000</td>\n",
" <td>0.019000</td>\n",
" <td>3.000000</td>\n",
" <td>9.000000</td>\n",
" <td>0.988190</td>\n",
" <td>2.860000</td>\n",
" <td>0.260000</td>\n",
" <td>8.500000</td>\n",
" <td>3.000000</td>\n",
" <td>0.000000</td>\n",
" </tr>\n",
" <tr>\n",
" <th>25%</th>\n",
" <td>6.400000</td>\n",
" <td>0.230000</td>\n",
" <td>0.240000</td>\n",
" <td>1.800000</td>\n",
" <td>0.037000</td>\n",
" <td>17.000000</td>\n",
" <td>74.000000</td>\n",
" <td>0.992400</td>\n",
" <td>3.110000</td>\n",
" <td>0.420000</td>\n",
" <td>9.500000</td>\n",
" <td>5.000000</td>\n",
" <td>1.000000</td>\n",
" </tr>\n",
" <tr>\n",
" <th>50%</th>\n",
" <td>6.900000</td>\n",
" <td>0.280000</td>\n",
" <td>0.300000</td>\n",
" <td>2.800000</td>\n",
" <td>0.048000</td>\n",
" <td>29.000000</td>\n",
" <td>115.000000</td>\n",
" <td>0.994800</td>\n",
" <td>3.210000</td>\n",
" <td>0.500000</td>\n",
" <td>10.300000</td>\n",
" <td>6.000000</td>\n",
" <td>1.000000</td>\n",
" </tr>\n",
" <tr>\n",
" <th>75%</th>\n",
" <td>7.500000</td>\n",
" <td>0.400000</td>\n",
" <td>0.370000</td>\n",
" <td>7.500000</td>\n",
" <td>0.062000</td>\n",
" <td>41.000000</td>\n",
" <td>151.000000</td>\n",
" <td>0.996750</td>\n",
" <td>3.320000</td>\n",
" <td>0.600000</td>\n",
" <td>11.300000</td>\n",
" <td>6.000000</td>\n",
" <td>1.000000</td>\n",
" </tr>\n",
" <tr>\n",
" <th>max</th>\n",
" <td>13.000000</td>\n",
" <td>0.900000</td>\n",
" <td>0.740000</td>\n",
" <td>22.000000</td>\n",
" <td>0.415000</td>\n",
" <td>67.000000</td>\n",
" <td>253.000000</td>\n",
" <td>1.002890</td>\n",
" <td>3.680000</td>\n",
" <td>1.170000</td>\n",
" <td>14.000000</td>\n",
" <td>9.000000</td>\n",
" <td>1.000000</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" fixed_acidity volatile_acidity citric_acid residual_sugar \\\n",
"count 325.000000 325.000000 325.000000 325.000000 \n",
"mean 7.127077 0.342969 0.299846 5.197538 \n",
"std 1.181391 0.170050 0.129556 4.608978 \n",
"min 5.000000 0.100000 0.000000 0.800000 \n",
"25% 6.400000 0.230000 0.240000 1.800000 \n",
"50% 6.900000 0.280000 0.300000 2.800000 \n",
"75% 7.500000 0.400000 0.370000 7.500000 \n",
"max 13.000000 0.900000 0.740000 22.000000 \n",
"\n",
" chlorides free_sulfur_dioxide total_sulfur_dioxide density \\\n",
"count 325.000000 325.000000 325.000000 325.000000 \n",
"mean 0.054222 29.773846 113.283077 0.994568 \n",
"std 0.031405 15.822670 55.072566 0.002895 \n",
"min 0.019000 3.000000 9.000000 0.988190 \n",
"25% 0.037000 17.000000 74.000000 0.992400 \n",
"50% 0.048000 29.000000 115.000000 0.994800 \n",
"75% 0.062000 41.000000 151.000000 0.996750 \n",
"max 0.415000 67.000000 253.000000 1.002890 \n",
"\n",
" pH sulphates alcohol quality color \n",
"count 325.000000 325.000000 325.000000 325.000000 325.000000 \n",
"mean 3.222246 0.527754 10.488564 5.815385 0.753846 \n",
"std 0.159630 0.144550 1.172682 0.855128 0.431433 \n",
"min 2.860000 0.260000 8.500000 3.000000 0.000000 \n",
"25% 3.110000 0.420000 9.500000 5.000000 1.000000 \n",
"50% 3.210000 0.500000 10.300000 6.000000 1.000000 \n",
"75% 3.320000 0.600000 11.300000 6.000000 1.000000 \n",
"max 3.680000 1.170000 14.000000 9.000000 1.000000 "
]
},
"execution_count": 44,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"wine_test.describe()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [
{
"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",
" <th>color</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>count</th>\n",
" <td>5847.000000</td>\n",
" <td>5847.000000</td>\n",
" <td>5847.000000</td>\n",
" <td>5847.000000</td>\n",
" <td>5847.000000</td>\n",
" <td>5847.000000</td>\n",
" <td>5847.000000</td>\n",
" <td>5847.000000</td>\n",
" <td>5847.000000</td>\n",
" <td>5847.000000</td>\n",
" <td>5847.000000</td>\n",
" <td>5847.000000</td>\n",
" <td>5847.000000</td>\n",
" </tr>\n",
" <tr>\n",
" <th>mean</th>\n",
" <td>7.216179</td>\n",
" <td>0.339796</td>\n",
" <td>0.319111</td>\n",
" <td>5.417402</td>\n",
" <td>0.056310</td>\n",
" <td>30.535403</td>\n",
" <td>115.673508</td>\n",
" <td>0.994682</td>\n",
" <td>3.218303</td>\n",
" <td>0.531596</td>\n",
" <td>10.494455</td>\n",
" <td>5.820592</td>\n",
" <td>0.753891</td>\n",
" </tr>\n",
" <tr>\n",
" <th>std</th>\n",
" <td>1.299695</td>\n",
" <td>0.164817</td>\n",
" <td>0.146141</td>\n",
" <td>4.736399</td>\n",
" <td>0.035816</td>\n",
" <td>17.845522</td>\n",
" <td>56.432512</td>\n",
" <td>0.002995</td>\n",
" <td>0.159919</td>\n",
" <td>0.149728</td>\n",
" <td>1.189801</td>\n",
" <td>0.872353</td>\n",
" <td>0.430780</td>\n",
" </tr>\n",
" <tr>\n",
" <th>min</th>\n",
" <td>3.800000</td>\n",
" <td>0.080000</td>\n",
" <td>0.000000</td>\n",
" <td>0.600000</td>\n",
" <td>0.009000</td>\n",
" <td>1.000000</td>\n",
" <td>6.000000</td>\n",
" <td>0.987110</td>\n",
" <td>2.720000</td>\n",
" <td>0.220000</td>\n",
" <td>8.000000</td>\n",
" <td>3.000000</td>\n",
" <td>0.000000</td>\n",
" </tr>\n",
" <tr>\n",
" <th>25%</th>\n",
" <td>6.400000</td>\n",
" <td>0.230000</td>\n",
" <td>0.250000</td>\n",
" <td>1.800000</td>\n",
" <td>0.038000</td>\n",
" <td>17.000000</td>\n",
" <td>77.500000</td>\n",
" <td>0.992300</td>\n",
" <td>3.110000</td>\n",
" <td>0.430000</td>\n",
" <td>9.500000</td>\n",
" <td>5.000000</td>\n",
" <td>1.000000</td>\n",
" </tr>\n",
" <tr>\n",
" <th>50%</th>\n",
" <td>7.000000</td>\n",
" <td>0.290000</td>\n",
" <td>0.310000</td>\n",
" <td>3.000000</td>\n",
" <td>0.047000</td>\n",
" <td>29.000000</td>\n",
" <td>118.000000</td>\n",
" <td>0.994840</td>\n",
" <td>3.210000</td>\n",
" <td>0.510000</td>\n",
" <td>10.300000</td>\n",
" <td>6.000000</td>\n",
" <td>1.000000</td>\n",
" </tr>\n",
" <tr>\n",
" <th>75%</th>\n",
" <td>7.700000</td>\n",
" <td>0.400000</td>\n",
" <td>0.390000</td>\n",
" <td>8.100000</td>\n",
" <td>0.065000</td>\n",
" <td>41.000000</td>\n",
" <td>155.500000</td>\n",
" <td>0.996985</td>\n",
" <td>3.320000</td>\n",
" <td>0.600000</td>\n",
" <td>11.300000</td>\n",
" <td>6.000000</td>\n",
" <td>1.000000</td>\n",
" </tr>\n",
" <tr>\n",
" <th>max</th>\n",
" <td>15.900000</td>\n",
" <td>1.580000</td>\n",
" <td>1.660000</td>\n",
" <td>65.800000</td>\n",
" <td>0.611000</td>\n",
" <td>289.000000</td>\n",
" <td>440.000000</td>\n",
" <td>1.038980</td>\n",
" <td>4.010000</td>\n",
" <td>2.000000</td>\n",
" <td>14.900000</td>\n",
" <td>9.000000</td>\n",
" <td>1.000000</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" fixed_acidity volatile_acidity citric_acid residual_sugar \\\n",
"count 5847.000000 5847.000000 5847.000000 5847.000000 \n",
"mean 7.216179 0.339796 0.319111 5.417402 \n",
"std 1.299695 0.164817 0.146141 4.736399 \n",
"min 3.800000 0.080000 0.000000 0.600000 \n",
"25% 6.400000 0.230000 0.250000 1.800000 \n",
"50% 7.000000 0.290000 0.310000 3.000000 \n",
"75% 7.700000 0.400000 0.390000 8.100000 \n",
"max 15.900000 1.580000 1.660000 65.800000 \n",
"\n",
" chlorides free_sulfur_dioxide total_sulfur_dioxide density \\\n",
"count 5847.000000 5847.000000 5847.000000 5847.000000 \n",
"mean 0.056310 30.535403 115.673508 0.994682 \n",
"std 0.035816 17.845522 56.432512 0.002995 \n",
"min 0.009000 1.000000 6.000000 0.987110 \n",
"25% 0.038000 17.000000 77.500000 0.992300 \n",
"50% 0.047000 29.000000 118.000000 0.994840 \n",
"75% 0.065000 41.000000 155.500000 0.996985 \n",
"max 0.611000 289.000000 440.000000 1.038980 \n",
"\n",
" pH sulphates alcohol quality color \n",
"count 5847.000000 5847.000000 5847.000000 5847.000000 5847.000000 \n",
"mean 3.218303 0.531596 10.494455 5.820592 0.753891 \n",
"std 0.159919 0.149728 1.189801 0.872353 0.430780 \n",
"min 2.720000 0.220000 8.000000 3.000000 0.000000 \n",
"25% 3.110000 0.430000 9.500000 5.000000 1.000000 \n",
"50% 3.210000 0.510000 10.300000 6.000000 1.000000 \n",
"75% 3.320000 0.600000 11.300000 6.000000 1.000000 \n",
"max 4.010000 2.000000 14.900000 9.000000 1.000000 "
]
},
"execution_count": 26,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"wine_train.describe()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [
{
"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",
" <th>color</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>count</th>\n",
" <td>325.000000</td>\n",
" <td>325.000000</td>\n",
" <td>325.000000</td>\n",
" <td>325.000000</td>\n",
" <td>325.000000</td>\n",
" <td>325.000000</td>\n",
" <td>325.000000</td>\n",
" <td>325.000000</td>\n",
" <td>325.000000</td>\n",
" <td>325.000000</td>\n",
" <td>325.000000</td>\n",
" <td>325.000000</td>\n",
" <td>325.000000</td>\n",
" </tr>\n",
" <tr>\n",
" <th>mean</th>\n",
" <td>7.287846</td>\n",
" <td>0.334031</td>\n",
" <td>0.328831</td>\n",
" <td>6.153692</td>\n",
" <td>0.052874</td>\n",
" <td>31.095385</td>\n",
" <td>119.484615</td>\n",
" <td>0.995091</td>\n",
" <td>3.218308</td>\n",
" <td>0.528892</td>\n",
" <td>10.447282</td>\n",
" <td>5.781538</td>\n",
" <td>0.753846</td>\n",
" </tr>\n",
" <tr>\n",
" <th>std</th>\n",
" <td>1.345471</td>\n",
" <td>0.156023</td>\n",
" <td>0.144192</td>\n",
" <td>5.220944</td>\n",
" <td>0.021471</td>\n",
" <td>17.861741</td>\n",
" <td>59.481580</td>\n",
" <td>0.003150</td>\n",
" <td>0.177176</td>\n",
" <td>0.136171</td>\n",
" <td>1.265593</td>\n",
" <td>0.908617</td>\n",
" <td>0.431433</td>\n",
" </tr>\n",
" <tr>\n",
" <th>min</th>\n",
" <td>4.700000</td>\n",
" <td>0.090000</td>\n",
" <td>0.000000</td>\n",
" <td>0.800000</td>\n",
" <td>0.012000</td>\n",
" <td>3.000000</td>\n",
" <td>8.000000</td>\n",
" <td>0.987460</td>\n",
" <td>2.870000</td>\n",
" <td>0.280000</td>\n",
" <td>8.400000</td>\n",
" <td>3.000000</td>\n",
" <td>0.000000</td>\n",
" </tr>\n",
" <tr>\n",
" <th>25%</th>\n",
" <td>6.400000</td>\n",
" <td>0.230000</td>\n",
" <td>0.260000</td>\n",
" <td>2.000000</td>\n",
" <td>0.039000</td>\n",
" <td>16.000000</td>\n",
" <td>79.000000</td>\n",
" <td>0.992700</td>\n",
" <td>3.100000</td>\n",
" <td>0.430000</td>\n",
" <td>9.400000</td>\n",
" <td>5.000000</td>\n",
" <td>1.000000</td>\n",
" </tr>\n",
" <tr>\n",
" <th>50%</th>\n",
" <td>7.100000</td>\n",
" <td>0.290000</td>\n",
" <td>0.310000</td>\n",
" <td>4.550000</td>\n",
" <td>0.048000</td>\n",
" <td>29.000000</td>\n",
" <td>125.000000</td>\n",
" <td>0.995320</td>\n",
" <td>3.210000</td>\n",
" <td>0.500000</td>\n",
" <td>10.200000</td>\n",
" <td>6.000000</td>\n",
" <td>1.000000</td>\n",
" </tr>\n",
" <tr>\n",
" <th>75%</th>\n",
" <td>7.800000</td>\n",
" <td>0.400000</td>\n",
" <td>0.400000</td>\n",
" <td>8.800000</td>\n",
" <td>0.060000</td>\n",
" <td>45.000000</td>\n",
" <td>163.000000</td>\n",
" <td>0.997450</td>\n",
" <td>3.320000</td>\n",
" <td>0.610000</td>\n",
" <td>11.300000</td>\n",
" <td>6.000000</td>\n",
" <td>1.000000</td>\n",
" </tr>\n",
" <tr>\n",
" <th>max</th>\n",
" <td>15.000000</td>\n",
" <td>1.180000</td>\n",
" <td>0.740000</td>\n",
" <td>31.600000</td>\n",
" <td>0.170000</td>\n",
" <td>77.000000</td>\n",
" <td>251.000000</td>\n",
" <td>1.010300</td>\n",
" <td>4.010000</td>\n",
" <td>1.140000</td>\n",
" <td>14.000000</td>\n",
" <td>8.000000</td>\n",
" <td>1.000000</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" fixed_acidity volatile_acidity citric_acid residual_sugar \\\n",
"count 325.000000 325.000000 325.000000 325.000000 \n",
"mean 7.287846 0.334031 0.328831 6.153692 \n",
"std 1.345471 0.156023 0.144192 5.220944 \n",
"min 4.700000 0.090000 0.000000 0.800000 \n",
"25% 6.400000 0.230000 0.260000 2.000000 \n",
"50% 7.100000 0.290000 0.310000 4.550000 \n",
"75% 7.800000 0.400000 0.400000 8.800000 \n",
"max 15.000000 1.180000 0.740000 31.600000 \n",
"\n",
" chlorides free_sulfur_dioxide total_sulfur_dioxide density \\\n",
"count 325.000000 325.000000 325.000000 325.000000 \n",
"mean 0.052874 31.095385 119.484615 0.995091 \n",
"std 0.021471 17.861741 59.481580 0.003150 \n",
"min 0.012000 3.000000 8.000000 0.987460 \n",
"25% 0.039000 16.000000 79.000000 0.992700 \n",
"50% 0.048000 29.000000 125.000000 0.995320 \n",
"75% 0.060000 45.000000 163.000000 0.997450 \n",
"max 0.170000 77.000000 251.000000 1.010300 \n",
"\n",
" pH sulphates alcohol quality color \n",
"count 325.000000 325.000000 325.000000 325.000000 325.000000 \n",
"mean 3.218308 0.528892 10.447282 5.781538 0.753846 \n",
"std 0.177176 0.136171 1.265593 0.908617 0.431433 \n",
"min 2.870000 0.280000 8.400000 3.000000 0.000000 \n",
"25% 3.100000 0.430000 9.400000 5.000000 1.000000 \n",
"50% 3.210000 0.500000 10.200000 6.000000 1.000000 \n",
"75% 3.320000 0.610000 11.300000 6.000000 1.000000 \n",
"max 4.010000 1.140000 14.000000 8.000000 1.000000 "
]
},
"execution_count": 27,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"wine_val.describe()"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.10"
},
"orig_nbformat": 4
},
"nbformat": 4,
"nbformat_minor": 2
}