{ "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": "35c4ed64-62c4-47f9-a407-571b072bf831" }, "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 282k 0 --:--:-- --:--:-- --:--:-- 281k\n" ], "name": "stdout" } ] }, { "cell_type": "code", "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 419 }, "id": "sAUNi0ylxWUm", "outputId": "27072275-680f-4154-bdf2-e952a63ab25e" }, "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": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
fixed acidityvolatile aciditycitric acidresidual sugarchloridesfree sulfur dioxidetotal sulfur dioxidedensitypHsulphatesalcoholquality
07.40.7000.001.90.07611.034.00.997803.510.569.45
17.80.8800.002.60.09825.067.00.996803.200.689.85
27.80.7600.042.30.09215.054.00.997003.260.659.85
311.20.2800.561.90.07517.060.00.998003.160.589.86
47.40.7000.001.90.07611.034.00.997803.510.569.45
.......................................
15946.20.6000.082.00.09032.044.00.994903.450.5810.55
15955.90.5500.102.20.06239.051.00.995123.520.7611.26
15966.30.5100.132.30.07629.040.00.995743.420.7511.06
15975.90.6450.122.00.07532.044.00.995473.570.7110.25
15986.00.3100.473.60.06718.042.00.995493.390.6611.06
\n", "

1599 rows × 12 columns

\n", "
" ], "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": "markdown", "metadata": { "id": "nZO_naLatT0o" }, "source": [ "Próbowałem również podzielić na podzbiory Train:Dev:Test 6:2:2 Przy pomocy basha ale uznałem, że wygodniejsze jest korzystanie z \"train_test_split()\". Docelowo podział będzie dokonywany na 4 zmienne ` X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.33, random_state=42)`, jednak chciałem zachować konwencje z przykładu, z ćwiczeń." ] }, { "cell_type": "markdown", "metadata": { "id": "ebHl5Aw1uuK1" }, "source": [ "https://scikit-learn.org/stable/modules/generated/sklearn.model_selection.train_test_split.html" ] }, { "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": "0035e197-98c9-4a15-c1f9-23742d6a0595" }, "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": "6302469b-8853-45ea-b4d4-eae6078e96cf" }, "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": "edcf5523-066f-4c75-bc9c-1628a413edf7" }, "source": [ "wine_train" ], "execution_count": 7, "outputs": [ { "output_type": "execute_result", "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
fixed acidityvolatile aciditycitric acidresidual sugarchloridesfree sulfur dioxidetotal sulfur dioxidedensitypHsulphatesalcoholquality
15896.60.7250.207.80.07329.079.00.997703.290.549.25
8549.30.3600.391.50.08041.055.00.996523.470.7310.96
837.30.6700.261.80.40116.051.00.996903.161.149.45
11068.20.2300.421.90.0699.017.00.993763.210.5412.36
65010.70.4300.392.20.1068.032.00.998602.890.509.65
.......................................
5267.30.3650.492.50.08839.0106.00.996603.360.7811.05
58312.00.2800.491.90.07410.021.00.997602.980.669.97
9757.20.4100.302.10.08335.072.00.997003.440.529.45
5668.70.7000.242.50.2265.015.00.999103.320.609.06
12327.60.4300.292.10.07519.066.00.997183.400.649.55
\n", "

959 rows × 12 columns

\n", "
" ], "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": "9d7d799f-7018-4b9d-9d4c-153abe0a53f3" }, "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": "cb7c369c-9bdd-457a-98fe-3537c569730b" }, "source": [ "wine_train.describe(include='all')" ], "execution_count": 9, "outputs": [ { "output_type": "execute_result", "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
fixed acidityvolatile aciditycitric acidresidual sugarchloridesfree sulfur dioxidetotal sulfur dioxidedensitypHsulphatesalcoholquality
count959.000000959.000000959.000000959.000000959.000000959.000000959.000000959.000000959.00000959.000000959.000000959.000000
mean8.3290930.5268090.2698642.4937430.08823015.88373345.7387900.9967363.310480.66148110.4331605.657977
std1.8083940.1752210.1983771.2623290.05055510.48573931.8970950.0019250.154620.1716391.0843490.805654
min4.6000000.1200000.0000000.9000000.0120001.0000006.0000000.9900702.740000.3700008.4000003.000000
25%7.1000000.4000000.0900001.9000000.0700007.00000022.0000000.9955403.210000.5500009.5000005.000000
50%7.9000000.5200000.2500002.2000000.07900014.00000037.0000000.9967703.310000.62000010.1000006.000000
75%9.3000000.6350000.4300002.6000000.09000022.00000061.0000000.9978703.400000.73000011.1000006.000000
max15.9000001.3300001.00000015.4000000.61000072.000000278.0000001.0036904.010002.00000014.9000008.000000
\n", "
" ], "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": "markdown", "metadata": { "id": "JWXJ2CZQuylE" }, "source": [ "Testowy Wykres (quality, volatile acidity)" ] }, { "cell_type": "code", "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 405 }, "id": "HbsfwCL7XpNe", "outputId": "3e95f7ba-b73f-4861-e3a5-c3ec3029e3a5" }, "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": [ "" ] }, "metadata": { "tags": [] }, "execution_count": 10 }, { "output_type": "display_data", "data": { "image/png": "iVBORw0KGgoAAAANS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e192fS/LKJN8yONNRo4RNrKq2VNV9Z8/vmeSRSd49NtVy6+6f6e5Tu/v0rE4ZvK67l+Yvp0VUVSdW1Ul3PE/ynUneNTbVcuvulSQ3V9X9Z7sekeT6gZE2kotiKnK9vD/JQ6rqXrMvuj0iyQ2DMx01k14xnyTJVyR5yeybNMcluby7XTKBZfPlSV61+t/IbE7y0u7+k7GRNoQfT/L7s+mxG5M8YXCepTf7I+ORSX50dJaNoLvfUlVXJHlrktuSvC1LdOV8l6gAABjAdCQAwABKGADAAEoYAMAAShgAwABKGADAAEoYwExVnV5V75o931ZVvzx7/vCqWpoLRAKLwXXCAA6gu3cl2TXbfHiSTyT562GBgKXjTBiwFKrqGVX1d1X1V1X1sqr66ap6Q1Vtmx0/eXYrqzvOeP1lVb119nOXs1yzs19/XFWnJ/mxJE+tqmur6tuq6r1VdY/ZuHuv3QaYlzNhwDGvqr4xq7eoemBW/7v21iSHuoH7LUke2d2fqaozs3oLmm0HGtjd76uqX0/yie5+3uz93pDku5L84ex9Xzm7rx3A3JwJA5bBtyV5VXd/qrs/luTKw4y/R5LfqKp3JnlFkrOO8P1elH+5RdATkrz4CH8fwJkwYKndln/5Y/OENfufmuQfk3zD7PhnjuRFu/tNsynNhyfZ1N1uVg4cMWfCgGXwF0n+Y1Xds6pOSvLds/3vS/KNs+ePXTP+Pkk+0N23J3l8kk2Hef2PJzlpv32/k+SlcRYMuJuUMOCY191vTfIHSd6e5DVJrp4del6S/1JVb0ty8ppf+dUkP1RVb0/yNUk+eZi3eHWS/3THwvzZvt9P8sVZXU8GcMSqu0dnADiqqurnsmYh/UTv8dgkF3T346d6D2C5WRMGcISq6gVJzkvyqNFZgGOXM2EAAANYEwYAMIASBgAwgBIGADCAEgYAMIASBgAwgBIGADDA/wcZSI2TQNquRgAAAABJRU5ErkJggg==\n", "text/plain": [ "
" ] }, "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": "b5751c9a-6f9e-48b8-88c2-0b6feec17af9" }, "source": [ "wine_test" ], "execution_count": 11, "outputs": [ { "output_type": "execute_result", "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
fixed acidityvolatile aciditycitric acidresidual sugarchloridesfree sulfur dioxidetotal sulfur dioxidedensitypHsulphatesalcoholquality
758.80.4100.642.20.0939.042.00.998603.540.6610.55
12838.70.6300.282.70.09617.069.00.997343.260.6310.26
40810.40.3400.583.70.1746.016.00.997003.190.7011.36
12817.10.4600.201.90.07728.054.00.995603.370.6410.46
11187.10.3900.122.10.06514.024.00.992523.300.5313.36
.......................................
14616.20.7850.002.10.0606.013.00.996643.590.6110.04
10168.90.3800.402.20.06812.028.00.994863.270.7512.67
14128.20.2400.345.10.0628.022.00.997403.220.9410.96
4247.70.9600.202.00.04715.060.00.995503.360.4410.95
1207.31.0700.091.70.17810.089.00.996203.300.579.05
\n", "

360 rows × 12 columns

\n", "
" ], "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": "538fe66b-8dc1-4338-d0d8-492fbef2940e" }, "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": "78da725e-3105-4d3e-8880-00dbc8cf8910" }, "source": [ "wine_test.describe(include='all')" ], "execution_count": 13, "outputs": [ { "output_type": "execute_result", "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
fixed acidityvolatile aciditycitric acidresidual sugarchloridesfree sulfur dioxidetotal sulfur dioxidedensitypHsulphatesalcoholquality
count360.000000360.000000360.000000360.000000360.000000360.000000360.000000360.000000360.000000360.000000360.000000360.000000
mean8.3486110.5187640.2754442.5422220.08611416.09305648.7777780.9967473.3010830.65383310.3688895.586111
std1.5805740.1825540.1825081.5284650.04344510.42109735.0057780.0017920.1453790.1683061.0417290.767245
min5.0000000.1200000.0000000.9000000.0420003.0000006.0000000.9900702.8700000.3700008.7000003.000000
25%7.2000000.3800000.1200001.9000000.0700008.00000023.0000000.9957603.2100000.5500009.5000005.000000
50%8.0000000.5000000.2700002.1500000.07900014.00000040.0000000.9966453.3000000.62000010.1000006.000000
75%9.2000000.6400000.4200002.6000000.09000021.00000065.7500000.9976833.3900000.72000011.0000006.000000
max15.6000001.1150000.79000015.5000000.61100068.000000289.0000001.0036903.7500001.95000014.0000008.000000
\n", "
" ], "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": "markdown", "metadata": { "id": "wzaUXARnu824" }, "source": [ "Testowy Wykres (quality, volatile acidity)" ] }, { "cell_type": "code", "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 405 }, "id": "3GksWzExaHV7", "outputId": "e7076b4b-79b9-4c9b-a1e8-44b5897175ce" }, "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": [ "" ] }, "metadata": { "tags": [] }, "execution_count": 14 }, { "output_type": "display_data", "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAmEAAAFzCAYAAAB2A95GAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4yLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+WH4yJAAAYvklEQVR4nO3de5ClZ10n8O8vM8RANlx0Zh1Ngsm6ETcqAo4RjQIlXhLEZBdBExeilEt0lygXZSoUWyjobhUDrK6KulkE8QIRsqDBHYirCChKzISESwhYYyBkRtpMRO5gSPLbP/qM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kfzksEDB3jIQBc6GqnldVf1NVf1FVr6mqn6mqt1bV9tnxLbNbWR0Y8frzqnrX7Oceo1yz0a8/qqrTkvxEkmdV1fVV9R1V9aGqus/svPsv3QZYLSNhwDGvqr4pi7eoelgW/7v2riQr3cD91iTf3d2fr6ozsngLmu0HO7G7P1xVv5Hk0939ktn7vTXJ9yX5g9n7vn52XzuAVTMSBsyD70jyhu7+bHd/MsmVhzn/Pkn+d1W9N8nrkpx5hO/38vzLLYKemuSVR/j7AEbCgLl2R/7lj80Tlux/VpK/T/KNs+OfP5IX7e53zKY0H5NkU3e7WTlwxIyEAfPg7Un+fVXdt6pOSvL9s/0fTvJNs+dPXHL+A5J8tLvvSvKUJJsO8/qfSnLSsn2/neTVMQoG3EtKGHDM6+53Jfn9JO9O8qYk18wOvSTJf66q65JsWfIrv5bkR6rq3Um+NslnDvMWb0zyHw5cmD/b93tJHpTF68kAjlh19+gMAEdVVf1cllxIP9F7PDHJ+d39lKneA5hvrgkDOEJV9StJzk3yuNFZgGOXkTAAgAFcEwYAMIASBgAwgBIGADCAEgYAMIASBgAwgBIGADDA/weCFHipYzCNcAAAAABJRU5ErkJggg==\n", "text/plain": [ "
" ] }, "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": "84c93f9c-516a-43fd-d4d8-656907ba66ac" }, "source": [ "wine" ], "execution_count": 15, "outputs": [ { "output_type": "execute_result", "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
fixed acidityvolatile aciditycitric acidresidual sugarchloridesfree sulfur dioxidetotal sulfur dioxidedensitypHsulphatesalcoholquality
07.40.7000.001.90.07611.034.00.997803.510.569.45
17.80.8800.002.60.09825.067.00.996803.200.689.85
27.80.7600.042.30.09215.054.00.997003.260.659.85
311.20.2800.561.90.07517.060.00.998003.160.589.86
47.40.7000.001.90.07611.034.00.997803.510.569.45
.......................................
15946.20.6000.082.00.09032.044.00.994903.450.5810.55
15955.90.5500.102.20.06239.051.00.995123.520.7611.26
15966.30.5100.132.30.07629.040.00.995743.420.7511.06
15975.90.6450.122.00.07532.044.00.995473.570.7110.25
15986.00.3100.473.60.06718.042.00.995493.390.6611.06
\n", "

1599 rows × 12 columns

\n", "
" ], "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": "358ff4d0-bc4b-489e-dd00-b3cf31b4ccfd" }, "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": "54a6e104-8137-41a5-a65c-41bf2ff5203f" }, "source": [ "wine.describe(include='all')" ], "execution_count": 17, "outputs": [ { "output_type": "execute_result", "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
fixed acidityvolatile aciditycitric acidresidual sugarchloridesfree sulfur dioxidetotal sulfur dioxidedensitypHsulphatesalcoholquality
count1599.0000001599.0000001599.0000001599.0000001599.0000001599.0000001599.0000001599.0000001599.0000001599.0000001599.0000001599.000000
mean8.3196370.5278210.2709762.5388060.08746715.87492246.4677920.9967473.3111130.65814910.4229835.636023
std1.7410960.1790600.1948011.4099280.04706510.46015732.8953240.0018870.1543860.1695071.0656680.807569
min4.6000000.1200000.0000000.9000000.0120001.0000006.0000000.9900702.7400000.3300008.4000003.000000
25%7.1000000.3900000.0900001.9000000.0700007.00000022.0000000.9956003.2100000.5500009.5000005.000000
50%7.9000000.5200000.2600002.2000000.07900014.00000038.0000000.9967503.3100000.62000010.2000006.000000
75%9.2000000.6400000.4200002.6000000.09000021.00000062.0000000.9978353.4000000.73000011.1000006.000000
max15.9000001.5800001.00000015.5000000.61100072.000000289.0000001.0036904.0100002.00000014.9000008.000000
\n", "
" ], "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": "markdown", "metadata": { "id": "t8Y53QPyu_fO" }, "source": [ "Testowy Wykres (quality, volatile acidity)" ] }, { "cell_type": "code", "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 405 }, "id": "hEe3BYcJaKnF", "outputId": "ccaf5bc0-889b-453b-f50b-eae3f8c50ee6" }, "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": [ "" ] }, "metadata": { "tags": [] }, "execution_count": 18 }, { "output_type": "display_data", "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAmEAAAFzCAYAAAB2A95GAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4yLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+WH4yJAAAYxUlEQVR4nO3de5ClZ10n8O8vM4RANgE0o+PmYrJuRKMi4BjRKFAiboKY7CIocUGllOguUQRlKhRbKLi7VY6wumLUzSIXL4AxCzq4gbDKTVFiJhAuSUDHQMiMtElAbgGEJL/9o0+wmcxMnwnz9tNz+vOp6jrnvfQ535xKJd9+nue8b3V3AABYW0eNDgAAsBEpYQAAAyhhAAADKGEAAAMoYQAAAyhhAAADbB4d4FCdcMIJfeqpp46OAQCwqquvvvrW7t6yv2NHXAk79dRTs2vXrtExAABWVVU3HuiY6UgAgAGUMACAAZQwAIABlDAAgAGUMACAAZQwAIABlDAAgAGUMACAAZQwAIABlDAAgAGUMACAAZQwAIABjrgbeB+ptm/fnqWlpWzdujU7duwYHQcAGEwJWyNLS0vZu3fv6BgAwDphOhIAYAAlDABgACUMAGAAJQwAYAAlDABgACUMAGAAJQwAYAAlDABgACUM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god2ef/lj85gV+5+R5B+TfPPs+GcP5UW7+22zKc1HJtnU3W5WDhwyI2HAInhrkn9fVfepquOSfP9s/weTfMvs+eNXnH+/JB/u7juTPDnJplVe/5NJjttn3+8meUWMggH3kBIGHPG6+x1J/jDJu5K8LslVs0MvSPKfquqdSU5Y8Su/meRHq+pdSb4uyW2rvMVrk/yHuxbmz/b9QZIHZHk9GcAhq+4enQHgsKqqX8yKhfQTvcfjk5zX3U+e6j2AxWZNGMAhqqoXJTknyWNGZwGOXEbCAAAGsCYMAGAAJQwAYAAlDABgACUMAGAAJQwAYAAlDABggP8P8QmHpYhfPrcAAAAASUVORK5CYII=\n", "text/plain": [ "
" ] }, "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": "b15a9922-3a36-47af-eb8d-762adf593ae7" }, "source": [ "wine" ], "execution_count": 20, "outputs": [ { "output_type": "execute_result", "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
fixed acidityvolatile aciditycitric acidresidual sugarchloridesfree sulfur dioxidetotal sulfur dioxidedensitypHsulphatesalcoholquality
07.40.7000.001.90.07611.034.00.997803.510.569.48.0
17.80.8800.002.60.09825.067.00.996803.200.689.88.0
27.80.7600.042.30.09215.054.00.997003.260.659.88.0
311.20.2800.561.90.07517.060.00.998003.160.589.812.0
47.40.7000.001.90.07611.034.00.997803.510.569.48.0
.......................................
15946.20.6000.082.00.09032.044.00.994903.450.5810.58.0
15955.90.5500.102.20.06239.051.00.995123.520.7611.212.0
15966.30.5100.132.30.07629.040.00.995743.420.7511.012.0
15975.90.6450.122.00.07532.044.00.995473.570.7110.28.0
15986.00.3100.473.60.06718.042.00.995493.390.6611.012.0
\n", "

1599 rows × 12 columns

\n", "
" ], "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": "81a417a4-236b-41e1-8d26-4462b2e13711" }, "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": "148c1b42-d301-4208-e09a-2333ce73c5e1" }, "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": "8858109b-c7e8-4ddc-de07-790bcb39c5a4" }, "source": [ "wine" ], "execution_count": 25, "outputs": [ { "output_type": "execute_result", "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
fixed acidityvolatile aciditycitric acidresidual sugarchloridesfree sulfur dioxidetotal sulfur dioxidedensitypHsulphatesalcoholquality
07.40.7000.001.90.07611.034.00.997803.510.569.48.0
17.80.8800.002.60.09825.067.00.996803.200.689.88.0
27.80.7600.042.30.09215.054.00.997003.260.659.88.0
311.20.2800.561.90.07517.060.00.998003.160.589.812.0
47.40.7000.001.90.07611.034.00.997803.510.569.48.0
.......................................
15946.20.6000.082.00.09032.044.00.994903.450.5810.58.0
15955.90.5500.102.20.06239.051.00.995123.520.7611.212.0
15966.30.5100.132.30.07629.040.00.995743.420.7511.012.0
15975.90.6450.122.00.07532.044.00.995473.570.7110.28.0
15986.00.3100.473.60.06718.042.00.995493.390.6611.012.0
\n", "

1599 rows × 12 columns

\n", "
" ], "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 } ] } ] }