ium_434788/Jupyter_Notebooks/IUM_5_434788_wersja_Jupyter.ipynb

2302 lines
207 KiB
Plaintext
Raw Permalink Normal View History

{
"nbformat": 4,
"nbformat_minor": 0,
"metadata": {
"colab": {
"name": "IUM_5_434788.ipynb",
"provenance": [],
"collapsed_sections": [],
"toc_visible": true
},
"kernelspec": {
"name": "python3",
"display_name": "Python 3"
},
"language_info": {
"name": "python"
}
},
"cells": [
{
"cell_type": "markdown",
"metadata": {
"id": "tY8oIUexCAg2"
},
"source": [
"# 0. Imports and downloading the Data Frame"
]
},
{
"cell_type": "code",
"metadata": {
"id": "AlE65Fo32mGf"
},
"source": [
"from tensorflow.keras.models import Sequential, load_model\n",
"from tensorflow.keras.layers import Dense\n",
"from sklearn.metrics import accuracy_score\n",
"import matplotlib.pyplot as plt\n",
"import seaborn as sns\n",
"import pandas as pd\n",
"from sklearn.model_selection import train_test_split\n",
"import numpy as np"
],
"execution_count": 14,
"outputs": []
},
{
"cell_type": "markdown",
"metadata": {
"id": "hFXots4qa8Sz"
},
"source": [
"### 0.1. Wyczytanie pliku csv z mojego repo"
]
},
{
"cell_type": "code",
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
"height": 470
},
"id": "8y82qyYTCN3H",
"outputId": "b1521955-f5f4-4080-ace4-6ce3f03d453e"
},
"source": [
"!curl -OL https://git.wmi.amu.edu.pl/s434788/ium_434788/raw/branch/master/winequality-red.csv\n",
"\n",
"wine=pd.read_csv('winequality-red.csv')\n",
"wine"
],
"execution_count": 2,
"outputs": [
{
"output_type": "stream",
"text": [
" % Total % Received % Xferd Average Speed Time Time Time Current\n",
" Dload Upload Total Spent Left Speed\n",
"100 98k 100 98k 0 0 66899 0 0:00:01 0:00:01 --:--:-- 66899\n"
],
"name": "stdout"
},
{
"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": "i1z5M-qvCanz"
},
"source": [
"# 1. Analiza zbioru"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "n-qmc_JJbDbY"
},
"source": [
"### 1.1. Heatmap by zbada korelacje. Z początku zastanawiałem się, czy nie wykorzystać tylko kolumn wysoko skorelowanych z 'Quality', jednak koniec końców model będzie się opierać o wszystkie kolumny"
]
},
{
"cell_type": "code",
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
"height": 462
},
"id": "KGx2vKgO5L1b",
"outputId": "4dc89448-a6b7-4f2f-919e-c79f58b33be0"
},
"source": [
"plt.figure(figsize=(10,6))\n",
"sns.heatmap(wine.corr(),annot=True)\n",
"plt.show()"
],
"execution_count": 3,
"outputs": [
{
"output_type": "display_data",
"data": {
"image/png": "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
"text/plain": [
"<Figure size 720x432 with 2 Axes>"
]
},
"metadata": {
"tags": [],
"needs_background": "light"
}
}
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "YJlKPvbbCjiA"
},
"source": [
"# 2. Normalizacja i podział zbioru na Test/Train"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "fSb2f0BRbdtI"
},
"source": [
"### 2.1. 'y' to pojedyńcza kolumna z wartościami 'quality'"
]
},
{
"cell_type": "code",
"metadata": {
"id": "nASk0bFA25Qs",
"colab": {
"base_uri": "https://localhost:8080/"
},
"outputId": "dbf37222-32f9-41e7-df82-46cc98ab13b7"
},
"source": [
"y = wine.quality\n",
"y.head()"
],
"execution_count": 4,
"outputs": [
{
"output_type": "execute_result",
"data": {
"text/plain": [
"0 5\n",
"1 5\n",
"2 5\n",
"3 6\n",
"4 5\n",
"Name: quality, dtype: int64"
]
},
"metadata": {
"tags": []
},
"execution_count": 4
}
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "Syf1hf1qbvAc"
},
"source": [
"### 2.2. 'x' to wszystkie kolumny poza 'quality'"
]
},
{
"cell_type": "code",
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
"height": 204
},
"id": "DRh8_4RaC2eV",
"outputId": "bca3de72-1368-462c-bf58-e4536fc93b74"
},
"source": [
"x = wine.drop(['quality'], axis= 1)\n",
"x.head()"
],
"execution_count": 5,
"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",
" </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",
" </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",
" </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",
" </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",
" </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",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" fixed acidity volatile acidity citric acid ... pH sulphates alcohol\n",
"0 7.4 0.70 0.00 ... 3.51 0.56 9.4\n",
"1 7.8 0.88 0.00 ... 3.20 0.68 9.8\n",
"2 7.8 0.76 0.04 ... 3.26 0.65 9.8\n",
"3 11.2 0.28 0.56 ... 3.16 0.58 9.8\n",
"4 7.4 0.70 0.00 ... 3.51 0.56 9.4\n",
"\n",
"[5 rows x 11 columns]"
]
},
"metadata": {
"tags": []
},
"execution_count": 5
}
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "sjRN2mU9b0S4"
},
"source": [
"### 2.3. Normalizacja wartości w x (do przedziału 0-1)"
]
},
{
"cell_type": "code",
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
"height": 204
},
"id": "aYSFPw7e58uC",
"outputId": "0462f35a-1343-4fc3-b0f8-83df57951b86"
},
"source": [
"x=((x-x.min())/(x.max()-x.min()))\n",
"x.head()"
],
"execution_count": 6,
"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",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>0.247788</td>\n",
" <td>0.397260</td>\n",
" <td>0.00</td>\n",
" <td>0.068493</td>\n",
" <td>0.106845</td>\n",
" <td>0.140845</td>\n",
" <td>0.098940</td>\n",
" <td>0.567548</td>\n",
" <td>0.606299</td>\n",
" <td>0.137725</td>\n",
" <td>0.153846</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>0.283186</td>\n",
" <td>0.520548</td>\n",
" <td>0.00</td>\n",
" <td>0.116438</td>\n",
" <td>0.143573</td>\n",
" <td>0.338028</td>\n",
" <td>0.215548</td>\n",
" <td>0.494126</td>\n",
" <td>0.362205</td>\n",
" <td>0.209581</td>\n",
" <td>0.215385</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>0.283186</td>\n",
" <td>0.438356</td>\n",
" <td>0.04</td>\n",
" <td>0.095890</td>\n",
" <td>0.133556</td>\n",
" <td>0.197183</td>\n",
" <td>0.169611</td>\n",
" <td>0.508811</td>\n",
" <td>0.409449</td>\n",
" <td>0.191617</td>\n",
" <td>0.215385</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>0.584071</td>\n",
" <td>0.109589</td>\n",
" <td>0.56</td>\n",
" <td>0.068493</td>\n",
" <td>0.105175</td>\n",
" <td>0.225352</td>\n",
" <td>0.190813</td>\n",
" <td>0.582232</td>\n",
" <td>0.330709</td>\n",
" <td>0.149701</td>\n",
" <td>0.215385</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>0.247788</td>\n",
" <td>0.397260</td>\n",
" <td>0.00</td>\n",
" <td>0.068493</td>\n",
" <td>0.106845</td>\n",
" <td>0.140845</td>\n",
" <td>0.098940</td>\n",
" <td>0.567548</td>\n",
" <td>0.606299</td>\n",
" <td>0.137725</td>\n",
" <td>0.153846</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" fixed acidity volatile acidity citric acid ... pH sulphates alcohol\n",
"0 0.247788 0.397260 0.00 ... 0.606299 0.137725 0.153846\n",
"1 0.283186 0.520548 0.00 ... 0.362205 0.209581 0.215385\n",
"2 0.283186 0.438356 0.04 ... 0.409449 0.191617 0.215385\n",
"3 0.584071 0.109589 0.56 ... 0.330709 0.149701 0.215385\n",
"4 0.247788 0.397260 0.00 ... 0.606299 0.137725 0.153846\n",
"\n",
"[5 rows x 11 columns]"
]
},
"metadata": {
"tags": []
},
"execution_count": 6
}
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "5w0PCwRDb7Qu"
},
"source": [
"### 2.4. Podział na zbiory testowe i treningowe (1:4)"
]
},
{
"cell_type": "code",
"metadata": {
"id": "uhN2kywv3psP"
},
"source": [
"x_train, x_test, y_train, y_test = train_test_split(x,y , test_size=0.2,train_size=0.8, random_state=21)"
],
"execution_count": 7,
"outputs": []
},
{
"cell_type": "code",
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
"height": 204
},
"id": "l0iJsRfe9uqK",
"outputId": "2f06df73-9583-438a-f634-f56c435d22a8"
},
"source": [
"x_train.head()"
],
"execution_count": 8,
"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",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>751</th>\n",
" <td>0.327434</td>\n",
" <td>0.363014</td>\n",
" <td>0.10</td>\n",
" <td>0.136986</td>\n",
" <td>0.128548</td>\n",
" <td>0.225352</td>\n",
" <td>0.120141</td>\n",
" <td>0.584435</td>\n",
" <td>0.433071</td>\n",
" <td>0.131737</td>\n",
" <td>0.169231</td>\n",
" </tr>\n",
" <tr>\n",
" <th>370</th>\n",
" <td>0.203540</td>\n",
" <td>0.441781</td>\n",
" <td>0.02</td>\n",
" <td>0.095890</td>\n",
" <td>0.085142</td>\n",
" <td>0.478873</td>\n",
" <td>0.201413</td>\n",
" <td>0.545521</td>\n",
" <td>0.653543</td>\n",
" <td>0.269461</td>\n",
" <td>0.230769</td>\n",
" </tr>\n",
" <tr>\n",
" <th>374</th>\n",
" <td>0.831858</td>\n",
" <td>0.198630</td>\n",
" <td>0.63</td>\n",
" <td>0.198630</td>\n",
" <td>0.128548</td>\n",
" <td>0.070423</td>\n",
" <td>0.144876</td>\n",
" <td>0.831865</td>\n",
" <td>0.212598</td>\n",
" <td>0.287425</td>\n",
" <td>0.369231</td>\n",
" </tr>\n",
" <tr>\n",
" <th>537</th>\n",
" <td>0.309735</td>\n",
" <td>0.482877</td>\n",
" <td>0.24</td>\n",
" <td>0.082192</td>\n",
" <td>0.120200</td>\n",
" <td>0.056338</td>\n",
" <td>0.024735</td>\n",
" <td>0.523495</td>\n",
" <td>0.496063</td>\n",
" <td>0.263473</td>\n",
" <td>0.353846</td>\n",
" </tr>\n",
" <tr>\n",
" <th>708</th>\n",
" <td>0.283186</td>\n",
" <td>0.291096</td>\n",
" <td>0.12</td>\n",
" <td>0.109589</td>\n",
" <td>0.093489</td>\n",
" <td>0.140845</td>\n",
" <td>0.102473</td>\n",
" <td>0.435389</td>\n",
" <td>0.472441</td>\n",
" <td>0.167665</td>\n",
" <td>0.492308</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" fixed acidity volatile acidity ... sulphates alcohol\n",
"751 0.327434 0.363014 ... 0.131737 0.169231\n",
"370 0.203540 0.441781 ... 0.269461 0.230769\n",
"374 0.831858 0.198630 ... 0.287425 0.369231\n",
"537 0.309735 0.482877 ... 0.263473 0.353846\n",
"708 0.283186 0.291096 ... 0.167665 0.492308\n",
"\n",
"[5 rows x 11 columns]"
]
},
"metadata": {
"tags": []
},
"execution_count": 8
}
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "Eml7m1efDZcB"
},
"source": [
"# 3. Model i jego trening (Tensorflow.Keras)"
]
},
{
"cell_type": "code",
"metadata": {
"id": "yw5LC_8g4W_z"
},
"source": [
"def regression_model():\n",
" model = Sequential()\n",
" model.add(Dense(32,activation = \"relu\", input_shape = (x_train.shape[1],)))\n",
" model.add(Dense(64,activation = \"relu\"))\n",
" model.add(Dense(1,activation = \"relu\"))\n",
" \n",
" model.compile(optimizer = \"adam\", loss = \"mean_squared_error\")\n",
" return model"
],
"execution_count": 9,
"outputs": []
},
{
"cell_type": "code",
"metadata": {
"id": "UZex-gc2-fma"
},
"source": [
"model = regression_model()"
],
"execution_count": 10,
"outputs": []
},
{
"cell_type": "code",
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "p3Soo5N94nYK",
"outputId": "78df14e3-e63f-4e59-b768-dd3c24a7f8d3"
},
"source": [
"model.fit(x_train, y_train, epochs = 600, verbose = 1)"
],
"execution_count": 11,
"outputs": [
{
"output_type": "stream",
"text": [
"Epoch 1/600\n",
"40/40 [==============================] - 1s 1ms/step - loss: 27.8321\n",
"Epoch 2/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 7.2309\n",
"Epoch 3/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 1.0122\n",
"Epoch 4/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.8249\n",
"Epoch 5/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.8217\n",
"Epoch 6/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.7261\n",
"Epoch 7/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.6524\n",
"Epoch 8/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.6332\n",
"Epoch 9/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.6085\n",
"Epoch 10/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.5933\n",
"Epoch 11/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.5950\n",
"Epoch 12/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.6067\n",
"Epoch 13/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.5047\n",
"Epoch 14/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.5503\n",
"Epoch 15/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.5120\n",
"Epoch 16/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.5540\n",
"Epoch 17/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.5384\n",
"Epoch 18/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.5129\n",
"Epoch 19/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.4923\n",
"Epoch 20/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.5131\n",
"Epoch 21/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.4585\n",
"Epoch 22/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.4688\n",
"Epoch 23/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.4497\n",
"Epoch 24/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.4347\n",
"Epoch 25/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.4830\n",
"Epoch 26/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.4474\n",
"Epoch 27/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.4599\n",
"Epoch 28/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.4428\n",
"Epoch 29/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.4375\n",
"Epoch 30/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.4240\n",
"Epoch 31/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.4524\n",
"Epoch 32/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.4448\n",
"Epoch 33/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.4163\n",
"Epoch 34/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.4217\n",
"Epoch 35/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.4117\n",
"Epoch 36/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.4445\n",
"Epoch 37/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.4249\n",
"Epoch 38/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.4436\n",
"Epoch 39/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.4290\n",
"Epoch 40/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.4551\n",
"Epoch 41/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.4315\n",
"Epoch 42/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3996\n",
"Epoch 43/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.4504\n",
"Epoch 44/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.4202\n",
"Epoch 45/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3944\n",
"Epoch 46/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3944\n",
"Epoch 47/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.4092\n",
"Epoch 48/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.4065\n",
"Epoch 49/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.4056\n",
"Epoch 50/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.4023\n",
"Epoch 51/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.4188\n",
"Epoch 52/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3748\n",
"Epoch 53/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.4079\n",
"Epoch 54/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3867\n",
"Epoch 55/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3920\n",
"Epoch 56/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.4366\n",
"Epoch 57/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3996\n",
"Epoch 58/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3794\n",
"Epoch 59/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.4243\n",
"Epoch 60/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.4039\n",
"Epoch 61/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3504\n",
"Epoch 62/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.4023\n",
"Epoch 63/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.4076\n",
"Epoch 64/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.4207\n",
"Epoch 65/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3727\n",
"Epoch 66/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.4051\n",
"Epoch 67/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3956\n",
"Epoch 68/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3877\n",
"Epoch 69/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.4053\n",
"Epoch 70/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3759\n",
"Epoch 71/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3773\n",
"Epoch 72/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3836\n",
"Epoch 73/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3573\n",
"Epoch 74/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.4144\n",
"Epoch 75/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.4208\n",
"Epoch 76/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3758\n",
"Epoch 77/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3989\n",
"Epoch 78/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3979\n",
"Epoch 79/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.4047\n",
"Epoch 80/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.4111\n",
"Epoch 81/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.4047\n",
"Epoch 82/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.4017\n",
"Epoch 83/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.4451\n",
"Epoch 84/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3747\n",
"Epoch 85/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3734\n",
"Epoch 86/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.4017\n",
"Epoch 87/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3886\n",
"Epoch 88/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.4091\n",
"Epoch 89/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.4020\n",
"Epoch 90/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.4022\n",
"Epoch 91/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.4048\n",
"Epoch 92/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3940\n",
"Epoch 93/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.4150\n",
"Epoch 94/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.4054\n",
"Epoch 95/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3523\n",
"Epoch 96/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3864\n",
"Epoch 97/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3790\n",
"Epoch 98/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3770\n",
"Epoch 99/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3783\n",
"Epoch 100/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3679\n",
"Epoch 101/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.4155\n",
"Epoch 102/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3839\n",
"Epoch 103/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3859\n",
"Epoch 104/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3954\n",
"Epoch 105/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3609\n",
"Epoch 106/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.4079\n",
"Epoch 107/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3977\n",
"Epoch 108/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3993\n",
"Epoch 109/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3991\n",
"Epoch 110/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3661\n",
"Epoch 111/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3566\n",
"Epoch 112/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3867\n",
"Epoch 113/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3705\n",
"Epoch 114/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3845\n",
"Epoch 115/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3792\n",
"Epoch 116/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3857\n",
"Epoch 117/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3865\n",
"Epoch 118/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3643\n",
"Epoch 119/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3673\n",
"Epoch 120/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.4002\n",
"Epoch 121/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3690\n",
"Epoch 122/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3719\n",
"Epoch 123/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3939\n",
"Epoch 124/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.4074\n",
"Epoch 125/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3835\n",
"Epoch 126/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.4051\n",
"Epoch 127/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3629\n",
"Epoch 128/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3653\n",
"Epoch 129/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3473\n",
"Epoch 130/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3980\n",
"Epoch 131/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3647\n",
"Epoch 132/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3636\n",
"Epoch 133/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.4010\n",
"Epoch 134/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3511\n",
"Epoch 135/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3899\n",
"Epoch 136/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3951\n",
"Epoch 137/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.4010\n",
"Epoch 138/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3930\n",
"Epoch 139/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3711\n",
"Epoch 140/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3936\n",
"Epoch 141/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3907\n",
"Epoch 142/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3713\n",
"Epoch 143/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3592\n",
"Epoch 144/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3772\n",
"Epoch 145/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3981\n",
"Epoch 146/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3858\n",
"Epoch 147/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3546\n",
"Epoch 148/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3882\n",
"Epoch 149/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3635\n",
"Epoch 150/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3822\n",
"Epoch 151/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.4120\n",
"Epoch 152/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3808\n",
"Epoch 153/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3656\n",
"Epoch 154/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3948\n",
"Epoch 155/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3483\n",
"Epoch 156/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3825\n",
"Epoch 157/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3450\n",
"Epoch 158/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3664\n",
"Epoch 159/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3530\n",
"Epoch 160/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3596\n",
"Epoch 161/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3659\n",
"Epoch 162/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3858\n",
"Epoch 163/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.4161\n",
"Epoch 164/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3519\n",
"Epoch 165/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3834\n",
"Epoch 166/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3766\n",
"Epoch 167/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3909\n",
"Epoch 168/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.4038\n",
"Epoch 169/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3815\n",
"Epoch 170/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3823\n",
"Epoch 171/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3907\n",
"Epoch 172/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3637\n",
"Epoch 173/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3535\n",
"Epoch 174/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3484\n",
"Epoch 175/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.4050\n",
"Epoch 176/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3680\n",
"Epoch 177/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3710\n",
"Epoch 178/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3292\n",
"Epoch 179/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3750\n",
"Epoch 180/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3701\n",
"Epoch 181/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3613\n",
"Epoch 182/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3442\n",
"Epoch 183/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3786\n",
"Epoch 184/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3524\n",
"Epoch 185/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3703\n",
"Epoch 186/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3841\n",
"Epoch 187/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3517\n",
"Epoch 188/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3699\n",
"Epoch 189/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3567\n",
"Epoch 190/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3600\n",
"Epoch 191/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3606\n",
"Epoch 192/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3604\n",
"Epoch 193/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3902\n",
"Epoch 194/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3926\n",
"Epoch 195/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3976\n",
"Epoch 196/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3466\n",
"Epoch 197/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3872\n",
"Epoch 198/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3598\n",
"Epoch 199/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3616\n",
"Epoch 200/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3502\n",
"Epoch 201/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3880\n",
"Epoch 202/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3623\n",
"Epoch 203/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3724\n",
"Epoch 204/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3723\n",
"Epoch 205/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3580\n",
"Epoch 206/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3528\n",
"Epoch 207/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3621\n",
"Epoch 208/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3672\n",
"Epoch 209/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3613\n",
"Epoch 210/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3419\n",
"Epoch 211/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3778\n",
"Epoch 212/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3543\n",
"Epoch 213/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3638\n",
"Epoch 214/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3585\n",
"Epoch 215/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3508\n",
"Epoch 216/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3515\n",
"Epoch 217/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3430\n",
"Epoch 218/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3368\n",
"Epoch 219/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3448\n",
"Epoch 220/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3731\n",
"Epoch 221/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3654\n",
"Epoch 222/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3466\n",
"Epoch 223/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3498\n",
"Epoch 224/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3458\n",
"Epoch 225/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3740\n",
"Epoch 226/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3739\n",
"Epoch 227/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3356\n",
"Epoch 228/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3836\n",
"Epoch 229/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3621\n",
"Epoch 230/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3540\n",
"Epoch 231/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3454\n",
"Epoch 232/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3459\n",
"Epoch 233/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3736\n",
"Epoch 234/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3534\n",
"Epoch 235/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3818\n",
"Epoch 236/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3530\n",
"Epoch 237/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3725\n",
"Epoch 238/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3523\n",
"Epoch 239/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3500\n",
"Epoch 240/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3866\n",
"Epoch 241/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3375\n",
"Epoch 242/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3650\n",
"Epoch 243/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3788\n",
"Epoch 244/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3471\n",
"Epoch 245/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3462\n",
"Epoch 246/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3462\n",
"Epoch 247/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3628\n",
"Epoch 248/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3379\n",
"Epoch 249/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3776\n",
"Epoch 250/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3356\n",
"Epoch 251/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3577\n",
"Epoch 252/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3560\n",
"Epoch 253/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3786\n",
"Epoch 254/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3528\n",
"Epoch 255/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3808\n",
"Epoch 256/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3601\n",
"Epoch 257/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3587\n",
"Epoch 258/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3681\n",
"Epoch 259/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3386\n",
"Epoch 260/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3573\n",
"Epoch 261/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3669\n",
"Epoch 262/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3712\n",
"Epoch 263/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3560\n",
"Epoch 264/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3531\n",
"Epoch 265/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3293\n",
"Epoch 266/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3404\n",
"Epoch 267/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3455\n",
"Epoch 268/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3456\n",
"Epoch 269/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3568\n",
"Epoch 270/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3634\n",
"Epoch 271/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3354\n",
"Epoch 272/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3398\n",
"Epoch 273/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3537\n",
"Epoch 274/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3198\n",
"Epoch 275/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3313\n",
"Epoch 276/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3686\n",
"Epoch 277/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3463\n",
"Epoch 278/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3801\n",
"Epoch 279/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3593\n",
"Epoch 280/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3443\n",
"Epoch 281/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3401\n",
"Epoch 282/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3547\n",
"Epoch 283/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3571\n",
"Epoch 284/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3622\n",
"Epoch 285/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3451\n",
"Epoch 286/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3405\n",
"Epoch 287/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3550\n",
"Epoch 288/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3467\n",
"Epoch 289/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3271\n",
"Epoch 290/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3654\n",
"Epoch 291/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3436\n",
"Epoch 292/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3487\n",
"Epoch 293/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3580\n",
"Epoch 294/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3635\n",
"Epoch 295/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3222\n",
"Epoch 296/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3635\n",
"Epoch 297/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3755\n",
"Epoch 298/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3435\n",
"Epoch 299/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3492\n",
"Epoch 300/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3568\n",
"Epoch 301/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3517\n",
"Epoch 302/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3572\n",
"Epoch 303/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3537\n",
"Epoch 304/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3451\n",
"Epoch 305/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3365\n",
"Epoch 306/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3480\n",
"Epoch 307/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3329\n",
"Epoch 308/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3326\n",
"Epoch 309/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3350\n",
"Epoch 310/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3417\n",
"Epoch 311/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3374\n",
"Epoch 312/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3435\n",
"Epoch 313/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3292\n",
"Epoch 314/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3830\n",
"Epoch 315/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3492\n",
"Epoch 316/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3439\n",
"Epoch 317/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3609\n",
"Epoch 318/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3797\n",
"Epoch 319/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3569\n",
"Epoch 320/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3445\n",
"Epoch 321/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3296\n",
"Epoch 322/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3218\n",
"Epoch 323/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3325\n",
"Epoch 324/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3528\n",
"Epoch 325/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3351\n",
"Epoch 326/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3734\n",
"Epoch 327/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3268\n",
"Epoch 328/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3392\n",
"Epoch 329/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3393\n",
"Epoch 330/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3390\n",
"Epoch 331/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3291\n",
"Epoch 332/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3260\n",
"Epoch 333/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3345\n",
"Epoch 334/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3749\n",
"Epoch 335/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3545\n",
"Epoch 336/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3572\n",
"Epoch 337/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3491\n",
"Epoch 338/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3377\n",
"Epoch 339/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3574\n",
"Epoch 340/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3359\n",
"Epoch 341/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3532\n",
"Epoch 342/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3286\n",
"Epoch 343/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3675\n",
"Epoch 344/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3198\n",
"Epoch 345/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3613\n",
"Epoch 346/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3592\n",
"Epoch 347/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3624\n",
"Epoch 348/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3433\n",
"Epoch 349/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3433\n",
"Epoch 350/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3301\n",
"Epoch 351/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3418\n",
"Epoch 352/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3668\n",
"Epoch 353/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3247\n",
"Epoch 354/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3316\n",
"Epoch 355/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3367\n",
"Epoch 356/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3361\n",
"Epoch 357/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3343\n",
"Epoch 358/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3458\n",
"Epoch 359/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3431\n",
"Epoch 360/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3334\n",
"Epoch 361/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3458\n",
"Epoch 362/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3419\n",
"Epoch 363/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3463\n",
"Epoch 364/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3459\n",
"Epoch 365/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3305\n",
"Epoch 366/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3334\n",
"Epoch 367/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3300\n",
"Epoch 368/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3148\n",
"Epoch 369/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3328\n",
"Epoch 370/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3490\n",
"Epoch 371/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3349\n",
"Epoch 372/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3434\n",
"Epoch 373/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3631\n",
"Epoch 374/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3490\n",
"Epoch 375/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3435\n",
"Epoch 376/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3392\n",
"Epoch 377/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3440\n",
"Epoch 378/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3293\n",
"Epoch 379/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3160\n",
"Epoch 380/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3524\n",
"Epoch 381/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3347\n",
"Epoch 382/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3362\n",
"Epoch 383/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3412\n",
"Epoch 384/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3644\n",
"Epoch 385/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3231\n",
"Epoch 386/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3175\n",
"Epoch 387/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3360\n",
"Epoch 388/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3483\n",
"Epoch 389/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3323\n",
"Epoch 390/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3199\n",
"Epoch 391/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3390\n",
"Epoch 392/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3240\n",
"Epoch 393/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3285\n",
"Epoch 394/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3487\n",
"Epoch 395/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3266\n",
"Epoch 396/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3350\n",
"Epoch 397/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3294\n",
"Epoch 398/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3381\n",
"Epoch 399/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3154\n",
"Epoch 400/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3376\n",
"Epoch 401/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3182\n",
"Epoch 402/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3313\n",
"Epoch 403/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3382\n",
"Epoch 404/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3663\n",
"Epoch 405/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3355\n",
"Epoch 406/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3389\n",
"Epoch 407/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3132\n",
"Epoch 408/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3170\n",
"Epoch 409/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3150\n",
"Epoch 410/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3280\n",
"Epoch 411/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3339\n",
"Epoch 412/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3430\n",
"Epoch 413/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3446\n",
"Epoch 414/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3243\n",
"Epoch 415/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3232\n",
"Epoch 416/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3219\n",
"Epoch 417/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3019\n",
"Epoch 418/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3173\n",
"Epoch 419/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3165\n",
"Epoch 420/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3282\n",
"Epoch 421/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3027\n",
"Epoch 422/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3313\n",
"Epoch 423/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3453\n",
"Epoch 424/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3370\n",
"Epoch 425/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3364\n",
"Epoch 426/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3247\n",
"Epoch 427/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3346\n",
"Epoch 428/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3077\n",
"Epoch 429/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3195\n",
"Epoch 430/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.2898\n",
"Epoch 431/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3086\n",
"Epoch 432/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3100\n",
"Epoch 433/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3305\n",
"Epoch 434/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3371\n",
"Epoch 435/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3308\n",
"Epoch 436/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.2980\n",
"Epoch 437/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3129\n",
"Epoch 438/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3332\n",
"Epoch 439/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3368\n",
"Epoch 440/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3274\n",
"Epoch 441/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3208\n",
"Epoch 442/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3206\n",
"Epoch 443/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3280\n",
"Epoch 444/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3386\n",
"Epoch 445/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3297\n",
"Epoch 446/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3365\n",
"Epoch 447/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3030\n",
"Epoch 448/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3231\n",
"Epoch 449/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3107\n",
"Epoch 450/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3288\n",
"Epoch 451/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3194\n",
"Epoch 452/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3037\n",
"Epoch 453/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3168\n",
"Epoch 454/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.2999\n",
"Epoch 455/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3104\n",
"Epoch 456/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.2976\n",
"Epoch 457/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3572\n",
"Epoch 458/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3177\n",
"Epoch 459/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3102\n",
"Epoch 460/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3087\n",
"Epoch 461/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3039\n",
"Epoch 462/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3127\n",
"Epoch 463/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3300\n",
"Epoch 464/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3243\n",
"Epoch 465/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3106\n",
"Epoch 466/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.2922\n",
"Epoch 467/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3300\n",
"Epoch 468/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3051\n",
"Epoch 469/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.2999\n",
"Epoch 470/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3099\n",
"Epoch 471/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3122\n",
"Epoch 472/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3105\n",
"Epoch 473/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3167\n",
"Epoch 474/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3227\n",
"Epoch 475/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3039\n",
"Epoch 476/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3167\n",
"Epoch 477/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3083\n",
"Epoch 478/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3280\n",
"Epoch 479/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3070\n",
"Epoch 480/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3247\n",
"Epoch 481/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3205\n",
"Epoch 482/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3219\n",
"Epoch 483/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3158\n",
"Epoch 484/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3384\n",
"Epoch 485/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.2816\n",
"Epoch 486/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3286\n",
"Epoch 487/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3357\n",
"Epoch 488/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3076\n",
"Epoch 489/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3206\n",
"Epoch 490/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3173\n",
"Epoch 491/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3251\n",
"Epoch 492/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3083\n",
"Epoch 493/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3154\n",
"Epoch 494/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3128\n",
"Epoch 495/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3146\n",
"Epoch 496/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3092\n",
"Epoch 497/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3007\n",
"Epoch 498/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3117\n",
"Epoch 499/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3241\n",
"Epoch 500/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3224\n",
"Epoch 501/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3187\n",
"Epoch 502/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3159\n",
"Epoch 503/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3144\n",
"Epoch 504/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3196\n",
"Epoch 505/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3058\n",
"Epoch 506/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3054\n",
"Epoch 507/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3240\n",
"Epoch 508/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3082\n",
"Epoch 509/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.2909\n",
"Epoch 510/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3181\n",
"Epoch 511/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3180\n",
"Epoch 512/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3373\n",
"Epoch 513/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3207\n",
"Epoch 514/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3228\n",
"Epoch 515/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3178\n",
"Epoch 516/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3052\n",
"Epoch 517/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3281\n",
"Epoch 518/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3052\n",
"Epoch 519/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3119\n",
"Epoch 520/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.2770\n",
"Epoch 521/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3306\n",
"Epoch 522/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3159\n",
"Epoch 523/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3191\n",
"Epoch 524/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3369\n",
"Epoch 525/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3080\n",
"Epoch 526/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3014\n",
"Epoch 527/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3012\n",
"Epoch 528/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3150\n",
"Epoch 529/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3105\n",
"Epoch 530/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3236\n",
"Epoch 531/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3102\n",
"Epoch 532/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3199\n",
"Epoch 533/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.2913\n",
"Epoch 534/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.2913\n",
"Epoch 535/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3063\n",
"Epoch 536/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3174\n",
"Epoch 537/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3165\n",
"Epoch 538/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3277\n",
"Epoch 539/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3098\n",
"Epoch 540/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3196\n",
"Epoch 541/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3007\n",
"Epoch 542/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3001\n",
"Epoch 543/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3018\n",
"Epoch 544/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.2872\n",
"Epoch 545/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.2685\n",
"Epoch 546/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3197\n",
"Epoch 547/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3055\n",
"Epoch 548/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3225\n",
"Epoch 549/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3167\n",
"Epoch 550/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3164\n",
"Epoch 551/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3104\n",
"Epoch 552/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3093\n",
"Epoch 553/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3062\n",
"Epoch 554/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3225\n",
"Epoch 555/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3169\n",
"Epoch 556/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.2989\n",
"Epoch 557/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.2997\n",
"Epoch 558/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3211\n",
"Epoch 559/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3092\n",
"Epoch 560/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3128\n",
"Epoch 561/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3047\n",
"Epoch 562/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3100\n",
"Epoch 563/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3143\n",
"Epoch 564/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.2766\n",
"Epoch 565/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3003\n",
"Epoch 566/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3040\n",
"Epoch 567/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.2720\n",
"Epoch 568/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3156\n",
"Epoch 569/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3182\n",
"Epoch 570/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3047\n",
"Epoch 571/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3074\n",
"Epoch 572/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3250\n",
"Epoch 573/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.2953\n",
"Epoch 574/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.2828\n",
"Epoch 575/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.2882\n",
"Epoch 576/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.2914\n",
"Epoch 577/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3143\n",
"Epoch 578/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.2871\n",
"Epoch 579/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.2677\n",
"Epoch 580/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3053\n",
"Epoch 581/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.2921\n",
"Epoch 582/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3074\n",
"Epoch 583/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3053\n",
"Epoch 584/600\n",
"40/40 [==============================] - 0s 3ms/step - loss: 0.2888\n",
"Epoch 585/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3111\n",
"Epoch 586/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3032\n",
"Epoch 587/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.2958\n",
"Epoch 588/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3009\n",
"Epoch 589/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3176\n",
"Epoch 590/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.2913\n",
"Epoch 591/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.2803\n",
"Epoch 592/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.2720\n",
"Epoch 593/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.2856\n",
"Epoch 594/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3113\n",
"Epoch 595/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.2881\n",
"Epoch 596/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.3043\n",
"Epoch 597/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.2897\n",
"Epoch 598/600\n",
"40/40 [==============================] - 0s 1ms/step - loss: 0.3105\n",
"Epoch 599/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.2815\n",
"Epoch 600/600\n",
"40/40 [==============================] - 0s 2ms/step - loss: 0.2928\n"
],
"name": "stdout"
},
{
"output_type": "execute_result",
"data": {
"text/plain": [
"<tensorflow.python.keras.callbacks.History at 0x7fafd9388bd0>"
]
},
"metadata": {
"tags": []
},
"execution_count": 11
}
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "QRsJLVS2cOfM"
},
"source": [
"# 4. Predykcje, Pokrycie, Precyzja i F-Score (+ Zapisanie y_pred)"
]
},
{
"cell_type": "code",
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "1KlMEBYj4zYC",
"outputId": "dc6a27fe-5ff7-4614-9f94-abdf140ae073"
},
"source": [
"y_pred = model.predict(x_test)\n",
"\n",
"y_pred[:5]"
],
"execution_count": 12,
"outputs": [
{
"output_type": "execute_result",
"data": {
"text/plain": [
"array([[5.852079 ],\n",
" [5.9662743],\n",
" [5.219407 ],\n",
" [5.5860786],\n",
" [6.314252 ]], dtype=float32)"
]
},
"metadata": {
"tags": []
},
"execution_count": 12
}
]
},
{
"cell_type": "code",
"metadata": {
"id": "Y7QI0nqhBKeq"
},
"source": [
"y_pred = np.around(y_pred, decimals=0)\n",
"\n",
"y_pred[:5]\n",
"\n",
"pd.DataFrame(y_pred).to_csv(\"preds.csv\")"
],
"execution_count": 18,
"outputs": []
},
{
"cell_type": "code",
"metadata": {
"id": "iPDHtbA6AC-P",
"colab": {
"base_uri": "https://localhost:8080/"
},
"outputId": "0b7bed7f-6431-4458-c9b4-d1b1f61471b9"
},
"source": [
"accuracy_score(y_test, y_pred)"
],
"execution_count": null,
"outputs": [
{
"output_type": "execute_result",
"data": {
"text/plain": [
"0.603125"
]
},
"metadata": {
"tags": []
},
"execution_count": 138
}
]
},
{
"cell_type": "code",
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "EUAaNOJaAlsk",
"outputId": "3bbc97d1-df61-4e2e-aec9-dc75407df371"
},
"source": [
"from sklearn.metrics import classification_report\n",
"print(classification_report(y_test,y_pred)) "
],
"execution_count": null,
"outputs": [
{
"output_type": "stream",
"text": [
" precision recall f1-score support\n",
"\n",
" 1.0 0.00 0.00 0.00 0\n",
" 3.0 0.00 0.00 0.00 1\n",
" 4.0 0.00 0.00 0.00 6\n",
" 5.0 0.75 0.62 0.68 152\n",
" 6.0 0.49 0.70 0.58 115\n",
" 7.0 0.66 0.47 0.55 40\n",
" 8.0 0.00 0.00 0.00 6\n",
"\n",
" accuracy 0.60 320\n",
" macro avg 0.27 0.26 0.26 320\n",
"weighted avg 0.61 0.60 0.60 320\n",
"\n"
],
"name": "stdout"
},
{
"output_type": "stream",
"text": [
"/usr/local/lib/python3.7/dist-packages/sklearn/metrics/_classification.py:1272: UndefinedMetricWarning: Precision and F-score are ill-defined and being set to 0.0 in labels with no predicted samples. Use `zero_division` parameter to control this behavior.\n",
" _warn_prf(average, modifier, msg_start, len(result))\n",
"/usr/local/lib/python3.7/dist-packages/sklearn/metrics/_classification.py:1272: UndefinedMetricWarning: Recall and F-score are ill-defined and being set to 0.0 in labels with no true samples. Use `zero_division` parameter to control this behavior.\n",
" _warn_prf(average, modifier, msg_start, len(result))\n"
],
"name": "stderr"
}
]
},
{
"cell_type": "code",
"metadata": {
"id": "t8OqcubbIIJU"
},
"source": [
""
],
"execution_count": null,
"outputs": []
}
]
}