2021-06-24 11:07:41 +02:00
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
2021-06-26 17:59:05 +02:00
"# Algorytm najszybszego spadku dla regresji wielomianowej. "
2021-06-24 11:07:41 +02:00
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
2021-06-26 17:59:05 +02:00
"Skład grupy:\n",
2021-06-27 14:09:23 +02:00
"- Nowak Anna,\n",
2021-06-26 17:59:05 +02:00
"- Łaźna Patrycja,\n",
"- Bregier Damian"
2021-06-24 11:07:41 +02:00
]
},
2021-06-26 17:59:05 +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/iWuqgbA7SYpDH86e7mwv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oilUKtEJIaoU6VKrwCYFGC+QUe7tTo1O5ygWlQvIeDyldObTy06Mx+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."
2021-06-26 17:59:05 +02:00
]
},
2021-06-27 18:45:49 +02:00
{
"cell_type": "code",
2021-06-28 10:01:22 +02:00
"execution_count": 37,
2021-06-27 18:45:49 +02:00
"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)"
]
},
2021-06-26 17:59:05 +02:00
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## 1. Wczytywanie i preprocessing danych"
]
},
2021-06-24 13:03:10 +02:00
{
"cell_type": "code",
2021-06-28 10:01:22 +02:00
"execution_count": 38,
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-28 10:01:22 +02:00
"execution_count": 39,
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-26 17:59:05 +02:00
"# 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",
2021-06-26 17:59:05 +02:00
"# 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-28 10:01:22 +02:00
"execution_count": 40,
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",
2021-06-26 17:59:05 +02:00
"# 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",
2021-06-26 17:59:05 +02:00
"# 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+LwNPT7f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wrkglvoN4XO2T8CEhIRwqQJ4Dz5XISUhadaNrRJ8sZEWi17JxN3BBhOKv4Ftj9UlCWfv+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+YACIAACIAACIAACIAACIAACIBAYglA6E3s0KJjIAACIAACIAACIAACIAACIAACEHoxB0AABEAABEAABEAABEAABEAABBJLAEJvYocWHQMBEAABEAABEAABEAABEAABEIDQizkAAiAAAiAAAiAAAiAAAiAAA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XX6r8AIXhV
}
},
"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-28 10:01:22 +02:00
"execution_count": 41,
2021-06-27 17:34:20 +02:00
"metadata": {},
"outputs": [],
"source": [
2021-06-26 17:59:05 +02:00
"# 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+eOPP3Iy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XwRVRoButM4FmFnJWyVid0rRlJstuRuWFTh
}
},
"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",
2021-06-28 10:01:22 +02:00
"execution_count": 42,
2021-06-27 20:23:26 +02:00
"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-28 10:01:22 +02:00
"execution_count": 53,
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",
2021-06-28 10:01:22 +02:00
" learning_rate=0.1, momentum = 0.3, 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-28 10:01:22 +02:00
"execution_count": 54,
"metadata": {
"scrolled": true
},
2021-06-27 17:34:20 +02:00
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
2021-06-27 20:23:26 +02:00
"SGD:\n",
2021-06-28 10:01:22 +02:00
"f(x) = 16.32876722693443x^0 + 34.45307103302153x^1 + 45.94300992401012x^2 + 52.620176422095824x^3 + 55.84736037491846^4\n",
2021-06-27 20:23:26 +02:00
"600001 updates\n",
"\n",
2021-06-27 17:34:20 +02:00
"BGD:\n",
2021-06-28 10:01:22 +02:00
"f(x) = -65.64506277392503x^0 + 68.77648241255996x^1 + 114.75349304333463x^2 + 102.20675310280693x^3 + 52.80014652046723^4\n",
2021-06-27 17:34:20 +02:00
"82705 updates\n",
"\n",
"MBGD:\n",
2021-06-28 10:01:22 +02:00
"f(x) = -43.73372717859179x^0 + 44.52908852914625x^1 + 88.75625965596099x^2 + 102.68565372634689x^3 + 96.42646314762048^4\n",
2021-06-27 17:34:20 +02:00
"37501 updates\n",
"\n",
"momentum:\n",
2021-06-28 10:01:22 +02:00
"f(x) = 46.73334506478952x^0 + 46.04136957395274x^1 + 44.48349874963421x^2 + 42.3749456478724x^3 + 39.943624482130815^4\n",
2021-06-27 18:45:49 +02:00
"61 updates\n",
"\n",
"steepest descent:\n",
2021-06-28 10:01:22 +02:00
"f(x) = 13.638648831593645x^0 + 39.092493619820296x^1 + 55.99541645170152x^2 + 66.58927282539155x^3 + 72.5680972400324^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",
2021-06-27 18:45:49 +02:00
"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": [
2021-06-28 10:18:23 +02:00
"## 5. Reprezentacja graficzna regresji wielomianowej i funkcji kosztu"
2021-06-24 13:03:10 +02:00
]
},
{
"cell_type": "code",
2021-06-28 10:01:22 +02:00
"execution_count": 52,
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/vjTtpJO1nn3pnJzPv5ePSRmzv3nnN4XJp8es7nfo455xARERGR2GUkegAiIiIiqUKBlYiIiIhPFFiJiIi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sNZ70NjP7hxvH/tKkFd4kWBlYiI7KKtxEJdQx0OR11DHXdV30Vza3NwnTq46TnvcOY4+N9usTVXkFOgBHWJuy7LLZjZSOB+YG+8FzQqnXN3mNkQ4C9AEVALfNU590n4nmuBi4EW4PvOuacDGb2IiAQiWomFIGeqAE7+L5xUC58MgFuPib29vOw81ly9JvaGRHqgOzNWzcCVzrkDgHHA5WZ2IHANUOWcGwNUhb8n/Nl5wEHAqcAsM/N5y0wREQlSvBO9M1rhlme945uPhU9zYm9TyeqSCF0GVs65Fc65N8LHG4D3gOHAFGB2+LLZwJnh4ynAQ865rc65ZcAS4Aifxy0iIgGKd6J36b/hkJVQPwjuPNKfNpWsLonQoxwrMysCDgVeA/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"
},
2021-06-27 18:45:49 +02:00
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAnEAAAE9CAYAAABk/zSyAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuNCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8QVMy6AAAACXBIWXMAAAsTAAALEwEAmpwYAAAd1UlEQVR4nO3df7BfdX3n8eeLRAKiIMiFYgIm1lQL1GJzl0VrW7e0JbauoR2ocbSkLbNZGLqibdeS9Q/rzrDVta1KLXQYUYJlQUrpkjqi0tBqO0XwotQQEElFIRIhVopZrbGB9/7x/aT9crm5Cfr9cc+9z8fMd77n+z7nc87neLyZF+fH56SqkCRJUrccNO4OSJIk6ekzxEmSJHWQIU6SJKmDDHGSJEkdZIiTJEnqIEOcJElSBy0e1oqTfAB4NfBIVZ08bd5vA+8CJqrq6622ATgXeBx4Y1V9vNVXAVcChwIfBS6sqkqyBLgKWAX8E/Daqvry/vp19NFH1/Llywexi5IkSUN1xx13f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rYk1wOfBfYAnwMuB54FXJfkXHpB7+y2/NYk1wF3t+UvqKrH2+rOB64EDgVuah9JkqR5b+QhDqCq3ga8bVp5N72zcjMtfzFw8Qz1KeDkgXdwAMoxRiRJ0hD5xoYBc4QRSZI0CoY4SZKkDjLESZIkdZAhTpIkqYMMcZIkSR1kiJMkSeogQ5wkSVIHGeKGxFHiJEnSMB1QiEvyoQOpCQeKkyRJI3GgZ+JO6v+RZBGwavDdkSRJ0oGYNcQl2ZBkF/CSJN9sn13AI/iyeUmSpLGZNcRV1e9V1bOBd1XV4e3z7Kp6blVtGFEfJUmSNM2BXk79SJLDAJK8IckfJnn+EPslSZKkWRx
"text/plain": [
"<Figure size 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-28 10:01:22 +02:00
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAlYAAAEzCAYAAADzdE1rAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuNCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8QVMy6AAAACXBIWXMAAAsTAAALEwEAmpwYAAAwcElEQVR4nO3deXxdZb3v8c+TNB3SQIAwD02qFAWtgkRGQbQoUKwMiqJBUPCGmdajcsHcc5DjiXJFsV6lQHAquEU5ylC0DFJUBBRoAQkIHAokZYa2GoaWNk2e+8dKatruNGmyVvZO8nm/Xn1lZe29n/XwWjT5dq3f+j0hxogkSZIGr6TQE5AkSRopDFaSJEkpMVhJkiSlxGAlSZKUEoOVJElSSgxWkiRJKekzWIUQdgkh/CGE8FgI4dEQwsyu/V8PITwfQnio68/0Hp85P4SwOITwRAjhsCz/AyRJkopF6KuPVQhhB2CHGOMDIYTNgEXA0cCngDdijN9Z7/17ANcA+wA7ArcDu8UYO9KfviRJUvHo84pVjPHFGOMDXduvA48BO23kI0cB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jFGBB1/d0vXY88C7gcGBOCKE0i8lLkrIxlIXe59+VfL1ib1g2Mb1xLVZXIfQZrGKML8YYH+jafh14DNgJOAqY2/W2ucDRXdtHAb+MMa6KMT4DLAb2SXnekqQMDVWh95SlcNyjsLoELtk/3bEtVlchbFKNVQihBtgLuBfYLsb4IiThC9i26207Ac/2+NhzXfvWH6s+hLAwhLDw1VdfHcDUJUlZyddiIQvn3p38Ipq7Jzxfmd64FqurUPodrEIIFcBvgFkxxtc29tY8+za4MR9jbIox1sY
2021-06-27 18:45:49 +02:00
"text/plain": [
"<Figure size 720x360 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
},
{
"data": {
2021-06-28 10:01:22 +02:00
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAnEAAAE9CAYAAABk/zSyAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuNCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8QVMy6AAAACXBIWXMAAAsTAAALEwEAmpwYAAAlTUlEQVR4nO3de5RlZXnn8e9Tl75A01wLxG6wMbYaIEalZfASh4REOo4jJAtiu4x0EmY6EhIvGcfAuNZoMouJxhiVOOJixNA4DkiILpgsUQnekhUEGwW5ibRya+nQLSDdXPpSdZ75Y79Vvav6VPWFc+rUrvp+1jrr7PPuy3n3W/vs+p13n713ZCaSJElqlr5eV0CSJEn7zhAnSZLUQIY4SZKkBjLESZIkNZAhTpIkqYEMcZIkSQ000K0FR8RngTcBmzLzxAnj3gt8BBjKzJ+VsguBc4ER4J2Z+dVSfhJwObAQ+DLwrszMiJgPXAGcBDwGvCUzH9hTvY444ohctmxZJ1ZRkiSpq2699dafZeZQu3FdC3FUweuTVEFrTEQcA/wG8FCt7HhgFXAC8HzgnyLixZk5AlwCrAG+QxXiVgLXUwW+JzLzRRGxCvgw8JY9VWrZsmWsW7fuOa+cJElSt0XEg5ON69rh1Mz8NvB4m1EfA94H1K8yfAZwVWZuz8z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DtVr1y76S8CLmpTvg44seMVlCRJmuG8Y4MkSVIDGeIkSZIayBAnSZLUQIY4SZKkBjLEdUl6jRFJktRFhrgOC68xIkmSpoEhTpIkqYEMcZIkSQ20VyEuIj63N2WSJEmaHnvbE3dC/UVE9AMndb46kiRJ2htThriIuDAitgIvi4gt5bEV2MQMutm8JEnSXDNliMv
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-28 10:01:22 +02:00
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAlYAAAEzCAYAAADzdE1rAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuNCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8QVMy6AAAACXBIWXMAAAsTAAALEwEAmpwYAAAy7ElEQVR4nO3deXiU9bn/8fedEDAhEiGg4kJiFXfqFq1LXWpsBYW6VYsGwa2pqOdgr1ar5hytPU3bX7eDbaU0VivqiOUUF1Bc2qhVW2sFReOGohBEQFlsQBMgyXx/f3wnkITJ/sw8M5PP67pyZeaZ7e41FT58n/u5v+acQ0RERET6LivsAkREREQyhYKViIiISEAUrEREREQComAlIiIiEhAFKxEREZGAKFiJiIiIBKTLYGVme5vZM2b2tpm9aWbTYsd/YGYfmdni2M8ZrV5zo5ktNbMlZnZ6Iv8HiIiIiKQK62qOlZmNBEY6514xs52BRcDZwAXAZ865X7R7/sHAbOAYYA/gr8D+zrnm4MsXERERSR1drlg551Y7516J3d4EvA3s2clLzgIecM5tcc4tA5biQ5aIiIhIRutRj5WZFQNHAC/FDl1jZq+b2V1mNjR2bE/gw1YvW0nnQUxEREQkIwzo7hPNLB+YC1zrnNtoZr8D/gdwsd+/BC4DLM7LdzjfaGblQDnA4MGDjzrwwAN7Xr2IiPR7i1Y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z2JuBtYE/gLGBW7GmzgLNjt88CHnDObXHOLQOWAscEXLeIiCRQEI3eA5vg4QfgoHV+VtV534T
2021-06-27 18:45:49 +02:00
"text/plain": [
"<Figure size 720x360 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
},
{
"data": {
2021-06-28 10:01:22 +02:00
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAnEAAAE9CAYAAABk/zSyAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuNCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8QVMy6AAAACXBIWXMAAAsTAAALEwEAmpwYAAArNklEQVR4nO3de5xcZZ3n8c+vu3MDEkigEyAJJGAAuSiYDHLTQQHBGRWc9RJXh6jMoC6z3tZVorvqzA4zOjqO4gWH9QI4CjIMLNFREcG7CDYQhAAh4ZY0CaQJBEKAJN312z/qdChCVXWTdHf1CZ/361WvOvWc23Oe7q7+1vOcUycyE0mSJJVLW6srIEmSpOfPECdJklRChjhJkqQSMsRJkiSVkCFOkiSphAxxkiRJJdQxXBuOiG8BrwPWZOahW837CPA5oDMzHy7KFgJnAH3A+zPzqqJ8LnABMAH4EfCBzMyIGAdcBMwF1gJvzcz7BqrXHnvskbNmzRqKQ5QkSRpWN95448OZ2Vlv3rCFOKrB6ytUg9YWETETOAlYUVN2MDAfOATYG/hZRByQmX3AecCZwO+phrhTgB9TDXyPZuaLImI+8FngrQNVatasWXR1dW33wUmSJA23iLi/0bxhG07NzF8Bj9SZ9S/AR4Habxk+FbgkMzdm5r3AcuDIiNgLmJSZ12X1W4kvAk6rWefCYvoy4ISIiKE/EkmSpNFnRM+Ji4g3AA9k5i1bzZoOrKx53V2UTS+mty5/1jqZ2Qs8Buw+DNWWJEkadYZzOPVZImIn4BPAa+rNrlOWTcqbrVNv32dSHZJln332GbCukiRJo91I9sTtD8wGbomI+4AZwE0RsSfVHraZNcvOAFYV5TPqlFO7TkR0ALtSf/iWzDw/M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},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Momentum:\n"
]
},
{
"data": {
2021-06-28 10:01:22 +02:00
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAlYAAAEzCAYAAADzdE1rAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuNCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8QVMy6AAAACXBIWXMAAAsTAAALEwEAmpwYAAAzNElEQVR4nO3de3xU1b338c8vIcHEaIQIFlESVGy9oFZTq8VbRa2Cita7wQe1Nt5asa1PveRp1Wp6etqjxZ4WbbxSHS+oeKHiNeppta0WvJyIoKAQRFEENKBBEpL1/LEmZJJMLiR7Zs/l+3698srMnpk9P19b8Otaa/+WOecQERERkYHLCbsAERERkUyhYCUiIiISEAUrERERkYAoWImIiIgERMFKREREJCAKViIiIiIB6TVYmdmOZvaCmS0ws/lmNjV6/Boz+9DM3oj+TIj5zJVmttjM3jGz7yXyH0BEREQkVVhvfazMbAQwwjn3mpltBcwDTgBOBb5wzv1Xp/fvDtwH7A9sDzwH7Oqcawm+fBEREZHU0euIlXNuhXPutejjdcACYGQPH5kE3O+c2+CcWwIsxocsERERkYy2WWuszKwM+CbwSvTQj8zsf83sDjMbEj02Evgg5mPL6TmIiYiIiGSEQX19o5kVAQ8Dlzrn1prZzcB1gIv+vgE4F7A4H+8y32hmlUAlwJZbbrnfN77xjc2vXkREst68j+YFdzKD0duMZmjB0ODO2VdffgkLF/rHO+0EQ4b0/H4Jzbx581Y554bFe61PwcrM8vChKuKcmwXgnPsk5vVbgb9Gny4Hdoz5+A7AR53P6ZyrAWoAysvL3dy5c/tSioiISAdl08qob6gP5FyG8f7V7wdyrs2yciXsu69/fOml8PvfJ78G6TMz6/ZfuL7cFWjA7cAC59yNMcdHxLztROCt6OPHgdPNbLCZjQbGAK/2p3AREZHeVI+vpjCvMJBzjSoetelxpC5C2bQycq7NoWxaG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U3lfwM42hcCmJr9VzWuvwS67+LYKW24ZbnGSdjRiJSIigUn1zZbjqW+oB+fgvPPgmWd8j6qnnoJhw8IuTdKQgpWIiAQmlTdb7o5hzP/hJLj7bj9C9cQTsPPOYZclaUrBSkREApOqmy335KJXHHvcPhsGDYKHHoLy8rBLkjSmYCUiIr2K1EUom1bWa8fyrzZ+leTKBuaM/4U/Phl9cttt/m5AkQHQ4nUREelR5wXpsR3Lwa+rqm+oD6u8PivMK6RgUAGr168G4Jh3Ycaj/rVfH7cNV6kBqARAwUpERHoUb0F6Y3MjU5+cyvqN69NisXpJQQk3HXMTAJWzK9l3cSMPz4S8VrjhkEGUVv8x5AolUyhYiYhIj7pbkN428pMO1m9cD/g9AYcsrOeg6/4fBRsd9x5QxNf+++bu9woU2UxaYyUiIj3q0pk8DW3aE3DRIib86Ca2/srBKadw5kufU7HX5LDLkwyiYCUiIj2qHl9NYV5hh2OFeYWUFJSEVFH/bPygHo48Elau9L/vvhty02dPQ0kPClYiItKjirEV1BxXQ2lxKeD7PjU2N6bVVODQRng+kgf19XDAATBrFgweHHZZkoEUrEREJK7YFgtVtVVMGDOBQTmDcLiwS9ssRRvgqXtz2PWTZthjD98AtKgo7LIkQ2nxuoiIdBGvxcItc29Jq1BVUlDC+obVPPPgYL61fAOUlfkta4amXxNTSR+9jliZ2Y5m9oKZLTCz+WY2NXp8qJk9a2aLor+HxHzmSjNbbGbvmNn3EvkPICIiwYvXYiGdQhXA0Jwt+XLuURy4eAOMGAHPPQfbbx92WZLh+jIVuBH4mXNuN+AA4GIz2x24Aqh1zo0BaqPPib52OrAHcDQw3cy0OlBEJI2k455/sQa1wO9uW+ZHqIYNg9pa7f8nSdFrsHL
2021-06-24 13:03:10 +02:00
"text/plain": [
"<Figure size 720x360 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
2021-06-27 18:45:49 +02:00
},
{
"data": {
2021-06-28 10:01:22 +02:00
"image/png": "iVBORw0KGgoAAAANSUhE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gE4vGq7ZcBDRfmyGuXP2yciOoFB9r19C0BmXpyZKzNz5fDwcJ0uZeoG+7t8xYgkSaqrRoe4a4Azi+UzgaurylcXT5weQeUBhhuLW66jEXFiMd7tjHH7jB3rdOA7xbi5ljPU18WWbTtp0epJkqQ21FnWgSPiS8BrgUURsQH4KPBx4MqIOAt4AHgrQGbeFhFXArcDu4CzM3N3caj3U3nStQ/4evEDcAnwxYhYT6UHbnVZ1zJbQ/1d7NqTPP3sbg7uKa3JJUnSAaS0RJGZ79jPqpP3s/35wPk1ytcBx9Yo304RAlvdUNXUW4Y4SZJUD63yYMOcNtjvrA2SJKm+DHENMNTn/KmSJKm+DHENMNRfuZ36hK8ZkSRJdWKIa4Ahb6dKkqQ6M8Q1wKC3UyVJUp0Z4hqgt6uD3q55ztogSZLqxhDXIJWpt+yJkyRJ9WGIa5Ch/i62eDtVkiTViSGuQQb7uthqT5wkSaoTQ1yDVHriHBMnSZLqwxDXII6JkyRJ9WSIa5CxMXGZ2eyqSJKkOcAQ1yCD/V08u2sP23fuaXZVJEnSHGCIa5ChvsrUW46LkyRJ9WCIaxCn3pIkSfVkiGuQoT5DnCRJqh9DXIMM9o/Nn+rtVEmSNHuGuAYZ6i/GxNkTJ0mS6sAQ1yALxsbEOfWWJEmqA0Ncg/R1ddDdMc+eOEmSVBeGuAaJCAb7uxwTJ0mS6sIQ10BDfV32xEmSpLowxDXQUL8hTpIk1YchroEG+7p9sEGSJNWFIa6Bhvq72LrNMXGSJGn2DHENNNTXZU+cJEmqC0NcAw3
2021-06-27 18:45:49 +02:00
"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": "iVBORw0KGgoAAAANSUhEUgAAAlYAAAEzCAYAAADzdE1rAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMu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3d8fO32WsCtCVg+ppy87DwMhrzsPMrHlGutQPGMsdb63QYKCwvtvHnz/G6GiIiEkT8tP65KEhR8AfPLIS0IoybC60MjOy8vO4+V16yMatskORhj5ltrC8PtU4+ViIi0q6yojMy0zBbbMtMyycnIiXlbejW4twDTgjC9MPJQBZqgLrGhYCUiIu1qPnwGru5TTX1N2Eng0TblbThsLazMhuu+17lzNUFdYkHBSkREwmpeYqG0opTRw0bTK6UXFn+mkBy8Fm55zX3+4ZmwpXfk52qCusSKgpWIiOykscRCVXUVFktVdRV3z7ub7cHtvrSndz08+JQbAvzzSKjYp+NzcjJyNEFdYq7DcgvGmCHAg8AAXLmQcmvtn4wxfYHHgXxgJXCetfbr0Dk3AJcBDcDV1tp/RqX1IiISFeFKLPjVUwXw61ddIdClOXBdBG8BAmSlZ7F+yvroNkyklUh6rLYDP7PWfgc4ErjKGDMcuB6osNYOAypC3wntmwCMAE4FphtjUqPReBERiY54muh93Er42TvQYODiszouBNoonn4Pkjw6DFbW2rXW2gWhz5uBJcAgYCwwI3TYDGBc6PNY4DFrbZ219lNgGTDS43aLiEgUxctE76w6mPG0+8vqt8fB3MGRnxsvvwdJLp2aY2WMyQcOAd4F+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/6h9uqur63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SZLUCUNch0YOp0qSpI4Y4jo0Giz5nDhJktQJQ1yHhgN74iRJUjcMcR3yESOSJKkrhrgOjQY9H/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",
2021-06-27 18:45:49 +02:00
" \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",
2021-06-27 18:45:49 +02:00
"plot_cost_function(logs_1)\n",
2021-06-27 14:09:23 +02:00
"print(\"MBGD:\")\n",
"plot_polynomial_regression(final_theta_MBGD)\n",
2021-06-27 18:45:49 +02:00
"plot_cost_function(logs_2)\n",
2021-06-27 14:09:23 +02:00
"print(\"SGD:\")\n",
"plot_polynomial_regression(final_theta_SGD)\n",
2021-06-27 18:45:49 +02:00
"plot_cost_function(logs_3)\n",
2021-06-27 14:09:23 +02:00
"print(\"Momentum:\")\n",
2021-06-27 18:45:49 +02:00
"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-28 00:02:15 +02:00
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Wizualizacja metody najszybszego spadku dla wielomianu drugiego stopnia"
]
},
{
"cell_type": "code",
2021-06-28 10:01:22 +02:00
"execution_count": 11,
2021-06-28 00:02:15 +02:00
"metadata": {},
"outputs": [],
"source": [
"degree = 1\n",
"initial_theta = np.matrix([0] * (degree + 1)).reshape(degree + 1, 1)\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])\n",
"\n",
"\n",
"steepest_descent_deg_2, logs_deg_2 = steepest_descent(X, Y, initial_theta, epochs = 60)\n",
"\n"
]
},
{
"cell_type": "code",
2021-06-28 10:01:22 +02:00
"execution_count": 12,
2021-06-28 00:02:15 +02:00
"metadata": {},
"outputs": [],
"source": [
"cost_history = [row[0] for row in logs_deg_2]\n",
"all_thetas = [row[1] for row in logs_deg_2]\n",
"theta0_history = [row[0].item() for row in all_thetas]\n",
"theta1_history = [row[1].item() for row in all_thetas]\n",
"\n",
"cost_history = np.array(cost_history)\n",
"theta0_history = np.array(theta0_history)\n",
"theta1_history = np.array(theta1_history)"
]
},
{
"cell_type": "code",
2021-06-28 10:01:22 +02:00
"execution_count": 13,
2021-06-28 00:02:15 +02:00
"metadata": {},
"outputs": [],
"source": [
"theta0_vals = theta0_history\n",
"theta1_vals = theta1_history\n",
"J_vals = np.zeros((len(theta0_vals), len(theta1_vals)))\n",
"\n",
"c1=0\n",
"c2=0\n",
"pom = 0\n",
"for i in theta0_vals:\n",
" for j in theta1_vals:\n",
" t = np.array([i, j])\n",
" J_vals[c1][c2] = cost_history[pom]\n",
" c2=c2+1\n",
" c1=c1+1\n",
" pom += 1\n",
" c2=0"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import plotly.graph_objects as go\n",
"\n",
"fig = go.Figure(data=[go.Surface(x=theta0_vals, y=theta1_vals, z=J_vals)])\n",
"fig.update_layout(title='Loss function for different thetas', autosize=True,\n",
" width=600, height=600, xaxis_title='theta0', \n",
" yaxis_title='theta1')\n",
"fig.show()"
]
},
2021-06-24 13:03:10 +02:00
{
"cell_type": "markdown",
"metadata": {},
"source": [
2021-06-28 10:18:23 +02:00
"## 6. 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/fHOgdDyHz2cE7yfd8Xr7Ozc85eT+4u5HGtZz/LWGsRERERkeCkhB2AiIiISFujBExEREQkYErARERERAKmBExEREQkYErARERERAKmBExEREQkYI0mYMaYnsaYl4wxnxhj5htjroqe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+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",
2021-06-26 17:59:05 +02:00
"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": "iVBORw0KGgoAAAANSUhEUgAAAlYAAAEzCAYAAADzdE1rAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuNCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8QVMy6AAAACXBIWXMA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Atc+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
}