PolynomialRegression/Polynomial Regression.ipynb

712 lines
396 KiB
Plaintext
Raw Normal View History

2021-06-24 11:07:41 +02:00
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Algorytm najszybszego spadku dla regresji wielomianowej. "
2021-06-24 11:07:41 +02:00
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Skład grupy:\n",
2021-06-27 14:09:23 +02:00
"- Nowak Anna,\n",
"- Łaźna Patrycja,\n",
"- Bregier Damian"
2021-06-24 11:07:41 +02:00
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## 0. Podstawowe informacje o zbiorze danych"
]
},
{
"attachments": {
"image.png": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAA2oAAAJACAYAAAD8a5XvAAAgAElEQVR4Aezd8Wsbd4L/f/8Z/nENhsU0HPUeBxbcwUZsOOLSwgrMl48hPwTv8r2c6efomXIEX5Ylp20hiPAhpyuk6Bu+25zdNl2l+cYo3ipf+eJvUqlrfzOum6zVq3blOMHIjXI339g1qhOV15eRNNZIlh2PbFmS8zQISzPvmXnPY2Y0fs37PeMO8YMAAggggAACCCCAAAIIINBSAh0tVRsqgwACCCCAAAIIIIAAAgggIIIaOwECCCCAAAIIIIAAAggg0GICBLUW2yBUBwEEEEAAAQQQQAABBBAgqLEPIIAAAggggAACCCCAAAItJkBQa7ENQnUQQAABBBBAAAEEEEAAAYIa+wACCCCAAAIIIIAAAggg0GICBLUW2yBUBwEEEEAAAQQQQAABBBAgqLEPIIAAAggggAACCCCAAAItJkBQa7ENQnUQQAABBBBAAAEEEEAAgT0Ete/10Ijr89uGHn5fCfn0P2sPryzFJwQQQAABBBBAAAEEEEAAgVoCewhqj/XRyW79qOuEPnpUOeu779YeXlnq4D99/99P9f3zg18uS0QAAQQQQAABBBBAAAEE3Ai0YFB7qrv/fl6B8+c1+aDGqjz4rDAu8O+GntYYvd2gx1d/oR93desv/iWuqgbA7SYpDH86e7mwvN/OulnajrNkJAIIIIAAAggggAACC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Ue7tTo1O5ygWlQvIeDyldObTy06Mx+QbGVDjlZhaUrjyDlssm/Oo4Gy9/drzruPW/tNPLUZS3CCCAAAJtKpC+PqL+
}
},
"cell_type": "markdown",
"metadata": {},
"source": [
"Ze względu na specyfikę wytycznych projektu zakładającego wykorzystanie jedynie dwóch cech: x i y oraz modelowanie zależności y od x za pomocą funkcji wielomianowej dobrany został przez nas odpowiedni dataset. Obejmuje on jedynie trzy kolumny, czyli: płeć, wzrost w calach oraz wagę w funtach, z czego ze względu na specyfikę projektu wykorzystywane są jedynie wzrost oraz waga. Każdy z parametrów zawiera po 10 tysięcy unikalnych wartości.\n",
"\n",
2021-06-27 17:34:20 +02:00
"![image.png](attachment:image.png)\n",
"\n",
"Dokładne informacje na temat tego zbioru, jego zawartości i samych danych można znaleźć pod adresem: https://www.kaggle.com/mustafaali96/weight-height."
]
},
{
"cell_type": "code",
2021-06-27 20:23:26 +02:00
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"import pandas as pd\n",
"import random\n",
"import matplotlib.pyplot as plt\n",
"import numpy as np\n",
"import ipywidgets as widgets\n",
"np.set_printoptions(suppress=True)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## 1. Wczytywanie i preprocessing danych"
]
},
2021-06-24 13:03:10 +02:00
{
"cell_type": "code",
2021-06-27 20:23:26 +02:00
"execution_count": 2,
2021-06-24 11:07:41 +02:00
"metadata": {},
2021-06-25 01:36:15 +02:00
"outputs": [],
2021-06-24 11:07:41 +02:00
"source": [
2021-06-27 11:07:37 +02:00
"# Stopień wielomianu\n",
"degree = 4\n",
"X_plot = np.linspace(0, 100, 1000)\n",
2021-06-25 01:36:15 +02:00
"initial_theta = np.matrix([0] * (degree + 1)).reshape(degree + 1, 1)"
2021-06-24 11:07:41 +02:00
]
},
{
"cell_type": "code",
2021-06-27 20:23:26 +02:00
"execution_count": 3,
2021-06-24 11:07:41 +02:00
"metadata": {},
2021-06-25 01:36:15 +02:00
"outputs": [],
2021-06-24 11:07:41 +02:00
"source": [
"# Wybór dwóch kolumn - dotyczących wzrostu i wagi\n",
2021-06-25 01:36:15 +02:00
"data = pd.read_csv('weight-height.csv')[[\"Height\", \"Weight\"]]\n",
"# Czyszczenie tabeli i wartości pustych\n",
2021-06-25 01:36:15 +02:00
"data = data.dropna()\n",
"data_matrix = np.matrix(data)\n",
"\n",
"m, n_plus_1 = data_matrix.shape\n",
"n = n_plus_1 - 1\n",
"X = (np.ones((m, 1)))\n",
"\n",
"for i in range(1, degree + 1):\n",
" Xn = np.power(data_matrix[:, 0:n], i)\n",
" Xn /= np.amax(Xn, axis=0)\n",
" X = np.concatenate((X, Xn), axis=1)\n",
"\n",
"X = np.matrix(X).reshape(m, degree * n + 1)\n",
"Y = np.matrix(data_matrix[:, -1])"
2021-06-24 11:07:41 +02:00
]
2021-06-24 13:03:10 +02:00
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
2021-06-27 17:34:20 +02:00
"## 2. Metody regresji wielomianowej"
2021-06-24 13:03:10 +02:00
]
},
{
"cell_type": "code",
2021-06-27 20:23:26 +02:00
"execution_count": 4,
2021-06-27 17:34:20 +02:00
"metadata": {},
"outputs": [],
2021-06-24 13:03:10 +02:00
"source": [
2021-06-27 14:09:23 +02:00
"def print_theta(theta):\n",
" print(\"f(x) = \", end=\"\")\n",
" for i,x in enumerate(theta.tolist()[:-1]):\n",
" x = x[0]\n",
" print(f\"{x}x^{i}\", end=\" + \")\n",
" print(f\"{theta.tolist()[-1][0]}^{len(theta) - 1}\")\n",
"\n",
"# Implementacja wzrosu na regresję wielomianową\n",
2021-06-24 13:03:10 +02:00
"def polynomial_regression(theta, x):\n",
2021-06-27 11:07:37 +02:00
" x = x/data[\"Height\"].max()\n",
2021-06-25 01:36:15 +02:00
" return sum(theta * np.power(x, i) for i, theta in enumerate(theta.tolist()))\n",
2021-06-24 13:03:10 +02:00
"\n",
"# Implementacja wzoru na RMSE, czyli pierwiastek z błędu średniokwadratowego\n",
2021-06-25 01:36:15 +02:00
"def mean_squared_error(theta, X, Y):\n",
" J = 1.0 / (2.0 * m) * ((X * theta - Y).T * (X * theta - Y))\n",
2021-06-27 17:34:20 +02:00
" return J.item()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## 3. Wybrane rodzaje gradientów"
]
},
{
"attachments": {
"image.png": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAeIAAAIRCAYAAACWB76JAAAgAElEQVR4Ae29z6t1aXbfdyXR3QIT0TcxDgkd0tTASTA4sgrjBAsUSA0CISAaCjxwoAmhkAMZZGDVxCBBJoUhCDIw6ZECnoQaxH/AO9AkkEEKrGAyLJyBBt0WfSNDd0eJnTrhc+673vvcfffvvX49e68HDuecffbZz3q+68d3rfXsc+/DrUYhUAgUAoVAIVAIhCHwEDZzTVwIFAKFQCFQCBQCtyLiMoJCoBAoBAqBQiAQgSLiQPBr6kKgECgECoFCoIi4bKAQKAQKgUKgEAhEoIg4EPyauhAoBAqBQqAQKCIuGygECoFCoBAoBAIRKCIOBL+mLgQKgUKgEDg3At98883iAouIFyGqEwqBQqAQKAQKgW0IQMDtY+7bRcRz6NRnhUAhUAgUAoXATgSEiJe+XkS8hFB9XggUAoVAIVAI7EBA2tLyPHWJIuIpZOp4IVAIFAKFQCHggEARsQPINUUhUAgUAoVAITCFQBHxFDJ1vBAoBAqBQqAQcECgiNgB5JqiECgECoFCoBCYQqCIeAqZOl4IFAKFQCFQCDggUETsAHJNUQgUAoVAIVAITCFQRDyFTB0vBAqBQqAQKAQcECgidgC5pigECoFCoBAoBKYQKCKeQqaOFwKFQCFQCBQCDggUETuAXFMUAoVAIVAIFAJTCBQRTyFTx0+LwNPT7fbu3cvjRz+63T7//PXjk09utyOPTz99fb3h9ZmzleGrr04Ldy2sECgEFhAoIl4AqD7uB4GWYIX4IEQI9eOPb7fHxxdy/eyz10Q5JEYhyT2r//rr1yQr1+J5jPSRtSX9h4dneTkmcn7xxcs198hU3ykECoG8CBQR59VNSTaCAJXjl18+kygkBVl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zNAKkLp0AAP6Ijg23iT7zm2NkGiUb539m0um89RcT7cHvzLZxKgsabD5MdILDJb3+LgJMpp8R5hQD2KfcrkDCesUqWdjXrPGPC8Uqh9WYUgSLiUVi2HRRHyh4kRM6qgLfpt87OgYBUyVSRvD7bgIirXX02ra5bTxHxOpwmzyIg4DyZK0vZA+ZnVJnlnAS5PigEGgSkSsbvzlZFsjZpV1d13Cj95C+LiA8omMoy85+qxKmREceum0IOKLq+mhIBiKptW58pyZRfXZTfpjQ9daGKiHdCCsHxyDokQJ2xhZcV85IrDgHs/Gz3PUh1nDnZj9P4uWYuIt6oT7JwKkyILuOQfeCztewyYl0y5UMAQsY/eeALZxiSZJxlPWfQifYaiog3IAoJZ70zus2ez9Si26CeOrUQ+IAAN07SsTrL33om9vT8p3I/KKZejCJQRDwKy9uDmUmY6rfutnyrszpSCJCUCiGfYb+VvWOSi+y/0CjL24ZAEfEKvLKSMIHljHeOrlBJnVIIbEJACPkMNy5CwuL3m0Cok9MiUES8oJqsJCxVcGXGCwqsjwuBBgEh5KxbTI2osy+JSxIDaitqFqouPiwinlFTRhKubHhGYSs/InDRTZAHAU0e7MPJzT48Pz7ebg8PzxVIe3zNa77HY3iuzMUzN+IgRyVUK5WndJoQMm1e8O91IDtrqH8i0asGn+UuIp7QX0YSJnCTyVfQnlBacxiMuMtUSE/IkKDFa/YN5TOehZR5RvcWg+u28xA8RQaRD+KX1/KZkLWVXBZr7eWaELIkX736FXbBGniUjfRiea/lLCJ+jceHdwRDAmCGQbBAHgJzjdcItIQLuYKTkC14CYn1FmSlah8mE0LUrA0ih9hrHEcAHLEdbAjsexzYeiXqPWrudisiHtGbVEsjH7kfwrkglvoN4XO2T8CEhIRwqQJ4Dz5XISUhadaNrRJ8sZEWi17JxN3BBhOKv4Ftj9UlCWfv+98DlVzibRHxQM0E
}
},
"cell_type": "markdown",
"metadata": {},
"source": [
"Metoda gradientu prostego to algorytm numeryczny mający na celu znalezienie minimum lokalnego dla zadanej funkcji celu. Jak sama nazwa wskazuje jest to jedna z prostszych metod, która opiera się na iteracyjnym poszukiwaniu minimum. Proces ten (dla pierwszych czterech kroków), został pokazany na poniższym rysunku.\n",
"![image.png](attachment:image.png)"
]
},
2021-06-27 20:23:26 +02:00
{
"attachments": {
"image.png": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAA70AAAFDCAYAAAD22mnsAAAgAElEQVR4Aey9i5MV1b33/fwBp97UqefkVl5m9gCHPSC3Y0TfWEblMigMaAheciByDorUaLQgJuflIFFHAoxIEIgKMUclyiUqCnEorAcPRnDAwQHHh0GMAySMWB7HGzMJMpMw7t9bq7tX9+q1e3ev3rt77758qaJm797d6/JZq7vXb/1u/4vwDwRAAARAAARAAARAAARAAARAAAQSSuB/JbRf6BYIgAAIgAAIgAAIgAAIgAAIgAAIEIReTAIQAAEQAAEQAAEQAAEQAAEQAIHEEoDQm9ihRcdAAARAAARAAARAAARAAARAAAQg9GIOgAAIgAAIgAAIgAAIgAAIgAAIJJYAhN7EDi06BgIgAAIgAAIgAAIgAAIgAAIgAKEXcwAEQAAEQAAEQAAEQAAEQAAEQCCxBCD0JnZo0TEQAAEQAAEQAAEQAAEQAAEQAAEIvZgDIAACIAACIAACIAACIAACIAACiSUAoTexQ4uOgQAIgAAIgAAIgAAIgAAIgAAIQOjFHAABEAABEAABEAABEAABEAABEEgsAQi9iR1adAwEQAAEQAAEQAAEQAAEQAAEQABCL+YACIAACIAACIAACIAACIAACIBAYglA6E3s0KJjIAACIAACIAACIAACIAACIAACEHoxB0AABEAABEAABEAABEAABEAABBJLAEJvYocWHQMBEAABEAABEAABEAABEAABEIDQizkAAiAAAiAAAiAAAiAAAiAAAiCQWAIQehM7tOgYCIAACIAACIAACIAACIAACIAAhF7MARAAARAAARAAARAAARAAARAAgcQSgNCb2KFFx0AABEAABEAABEAABEAABEAABCD0Yg6AAAiAAAiAAAiAAAiAAAiAAAgklgCE3sQOLToGAiAAAiAAAiAAAiAAAiAAAiAAoRdzAARAAARAAARKJH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qCTm2ZpAm/1yPn06ulEdQ2dAQEQiASBXtr54wu158zg27CxFokhiVgjIPRGbEDQHBAAARCIMwEIvXEevXDazk0PM5ksNe5BsJlwKKNUEAAB+nwn3cX8ezNwocBsyCcAoTefCY6AAAiAAAgUSQBCb5HgknrZmd20uFbXvgxfsIv+ktR+ol8gAAKRIHC6+Q7NzBmbbJEYjkg1AkJvpIYDjQEBEACBeBOA0Bvv8Qu29f20e9H5ulnz4Dm09eNgS0dpIAACIJBPoJu2zP6m9typGvUA7T2bfwaOpJMAhN50jjt6DQIgAAKhEIiN0JvrpPXjztMWRswULmn/q69+nI5WOFjU2ZZGusJge+36o6HMNxQaPIGefWvoh9fNp+Zio+D27KYlU6fQT5CSKvjBiVqJPS20dtZk+smOYicL0fvPzKL62Y9Ra4BmILmO1Vo0Z/Zcv3pZKyLFR23eVKg9EHorBB7VggAIgEASCcRH6G2jh2ovSJywawnvWfrJK3+t3BQ710FrjU0FaFsqNwx+a+5qvocmZLJUag7lnhaWQiZLN64/CoHD7yDE5PzcBzvpZ+MvKD0au5HKrKZuIe0qXnaWqFlWJpmaOlr3nvQzvqaSAITeVA47Og0CIAAC4RCIjdBLRDzFhSUoShrfmkupac9n1PtFb5n+f0Kdbftp/xvs/x/od79+mFauWkp3z5pC9RNG+hbQa27YSKfCGWbPUj9+bqbZ3pueOeF5Pk6oPAEecCwozdj7T00l5ldZqgBdeTJoQR6BM220ZNz5lLlqObUGYT5s+P7XTFpO7UGUR0S5zqdpenW19hxi0Zw/zesEDqSNAITetI04+gsCIAACIRKIk9BLZKW4KCT4BrkIKxn7QD/1/k8nHfz9b+nn8ybT2OH6gq5Q2zM1V9K6IyXX6r8AIXhV
}
},
"cell_type": "markdown",
"metadata": {},
"source": [
"Metoda gradientu prostego\n",
"![image.png](attachment:image.png)"
]
},
2021-06-27 17:34:20 +02:00
{
"cell_type": "code",
2021-06-27 20:23:26 +02:00
"execution_count": 5,
2021-06-27 17:34:20 +02:00
"metadata": {},
"outputs": [],
"source": [
"# Wzór na gradient prosty\n",
2021-06-27 11:07:37 +02:00
"def gradient(theta, X, Y):\n",
2021-06-27 17:34:20 +02:00
" return 1.0 / len(Y) * (X.T * (X * theta - Y)) "
]
},
2021-06-27 20:23:26 +02:00
{
"attachments": {
"image.png": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAY0AAAElCAYAAAAY6L5SAAAgAElEQVR4Ae2dCbxNVfvHr8wkM1GmNJjSgHo1aJJKKnmjOYXX26iiKBV/3kukIlEJzTQX0iBNlDmlaKCiIpoMzYV6/p/vYl9nvGfvs/c5Z+99nufzuZ97hr3XXuu391nPWs/wewpERRFQBBQBRUARsIlAgc3j9DBFQBFQBBQBRUBUaehDoAgoAoqAImAbAVUatqHSAxUBRUARUARUaegzoAg4RODXX3+VL7/8UpYuXSqvvvqqTJ06Ve6++275v//7P0//hg0bJpMmTZIZM2bIokWLzDV///13h73VwxUBbxFQpeEtntpawBDYsmWLfPHFF7J48WJ56aWX5NFHH5UxY8bIzTffLJdddpl069ZNjj/+eDnooINkr732knLlyknFihWlQYMGcuihh8qJJ54o5557rlx55ZVGYXDejTfeKP3795e+ffvK1Vdfbb6jrf/85z/So0cP6d69u1xwwQVyzjnnSNeuXaVLly5yxhlnyKmnnionn3yyafO4446T1q1bS/369aVs2bJSUFBQ9LfHHnvIvvvuK0ceeaQ599JLL5XBgwfL+PHj5ZlnnpG5c+fKypUrhbGpKAJeI6BKw2tEtT3fIfDLL7/Iu+++K1OmTJFBgwbJ2WefLYcccohUqFBBKleuLPvss4+0adNGTjnlFDOZM9H/73//k3vuuUeeeuopef3112XZsmWybt06+eOPP3IyPhQAigCFgGJAQaAoUBgoHRQIigSFEqlgUDgoHhQQCrCwsFCmT58uq1evzsk49KLBR0CVRvDvoY5gJwJMrOwWRo8ebSZTVut169Y1k2jVqlWlXbt2ZtU/YcIEmT9/vmBmCqNgwsJ8hkkL0xYmLkxdF198sRx22GGy++67G0z437ZtW/nvf/8r48aNkzlz5simTZvCCImO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OkpDrQsgzz1f79u3VdOXw5qnScAhY0A8njp8dBdXY+vbtm9NEPHwM0IsQsUTuAwqCPwot8dmDDz5oQlqDjnkY+29xiqFAeJagQ6fqX5Bk48aNMnbsWBNSje8D05XWSE99B1VppMYoFEfg8GRrjp2aH3gu6maT00HNbhLYUAwoCIgMyTG4/fbbZe7cuaHJIwjFQ2NzEPiXLKVP5vaSJUtsnumfw5599lmT84HyIBBEJTkCqjSSYxOKbyiJSqw+ZigS87LtIH7rrbcM9bVVlIdcD0wCRDrNmzcvFBjrIHYgwO6DbHgWAx07djSmxKBhQ9gxXFcUj8KXphKPgCqNeExC8QlhstBUsJLHd7F48eKsjIvr3HbbbWbSsJzWFOChLyQJKtNtVm5DTi/CrhbfB8oDGhSy1oMkBFWw8yXaiiRQFj4quxBQpbELi1C8IiwSriQeeMw+JHNlUqDRYDtPVA0V+JgoMFXAhUTGsdaJziT6/m6bMG7IGwlkgD8L4sUgCQzNOMyhZCH5kWddRUSVRoieAqjJye6FTiFTobMoJbbwRFyRBIaSILcDXiYiaZQKPUQPlEdDYXc5aNAg86xgmgyaWRJuMsKOK1WqZPyB+Z4kqkrDox9GLpuB7gOqDEwBkydPzkhXcBSSJQwdByvH8847z5gdNFEqI3CHslGeFZ4bFhqXXXZZ4OhbMK926tRJGjdubHi9QnmTbAxKlYYNkPx6CKR0OBwpowoVhNf+AsJzofZGSZQpU8b84KnxrKIIuEGA57ZNmzZm5Q7RYNCEHTU0OzAQsGDLN1GlEcA7zvaeVT/x8YMHD/aUmpuSm5D8WYl1cDk98sgjgadAD+BtDn2XYeFlQcIOmaTNIAmsybARwB6Ms5woxXwRVRoButM4FmFnJWyVid0rRlJstuRuWFTh
}
},
"cell_type": "markdown",
"metadata": {},
"source": [
"Metoda najszybszego spadku jest iteracyjnym algorytmem wyszukiwania minimym zadanej funkcji celu i stanowi modyfikację gradientu prostego. Na samym początku algorytmu wybierany jest punkt startowy, w którym jest obliczany antygradient funkcji celu stanowiący kierunek poszukiwań w procedurze. Kolejny krok jest obliczany w oparciu o poprzedni i jeżeli nie spełnia on warunku stopu to obliczenia są powtarzane do skutku. \n",
"\n",
"Podstawową różnicę w stosunku do gradientu prostego stanowi sposób wyszukiwania wartości, która jest dokonywana przez minimalizację kierunkową funkcji. \n",
"\n",
"![image.png](attachment:image.png)"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [],
"source": [
"# Steepest descent\n",
"def steepest_descent(X, Y, theta, cost_function = mean_squared_error, \n",
" single_step=0.01, epochs=30):\n",
" cost = cost_function(theta, X, Y)\n",
" logs = [[cost, theta]]\n",
" for i in range(epochs):\n",
" direction = gradient(theta, X, Y)\n",
" j = 0\n",
" while(True):\n",
" j+=1\n",
" next_theta = theta - single_step * direction\n",
" next_cost = cost_function(next_theta, X, Y)\n",
" if(next_cost >= cost or type(next_cost) != float):\n",
" break\n",
" cost = next_cost\n",
" theta = next_theta\n",
" logs.append([next_cost, theta])\n",
" return theta, logs"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Ponadto w toku prac projektowych przetestowane zostaly także inne algorytmy takie jak batch gradient descend (BGD), BGD z momentum, mini-batch gradient descend oraz stochastic gradient descend. \n",
"\n",
"BGD to metoda w której błąd obliczany jest dla każdego parametru ze zbioru treningowego, ale sam model jest aktualizowany dopiero po ocenie wszystkich danych. \n",
"\n",
"MBGD opiera się na podziale danch treningowych na niewielkie pakiety, które są potem wykorzystywane do obliczania wartości błędu i aktualizacji modelu.\n",
"\n"
]
},
2021-06-27 17:34:20 +02:00
{
"cell_type": "code",
2021-06-27 20:23:26 +02:00
"execution_count": 7,
2021-06-27 17:34:20 +02:00
"metadata": {
"scrolled": true
},
"outputs": [],
"source": [
2021-06-27 20:23:26 +02:00
"# Batch gradient descend (BGD)\n",
"def BGD(X, Y, theta, cost_function = mean_squared_error, learning_rate=0.1, \n",
" eps=10**-5, max_steps = 10000000000):\n",
2021-06-27 11:07:37 +02:00
" cost = cost_function(theta, X, Y)\n",
" logs = [[cost, theta]]\n",
" \n",
" for i in range(max_steps):\n",
2021-06-27 14:09:23 +02:00
" theta = theta - learning_rate * gradient(theta, X, Y)\n",
2021-06-27 11:07:37 +02:00
" next_cost = cost_function(theta, X, Y)\n",
" logs.append([next_cost, theta])\n",
" if abs(cost - next_cost) <= eps:\n",
" break\n",
" cost = next_cost\n",
" return theta, logs\n",
"\n",
2021-06-27 14:09:23 +02:00
"# BGD z momentum\n",
2021-06-27 20:23:26 +02:00
"def momentum(X, Y, theta, cost_function = mean_squared_error, \n",
" learning_rate=0.1, momentum = 0.9, epochs=30):\n",
2021-06-25 01:36:15 +02:00
" cost = cost_function(theta, X, Y)\n",
2021-06-24 13:03:10 +02:00
" logs = [[cost, theta]]\n",
2021-06-27 14:09:23 +02:00
" delta_history = [np.matrix([0]*(degree+1)).T]\n",
" for i in range(epochs):\n",
2021-06-27 20:23:26 +02:00
" delta_history.append(momentum * delta_history[-1] + \n",
" learning_rate * gradient(theta, X, Y))\n",
2021-06-27 14:09:23 +02:00
" theta = theta - delta_history[-1]\n",
2021-06-25 01:36:15 +02:00
" next_cost = cost_function(theta, X, Y)\n",
2021-06-24 13:03:10 +02:00
" logs.append([next_cost, theta])\n",
2021-06-25 01:36:15 +02:00
" cost = next_cost\n",
2021-06-24 13:03:10 +02:00
" return theta, logs\n",
2021-06-25 09:42:03 +02:00
"\n",
2021-06-27 20:23:26 +02:00
"# Mini-batch gradient descend (MBGD)\n",
"def MBGD(X, Y, theta, cost_function = mean_squared_error, \n",
" learning_rate=0.1, epochs=5, batch_size=16):\n",
2021-06-25 09:42:03 +02:00
" cost = cost_function(theta, X, Y)\n",
" logs = [[cost, theta]]\n",
" start, end = 0, batch_size\n",
2021-06-24 13:03:10 +02:00
" \n",
2021-06-25 09:42:03 +02:00
" steps = m / batch_size\n",
" for i in range(epochs):\n",
" zipped_XY = list(zip(X, Y))\n",
" random.shuffle(zipped_XY)\n",
" X_shuffled, Y_shuffled = zip(*zipped_XY)\n",
" X_shuffled = np.concatenate(X_shuffled, axis=0) \n",
" Y_shuffled = np.concatenate(Y_shuffled, axis=0) \n",
" for j in range(int(steps)):\n",
" batch = X_shuffled[start:end,:], Y_shuffled[start:end,:]\n",
2021-06-27 14:09:23 +02:00
" theta = theta - learning_rate * gradient(theta, batch[0], batch[1])\n",
2021-06-25 09:42:03 +02:00
" cost = cost_function(theta, X, Y)\n",
" logs.append([cost, theta])\n",
"\n",
" if start + batch_size < batch_size:\n",
" start += batch_size\n",
" else:\n",
" start = 0\n",
" end = min(start + batch_size, m)\n",
" return theta, logs\n",
"\n",
2021-06-27 20:23:26 +02:00
"# Stochastic gradient descend (SGD)\n",
"def SGD(X, Y, theta, cost_function = mean_squared_error, learning_rate=0.1,\n",
" epochs=5):\n",
" return MBGD(X, Y, theta, cost_function, learning_rate, epochs, 1)"
2021-06-27 17:34:20 +02:00
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## 4. Zestawienie wyników"
]
},
{
"cell_type": "code",
2021-06-27 20:23:26 +02:00
"execution_count": 8,
2021-06-27 17:34:20 +02:00
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
2021-06-27 20:23:26 +02:00
"SGD:\n",
"f(x) = 34.06033951445318x^0 + 43.85258948907885x^1 + 49.46046316253574x^2 + 52.05621808156889x^3 + 52.51952473344481^4\n",
"600001 updates\n",
"\n",
2021-06-27 17:34:20 +02:00
"BGD:\n",
2021-06-27 20:23:26 +02:00
"f(x) = -65.64506277392528x^0 + 68.77648241256031x^1 + 114.75349304333466x^2 + 102.20675310280708x^3 + 52.80014652046691^4\n",
2021-06-27 17:34:20 +02:00
"82705 updates\n",
"\n",
"MBGD:\n",
2021-06-27 20:23:26 +02:00
"f(x) = -32.29122418991072x^0 + 53.876193091384174x^1 + 86.86638770732357x^2 + 84.88913589397598x^3 + 60.97817901045005^4\n",
2021-06-27 17:34:20 +02:00
"37501 updates\n",
"\n",
"momentum:\n",
2021-06-27 20:23:26 +02:00
"f(x) = 8.015549563834169x^0 + 38.129978604712115x^1 + 58.33870778356634x^2 + 71.22019895802788x^3 + 78.72511869002662^4\n",
"61 updates\n",
"\n",
"steepest descent:\n",
2021-06-27 20:23:26 +02:00
"f(x) = 13.63864883159118x^0 + 39.09249361981945x^1 + 55.99541645170295x^2 + 66.58927282539138x^3 + 72.568097240031^4\n",
2021-06-27 17:34:20 +02:00
"61 updates\n",
"\n"
]
}
],
"source": [
2021-06-27 20:23:26 +02:00
"final_theta_SGD, logs_3 = SGD(X, Y, initial_theta, epochs = 60)\n",
"print(\"SGD:\")\n",
"print_theta(final_theta_SGD)\n",
"print(f\"{len(logs_3)} updates\\n\")\n",
"\n",
2021-06-27 14:09:23 +02:00
"final_theta_BGD, logs_1 = BGD(X, Y, initial_theta)\n",
"print(\"BGD:\")\n",
"print_theta(final_theta_BGD)\n",
"print(f\"{len(logs_1)} updates\\n\")\n",
"\n",
"final_theta_MBGD, logs_2 = MBGD(X, Y, initial_theta, epochs = 60)\n",
"print(\"MBGD:\")\n",
"print_theta(final_theta_MBGD)\n",
"print(f\"{len(logs_2)} updates\\n\")\n",
"\n",
2021-06-25 09:42:03 +02:00
"\n",
2021-06-27 14:09:23 +02:00
"final_theta_momentum, logs_4 = momentum(X, Y, initial_theta, epochs = 60)\n",
"print(\"momentum:\")\n",
"print_theta(final_theta_momentum)\n",
"print(f\"{len(logs_4)} updates\\n\")\n",
"\n",
"final_steepest_descent, logs_5 = steepest_descent(X, Y, initial_theta, epochs = 60)\n",
"print(\"steepest descent:\")\n",
"print_theta(final_steepest_descent)\n",
"print(f\"{len(logs_5)} updates\\n\")"
2021-06-25 01:36:15 +02:00
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
2021-06-27 20:23:26 +02:00
"Wniosek:\n",
"Metoda najszybszego spadku oraz momentum cechują się najszybszą zbieżnością do minimum lokalnego danej funkcji. Przeciętnie, dla zadanych parametrów, minimum jest osiągane w ciągu 61 aktualizacji. Podczas gdy SGD wymaga ich ponad 600 tysięcy. "
2021-06-24 13:03:10 +02:00
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## 4. Reprezentacja graficzna regresji wielomianowej i funkcji kosztu"
2021-06-24 13:03:10 +02:00
]
},
{
"cell_type": "code",
2021-06-27 20:23:26 +02:00
"execution_count": 14,
2021-06-25 01:36:15 +02:00
"metadata": {
2021-06-27 17:34:20 +02:00
"scrolled": false
2021-06-25 01:36:15 +02:00
},
2021-06-24 13:03:10 +02:00
"outputs": [
2021-06-27 14:09:23 +02:00
{
"name": "stdout",
"output_type": "stream",
"text": [
"BGD:\n"
]
},
{
"data": {
2021-06-27 17:34:20 +02:00
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAlYAAAEzCAYAAADzdE1rAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuNCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8QVMy6AAAACXBIWXMAAAsTAAALEwEAmpwYAAAxRElEQVR4nO3deXxcVf3/8dcnadImDU1pylK7JEWKLBZBApStLCkUKqWAIkvQimhkUVsBEYiCVSIIgoWfVoyyFBlBvlqWQssWQEWWkrKYstnaJqFQu0K6pEuW8/vjTtpJO1nn3pnJzPv5ePSRmzv3nnN4XJp8es7nfo455xARERGR2GUkegAiIiIiqUKBlYiIiIhPFFiJiIiI+ESBlYiIiIhPFFiJiIiI+ESBlYiIiIhPugyszGykmb1gZu+Z2TtmNi18/qdm9pGZvRX+MyninmvNbImZfWBmE4P8DxARERFJFtZVHSszGwYMc869YWa7AQuBM4GvAhudc7/a6foDgQeBI4DPAM8B+znnWvwfvoiIiEjy6HLGyjm3wjn3Rvh4A/AeMLyTW6YADznntjrnlgFL8IIsERERkZTWoxwrMysCDgVeC5/6rpn928zuMbPdw+eGAx9G3LaczgMxERERkZTQr7sXmlke8DdgunNuvZn9Dvg54MJfbwO+CViU23dZbzSzMqAMYODAgYftv//+PR+9iIikvYUfL+zR9XtvhOEbYH02LC7Y6UOD0YNHMy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VQPwjuPNKfNpWsLonQoxwrMysCDgVeA/Zyzq0AL/gC9gxfNhz4MOK25eFzO7dVZmbVZla9evXqXgxdRES
2021-06-27 14:09:23 +02:00
"text/plain": [
"<Figure size 720x360 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAnEAAAE9CAYAAABk/zSyAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuNCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8QVMy6AAAACXBIWXMAAAsTAAALEwEAmpwYAAAd1UlEQVR4nO3df7BfdX3n8eeLRAKiIMiFYgIm1lQL1GJzl0VrW7e0JbauoR2ocbSkLbNZGLqibdeS9Q/rzrDVta1KLXQYUYJlQUrpkjqi0tBqO0XwotQQEElFIRIhVopZrbGB9/7x/aT9crm5Cfr9cc+9z8fMd77n+z7nc87neLyZF+fH56SqkCRJUrccNO4OSJIk6ekzxEmSJHWQIU6SJKmDDHGSJEkdZIiTJEnqIEOcJElSBy0e1oqTfAB4NfBIVZ08bd5vA+8CJqrq6622ATgXeBx4Y1V9vNVXAVcChwIfBS6sqkqyBLgKWAX8E/Daqvry/vp19NFH1/Llywexi5IkSUN1xx13fL2qJmaaN7QQRy94vY9e0Po3SY4HfhZ4oK92IrAWOAl4HvBXSX6oqh4HLgPWA5+mF+JWAzfRC3yPVtULk6wF3gm8dn+dWr58OVNTU9/3zkmSJA1bkq/sa97QLqdW1aeAb8ww693AW4D+UYbXANdW1e6quh/YBpya5Djg8Kq6tXqjEl8FnNnXZmObvh44PUkGvyeSJElzz0jviUvyGuCrVfUP02YtBR7s+7291Za26en1J7Wpqj3AY8Bzh9BtSZKkOWeYl1OfJMkzgbcCPzfT7BlqNUt9tjYzbXs9vUuynHDCCfvtqyRJ0lw3yjNxPwisAP4hyZeBZcBnk/wAvTNsx/ctuwx4qNWXzVCnv02SxcARzHz5lqq6vKomq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720x360 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
},
2021-06-27 14:09:23 +02:00
{
"name": "stdout",
"output_type": "stream",
"text": [
"MBGD:\n"
]
},
{
"data": {
2021-06-27 20:23:26 +02:00
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAlYAAAEzCAYAAADzdE1rAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuNCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8QVMy6AAAACXBIWXMAAAsTAAALEwEAmpwYAAAyq0lEQVR4nO3deXhU5fn/8fedkEBCNEoEakESRGprxaXGvf1WG1cUQeseFLdGERXccEmrpb+mtW7F1qJN3VDmi0VFFgVRo36tS9VQixEVxZIgShWCBDQRsjy/P84EA0z2M3MmM5/XdXFx5sxZbq8j5OZ57nM/5pxDRERERLovJegARERERBKFEisRERERnyixEhEREfGJEisRERERnyixEhEREfGJEisRERERn7SbWJnZbmb2opm9b2ZLzWxieP+vzexTM/t3+NfIFufcYGbLzWyZmR0bzf8AERERkXhh7fWxMrNdgV2dc/8ysx2AxcAY4HTgK+fc7dscvxcwEzgI+C7wPPA951yj/+GLiIiIxI92R6ycc6udc/8Kb28E3gcGtXHKaOBR59wm59wKYDlekiUiIiKS0DpVY2VmecD+wBvhXZeZ2Ttm9oCZ7RzeNwj4pMVpq2g7ERMRERFJCL06eqCZZQFPAJOccxvM7B7g/wEu/PsdwAWARTh9u/lGMysCigD69u17wPe///3ORy8iIklv8WeL/buYwdCdhtKv1kFlJaSnw957g0X60SbJavHixWudc/0jfdehxMrM0vCSqpBzbjaAc+7zFt//DXgq/HEVsFuL0wcDn217TedcKVAKkJ+f78rLyzsSioiIyFbypuZRVVPly7UM4z83fAB77untuO8+OOccX64ticPMWv0friNvBRpwP/C+c+7OFvt3bXHYycC74e15wJlm1tvMhgLDgTe7EriIiEh7SgpKyEzL9OVaQ7KHeMlUZSXrhw1i9zW/JGVKCnlT8whVhHy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z2u1Y/k3DNzGL6acrvm2vcP1R3buWWi6IX1S8LiIibdq2IL1lx3Lw6qpiXaeU0gR3PeNt//7H8Gl2++dkpmWS0SuD6rrq7b5TywXxixIrERFpU6SC9Nr6WiYunEhdQ13Mi9UBLvoX7Ps5VGbDHR1or5CTkcNdx98FsN1bi5lpmZQUlEQrVEkymgoUEZE2tTZNVl1XHUhStVMdlISX/Lv2GPgmrf1z6hrqAG9NwNJRpeRm52IYudm5lI4q1VqB4htzzgUdA/n5+a68vDzoMEREJIK8qXlx1ZLgzmfgyn/C/+XCEeex3ULLrcnNzqVyUmUUI5NkYWaLnXP5kb7TiJWIiLSppKCEzLTMrfZlpmWSk5ET81j2XAOXvQlNwMTj6HBSBSpQl9hQYiUiIm1qOX0GXt+n2vraiEXg0XbnIkhrgr8dAEt27dy5KlCXWFBiJSIiEbVssVBcVszI4SPpldILRzAlJCcug5HLoaY3/OrIzp2rAnWJFSVWIiKyneYWC1U1VTgcVTVV3Ft+Lw1NDYHE06ce7lrobd90JKzJav+cnIwcFahLzLXbbsHMdgMeBr6DN61d6py7y8z6AX8H8oBK4HTn3Jfhc24ALgQagSucc4uiEr2IiERFpBYLQY1UAUx+FXZfD+8MgL8c2LFzstKzWDt5bVTjEtlWR0asGoCrnXM/AA4BJpjZXsD1QJlzbjhQFv5M+LszgR8CxwHTzCw1GsGLiEh0xFOh99B1cMM/vO3LRkJjB3+ixNN/gySPdhMr59xq59y/wtsbgfeBQcBoYHr4sOnAmPD2aOBR59wm59wKYDlwkM9xi4hIFMVToffUZ7z1AB/ZB/6R1/Hz4um/QZJHp2qszCwP2B94AxjonFsNXvIFDAgfNgj4pMVpq8L7tr1WkZm
"text/plain": [
"<Figure size 720x360 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
},
{
"data": {
2021-06-27 20:23:26 +02:00
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAnEAAAE9CAYAAABk/zSyAAAAOXRFWHRTb2Z0d2FyZQB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iTVkCGuS9JrjEiSpC7qSYiLiHdExH0RcW9EXBcRiyLi+Ii4NSIeKs/HtUy/ISK2RsSDEXF+S/nZEbGljLsyovcX+Oh5BSRJ0rww4yEuIlYAbwUGM/MsoAmsBS4HbsvM1cBt5TURcUYZfyawBvhoRDTL4q4C1gOry2PNDG6KJElSz/TqcGofsDgi+oCjgO3ABcDGMn4jcGEZvgC4PjP3ZubDwFbgnIg4GViWmXdkdezy2pZ5JEmS5rQZD3GZ+QPgfwKPADuApzLzC8BJmbmjTLMDWF5mWQE82rKIbaVsRRmeWC5JkjTn9eJw6nFUvWunAS8Ejo6I35lqljZlOUV5u3Wuj4jNEbF5165dh1tlSZKkWacXh1N/DXg4M3dl5n7gJuBVwGPlECnleWeZfhtwSsv8K6kOv24rwxPLD5KZV2fmYGYODgwMdHRjJEmSeqEXIe4R4NyIOKqcTXoe8ACwCVhXplkH3FyGNwFrI2JhRJxGdQLDXeWQ6+6IOLcs55KWeXrOC4xIkqRu6pvpFWbmnRFxI/A1YAj4OnA1sAS4ISIupQp6F5fp74uIG4D7y/SXZeZwWdxbgGuAxcAt5dFbXmNEkiTNgBkPcQCZ+W7g3ROK91L1yrWb/grgijblm4GzOl5BSZKkWc47NkiSJNWQIU6SJKmGDHGSJEk1ZIjrkvT0VEmS1EWGOEmSpBoyxHVYeI0RSZI0AwxxkiRJNWSIkyRJqqFphbiI+NR0yiRJkjQzptsTd2bri4hoAmd3vjqSJEmajilDXERsiIjdwEsj4uny2A3sZBbdbH42SrzGiCR
2021-06-27 14:09:23 +02:00
"text/plain": [
"<Figure size 720x360 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"SGD:\n"
]
},
2021-06-24 13:03:10 +02:00
{
"data": {
2021-06-27 20:23:26 +02:00
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAlYAAAEzCAYAAADzdE1rAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90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badQWlHquzqlg7bB/KddE9D/HgtzToDcrFxyeuWweefmNu9XywWJFQUrERHpULSC9LqGOqYvmc7Oxp2+LFZ/dh4cvB3+FHBNQPNz8rnvwvsA2ty1mJuVS1lRmVfDlRSjpUAREelQe8tkm3du9l2oArh/CZz2KXy6n2sC2pgJOxt3AlA8upjyCeUE8gIYDIG8AOUTyikeXezxqCVVGGut12OgsLDQVlZWej0MERGJomBmge+W+tpz/VJ4aJErVj/9WlgaUVcVyAtQPaPas7FJ6jDGLLXWFkZ7TTNWIiLSobKiMnKzWt5Ol5uVS35Ovkcjiu7kT+GBF93jGy9uGapABeqSGApWIiLSocjlM3B9n+oa6qIWgXvloG3w+6chu3lvsXprKlCXRFCwEhGRqCJbLJRWlDJ+xHh6ZfTC4n0JSaQ+DfDcUy2L1VtTgbokioKViIi0EW6xUFNbg8VSU1vDg5UP0tjc6PXQWrLwyALXWb06b2+xOrg7AVWgLonWabsFY8xQ4DHgINym4OXW2vuMMQOAp4ECoBq43Fr7z9BnbgeuA5qAf7XWvhyX0YuISFxEa7Hgt5kqgDvegG9/CNuz4JtXwpf99r7WL7sfm27d5N3gJC11ZcaqEfiBtfZo4GTgFmPMSOA2oMJaOwKoCD0n9NoUYBRwATDLGJMZj8GLiEh8JEOh96UroOxV9y/+b18GVQe1fD0Zfg+SejoNVtb
"text/plain": [
"<Figure size 720x360 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
},
{
"data": {
2021-06-27 20:23:26 +02:00
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAnEAAAE9CAYAAABk/zSyAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuNCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8QVMy6AAAACXBIWXMAAAsTAAALEwEAmpwYAAAsPklEQVR4nO3de5xddX3v/9dnZjJJSAgQEgImwQSJF4jKJQLetahEjxX0QA3VklraVEuPt9+pJXpatKdU0XqjFDzUC2Ap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IpZ0dHS82CZLkiQNO83YnfouYGVmdmTmduBy4E3A48UuUorntUX91cD0quWnUdn9urqY7l3+Apl5bmbOycw5kydPHtCNkSRJaoZmhLiHgaMiYrfibNKjgbuBRcD8os584MfF9CJgXkSMjoiZVE5gWFzsct0YEUcV6zmpahlJkqQRrW2o3zAzb46Iy4BbgU7gNuBcYDxwaUScTCXonVDUXxYRlwJ3FfVPycyuYnWfAM4DxgJXFA9JkqQRb8hDHEBmngac1qt4K5VRuVr1TwdOr1G+BJg94A2UJEka5rxjgyRJUgkZ4iRJkkrIECdJklRChjhJkqQSMsRJkiSVkCFOkiSphAxxkiRJJdSvEBcRP+xPmSRJkoZGf0fiDq5+ERGtwOED3xxJkiT1R8MQFxELI2Ij8LqI2FA8NlK5Ob33KZUkSWqShiEuM7+cmbsDX8vMCcVj98zcOzMXDlEbJUmS1Et/d6f+NCLGAUTERyPiGxHx8kFslyRJkhrob4g7B3g2Il4PfA54CLhg0FolSZKkhvob4jozM4FjgW9n5reB3QevWZIkSWqkrZ/1NkbEQuCPgLcWZ6eOGrxmSZI
2021-06-27 14:09:23 +02:00
"text/plain": [
"<Figure size 720x360 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Momentum:\n"
]
},
{
"data": {
2021-06-27 17:34:20 +02:00
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAlYAAAEzCAYAAADzdE1rAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuNCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8QVMy6AAAACXBIWXMAAAsTAAALEwEAmpwYAAA040lEQVR4nO3deXhU5d3/8fedkEBCJEpARZEEBUWUx6Vxp1YNVWQpistDDYpr6lbh1/q4pdZqG+1TWx+sLWrqhjBuVVSouNS4tFoVg1ukiFBNANkXA5hAtvv3xz2BJEz2M3Nm+byua66ZOXPmnNvrSPLJOd/zvY21FhERER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spxsK1n17ajAnWJBAUrEREJqWmLhcKSQsYMHUOPpB5YIldCYhrgL/MgvQ5mj4D5B3dtOypQl0hRsBIRkd00tlioqKzAYqmorOCB0geoa6iL6Diu+AhOLYd16TCtk3VVWWlZKlCXiGu33YIx5gDgcWBf3ATixdbae40xfYGngRygHDjfWrs5+J2bgcuAeuA6a+2rYRm9iIiERagWC5E8UwUwsBLufs29vnYMbOzdue9npGaw4YYN3g9MpA0dOWNVB/zcWnsocDxwjTFmOHATUGKtHQqUBN8T/GwScBgwGphhjOnETbEiIuI33wu9LTzwN+hTA88Pg78e1vlN+P7fIAmp3WBlrV1trf0o+HorsBjYH5gAzAyuNhM4K/h6AvCUtXaHtfZrYBnQiTZuIiLiN78LvfM/g7FL4duecPVYujRtjd//DZKYOlVjZYz
2021-06-24 13:03:10 +02:00
"text/plain": [
"<Figure size 720x360 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAnEAAAE9CAYAAABk/zSyAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuNCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8QVMy6AAAACXBIWXMAAAsTAAALEwEAmpwYAABHa0lEQVR4nO3deXhc5X33//dX0ow0I0saSZZtbV4xGNtgG4zDHggkcSABQkkC2UhDQpPSZmn7NKG5nl+aPqVNmjYJJIU2ZQkkJIRSaEgIW9jCbmxs8ALG8i5LsuVF+z5z//6YM/JgZFnLnJmR+LyuS9ecuWfOmXsOxvr4Xs05h4iIiIhMLDmZroCIiIiIjJ5CnIiIiMgEpBAnIiIiMgEpxImIiIhMQApxIiIiIhOQQpyIiIjIBJTn14XN7Hbgw8A+59ziI177G+D7QIVzbr9Xdj1wDRAFvuKce9QrPxX4GRACfg981TnnzCwfuAs4FTgAfMI5t+NY9Zo6daqbPXt2Kr6iiIiIiK/WrFmz3zlXMdRrvoU44sHrJ8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MQlybxljiNiRMREZHUUIhLk9KwulNFREQkdRTi0iQSDqolTkRERFJGIS5NSkIB2noGiMZcpqsiIiIik4BCXJokdm1o0+QGERERSQGFuDQZ3HpLIU5ERERSQCEuTQa33tK4OBEREUkBhbg0KVFLnIiIiKSQQlyaREJeiFNLnIiIiKSAQlyalIYT3alqiRMREZHxU4hLk+LBljiFOBE
"text/plain": [
"<Figure size 720x360 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Metoda najszybszego spadku:\n"
]
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAlYAAAEzCAYAAADzdE1rAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuNCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8QVMy6AAAACXBIWXMAAAsTAAALEwEAmpwYAAA0Z0lEQVR4nO3deXxU1f3/8ddJSDAhGiUiIJCEr6IWjHWJuCsaWxVFEJeiURFtU5d+xV9bURut0jatX20ttS3a1A11XLC4oWjV1N1WBFzCIhWQIILKomFJDCFzfn+cCVmYJJPkztzJzPv5eOTBzF0Pj6vw5pxzP8dYaxERERGR7kvxuwEiIiIiiULBSkRERMQjClYiIiIiHlGwEhEREfGIgpWIiIiIRxSsRERERDzSYbAyxgwxxrxqjFlijFlkjJkc2n6LMeZzY8wHoZ/Rzc65wRizzBiz1BhzSjR/AyIiIiLxwnRUx8oYMxAYaK1dYIzZFZgPjAPOA7ZYa3/f6vjhwKPASGBv4BVgP2ttg/fNFxEREYkfHfZYWWvXWmsXhD5vBpYAg9o5ZSzwmLW2zlr7KbAMF7JEREREElqn5lgZY/KBQ4B3Q5t+Yoz5yBhznzFmj9C2QcBnzU5bTftBTERERCQh9Ir0QGNMFjALuMZau8kYcxfwa8CGfv0DcClgwpy+03ijMaYEKAHo06fPYQcccEDnWy8iIklv/pr53l3MwNDdh9I3o2/L7Z98Aps2Qb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ltr14ILX8BeocMGAZ81O211aFv
"text/plain": [
"<Figure size 720x360 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAnEAAAE9CAYAAABk/zSyAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuNCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8QVMy6AAAACXBIWXMAAAsTAAALEwEAmpwYAAAlVElEQVR4nO3df7RkZ13n+/fnVFWqIhJ+pclgd7Dj2OokGYymbyag4zBmRjJ3uIRxwdAulKhZty+s3Csy42WS4Q901sodGa4KqMSVBZjEYYiZDFxyXSLGoOLciYkdQUMSMvQQSJpE0gpC/JETuvt7/6h9uqur63Sf7rN31TnN+7VWrdr17F/PfrpXr08/z372TlUhSZKkzWVp0RWQJEnSyTPESZIkbUKGOEmSpE3IECdJkrQJGeIkSZI2IUOcJEnSJtTv6sBJ3ge8HHiiqi6cWvdTwNuBLVX1503ZtcBVwEHgJ6rqo035xcCNwJnAbwJvrKpKMgRuBi4G/gJ4TVV97kT1Ovvss2v79u1tXKIkSVKn7r333j+vqi2z1nUW4hgHr19iHLQOS3Iu8E+BRybKzgd2ARcA3wT8TpJvq6qDwPXAbuAPGYe4y4GPMA58X66qb02yC3gb8JoTVWr79u3s2bNn3RcnSZLUtSSfX21dZ8OpVfVx4EszVv0C8GZg8inDVwC3VNVyVT0M7AUuSfIC4KyquqvGTyW+GXjlxD43Ncu3AZclSftXIkmStPHM9Z64JK8AvlBVfzK1aivw6MTvfU3Z1mZ5uvyofarqAPAV4HkdVFuSJGnD6XI49ShJvgF4C/ADs1bPKKvjlB9vn1nn3s14SJYXvvCFJ6yrJEnSRjfPnri/C5wH/EmSzwHbgD9O8ncY97CdO7HtNuCxpnzbjHIm90nSB57F7OFbquqGqtpZVTu3bJl5b6AkSdKmMrcQV1X3VdXzq2p7VW1nHMK+u6r+DLgd2JVkmOQ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+U74VeHRiu31N2dZmebr8qH2q6gDwFeB5ndX8JI36TmyQJEnd2SgTG2b1oNVxyo+3z7EHT3Yn2ZNkz/79+0+xiidn6MQGSZLUoXmHuC82Q6Q030805fuAcye22wY81pRvm1F+1D5J+sCzOHb4FoCquqGqdlbVzi1btrR0Kcc37C+RwLIhTpIkdWDeIe524Mpm+UrgwxPlu5oZp+cxnsBwTzPk+mSSS5v73V43tc/KsV4FfKy5b25DSMKwv8RTvrFBkiR1oN/VgZN8AHgpcHaSfcBbgZ8Fbk1yFfAI8GqAqro/ya3AA8AB4OqqWunCegPjma5nAh9pPgDvBX4tyV7GPXC7urqWUzXs9xxOlSRJnegsxFXVD62y6rJVtr8OuG5G+R7gwhnlT9GEwI1qNFhi2YkNkiSpAxtlYsNpaTTo+bBfSZLUCUNch0YOp0qSpI4Y4jo0Giz5nDhJktQJQ1yHhgN74iRJUjcMcR3yESOSJKkrhrgOjQY9H/YrSZI6YYjr0GjQY9meOEmS1AFDXIdG/SXviZMkSZ0wxHVo5MQGSZLUEUNch3zEiCRJ6oohrkPD/viNDVW16KpIkqTTjCGuQ6PBElXwtYOGOEmS1C5DXIdGgx6A70+VJEmtM8R1aLgS4pzcIEmSWmaI69CoP27eZSc3SJKklhniOjSyJ06SJHXEENehIyHOnjhJktQuQ1yHhivDqU5skCRJLTPEdcieOEmS1BVDXIdGg3Hzek+cJElqmyGuQz4nTpIkdcUQ16FR3+FUSZLUDUNchxxOlSRJXTHEdWjY9MQtH7AnTpIktcsQ16GhPXGSJKkjhrgODftLJLBsiJMkSS0zxHUoCcP+Ek85nCpJklpmiOvYaNBzOFWSJLVuISEuyZuS3J/kU0k+kGSU5LlJ7kjymeb7ORPbX5tkb5KHkrxsovziJPc1696VJIu4nuMZ9Q1xkiSpfXMPcUm2Aj8B7KyqC4E
"text/plain": [
"<Figure size 720x360 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
2021-06-24 13:03:10 +02:00
}
],
"source": [
"def plot_polynomial_regression(theta):\n",
" fig = plt.figure(figsize=(10,5))\n",
2021-06-25 01:36:15 +02:00
" Y_plot = polynomial_regression(theta, X_plot).tolist()\n",
2021-06-24 13:03:10 +02:00
" chart = fig.add_subplot()\n",
2021-06-27 11:07:37 +02:00
" chart.plot(data[\"Height\"], Y ,\"go\")\n",
2021-06-24 13:03:10 +02:00
" chart.plot(X_plot, Y_plot, color=\"red\", lw=2, label=f\"degree {len(theta)}\")\n",
2021-06-27 11:07:37 +02:00
" plt.ylim([0,250])\n",
2021-06-24 13:03:10 +02:00
" plt.show()\n",
" \n",
"\n",
"def plot_cost_function(logs):\n",
" no_iter = no_iter = [x for x in range(1, len(logs) + 1)]\n",
" all_cost = [row[0] for row in logs]\n",
" \n",
" fig = plt.figure(figsize=(10,5)) \n",
" plt.plot(no_iter, all_cost)\n",
" plt.xlabel('No. of iterations')\n",
" plt.ylabel('Cost')\n",
" plt.show()\n",
" \n",
2021-06-27 14:09:23 +02:00
"\n",
"print(\"BGD:\")\n",
"plot_polynomial_regression(final_theta_BGD)\n",
"plot_cost_function(logs_1)\n",
2021-06-27 14:09:23 +02:00
"print(\"MBGD:\")\n",
"plot_polynomial_regression(final_theta_MBGD)\n",
"plot_cost_function(logs_2)\n",
2021-06-27 14:09:23 +02:00
"print(\"SGD:\")\n",
"plot_polynomial_regression(final_theta_SGD)\n",
"plot_cost_function(logs_3)\n",
2021-06-27 14:09:23 +02:00
"print(\"Momentum:\")\n",
"plot_polynomial_regression(final_theta_momentum)\n",
"plot_cost_function(logs_4)\n",
"print(\"Metoda najszybszego spadku:\")\n",
"plot_polynomial_regression(final_steepest_descent)\n",
"plot_cost_function(logs_5)"
]
},
2021-06-24 13:03:10 +02:00
{
"cell_type": "markdown",
"metadata": {},
"source": [
2021-06-27 17:34:20 +02:00
"## 5. Regresja wielomianowa z wykorzystaniem gotowych bibliotek"
2021-06-24 13:03:10 +02:00
]
},
{
"cell_type": "code",
2021-06-27 20:23:26 +02:00
"execution_count": 10,
2021-06-24 13:03:10 +02:00
"metadata": {},
"outputs": [],
"source": [
"from sklearn.preprocessing import PolynomialFeatures, StandardScaler\n",
"from sklearn.pipeline import make_pipeline\n",
"from sklearn.linear_model import Ridge, LinearRegression"
]
},
{
"cell_type": "code",
2021-06-27 20:23:26 +02:00
"execution_count": 11,
2021-06-24 13:03:10 +02:00
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
2021-06-27 11:07:37 +02:00
"Pipeline(steps=[('polynomialfeatures', PolynomialFeatures(degree=4)),\n",
2021-06-24 13:03:10 +02:00
" ('linearregression', LinearRegression())])"
]
},
2021-06-27 20:23:26 +02:00
"execution_count": 11,
2021-06-24 13:03:10 +02:00
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"model = make_pipeline(PolynomialFeatures(degree=degree, include_bias=True), \n",
" LinearRegression())\n",
2021-06-25 01:36:15 +02:00
"model.fit(data[[\"Height\"]],Y)"
2021-06-24 13:03:10 +02:00
]
},
{
"cell_type": "code",
2021-06-27 20:23:26 +02:00
"execution_count": 12,
2021-06-24 13:03:10 +02:00
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
2021-06-27 11:07:37 +02:00
"4"
2021-06-24 13:03:10 +02:00
]
},
2021-06-27 20:23:26 +02:00
"execution_count": 12,
2021-06-24 13:03:10 +02:00
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
2021-06-27 17:34:20 +02:00
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAmAAAAEzCAYAAACWmb8UAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuNCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8QVMy6AAAACXBIWXMAAAsTAAALEwEAmpwYAAA7OUlEQVR4nO3deXxV1bn/8c/KJAlIlLGokKDiAMYx4oAzWgQFrRUcIqKtRoSqqK1XTZXS301vHWpxAg1WS/WoWMRWEBUbZ61DcAo4gTIqioAymDAl6/fHOgdDyHz2cE7yfd8Xr7Ozc85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7++JJLvqoMjDoTbjuGRpOvrPQsigcW1/sUZKt6OjLmhBPglVfcdmTPPw9nnKFeYc2kBExE4pOe7mbAAD76KNxYJOkVlRZRsaUi+IEtFJfCTa/CVgMFZ8E/Dm78Y6kmlZKhJRTkFdT7FGSrfDoS4JBD4KWX3D6SL7ygJKyZlICJSPwOPti9fvBBmFFIKxDKbJGFP/8HbnzdJV/nnQ3T8hr/WFZ6FlN/MZWCvAIAigcWk5WetcN7Wu3TkeB6AdZMwoYNUxLWRErARCR+SsDEI7HGqkGa8BL8zxuwJQVGDIfp/ep/b6pJBVxdV2zmK6Ygr4CSoSXkZOdgMHW+p1Xq29clYd27w3/+A2eeCZs2hR1VwlMnfBGJ3yGHuNf33w83DklqkfII6zatC3TMq9+Em6PLjuecDU/1rf+9qSaVrTdvbfB6BXkFrT/hqkssCTvhBJgzBy68EB5
2021-06-24 13:03:10 +02:00
"text/plain": [
"<Figure size 720x360 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
2021-06-27 11:07:37 +02:00
"Y_plot_2 = model.predict([[x] for x in X_plot])\n",
2021-06-24 13:03:10 +02:00
"\n",
"fig = plt.figure(figsize=(10,5))\n",
"chart = fig.add_subplot()\n",
2021-06-25 01:36:15 +02:00
"chart.plot(data[\"Height\"], Y ,\"go\")\n",
2021-06-27 11:07:37 +02:00
"chart.plot(X_plot, Y_plot_2, color=\"red\", lw=2, label=f\"degree {degree}\")\n",
"plt.ylim([0,250])\n",
2021-06-27 11:07:37 +02:00
"plt.xlim([0,100])\n",
2021-06-24 13:03:10 +02:00
"degree"
]
2021-06-27 14:09:23 +02:00
},
{
"cell_type": "code",
2021-06-27 20:23:26 +02:00
"execution_count": 13,
2021-06-27 14:09:23 +02:00
"metadata": {},
"outputs": [
{
"data": {
2021-06-27 17:34:20 +02:00
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAlYAAAEzCAYAAADzdE1rAAAAOXRFWHRTb2Z0d2FyZQBN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luwpdgnVkBOJ4ESPUqsRCR9lFgVvJzebBn4lxf8X3yxY+H9cn8tV5NAiSYlViKSPkqsCl4ub7Y8dAtc+oo//8kpu64bRqw1FiQmyT9KrEQkfZRYFbxc3WwZfFI1dBv8pQpeS9rO0uFoaG4IFpfkFyVWIpI+SqzyVqw1RvXMaopuLaJ6ZnWXIzxbtm/JcmS9Yx1+GhA6j1Yl5PJIm0SLOq+LSPooscpLiYL0RO3UkvVLqH9sVzuFhuaGnK9TOmshjF0Hy/Yt4tEjO/Z4Xy0XJF2UWIlI+hxyCAwYAO++69suDB4cOiJJg1QF6W3tbcx4cgabt2/O6WL1hOtfLAHaWXPphQwa/FinmMtKymisbQwXnOQVTQWKSPoMGKA9A/NQV9NkazevjURSdcQa+Oz/1872QSWc8K2f0zSxiaphVRhG1bAqmiY2UTe+LnSYkic0YiUi6XXoobBwoZ8OPOqo0NFIGoweNjrnp/q689V4bdVDJwziy5WV1FXWKZGSjNGIlYikl+qs8k5jbSNlJWWdrpWVlFFZWhkoot5LbrHwg+M3Bo1FCoMSKxFJLyVWeadufN3O6TPwfZ/a2ttYu3lt4Mh6lmix8Gw1rD+yKnQ4UgCUWIlIeimxyhvJLRYamhuYMHYCA4oG4IjGJtvJLRaaThuoAnXJCtVYiUh6KbHKC6laLNzRckdkkiqAC5cNZey6DSwfXszEG37FxaqrkizoccTKzA4xs2f
2021-06-27 14:09:23 +02:00
"text/plain": [
"<Figure size 720x360 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"polyfit_theta = np.polyfit(data[\"Height\"]/data[\"Height\"].max(), Y, degree)\n",
"plot_polynomial_regression(polyfit_theta)"
]
2021-06-24 11:07:41 +02:00
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
2021-06-27 17:34:20 +02:00
"version": "3.8.8"
2021-06-24 11:07:41 +02:00
}
},
"nbformat": 4,
"nbformat_minor": 4
}