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",
"execution_count": 2,
"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-27 18:45:49 +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": [
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 18:45:49 +02:00
"execution_count": 4,
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-27 18:45:49 +02:00
"execution_count": 5,
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+LwNPT7fbu3cvjRz+63T7//PXjk09utyOPTz99fb3h9ZmzleG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RJ8sZEWi17JxN3BBhOKv4Ftj9UlCWfv+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)"
]
},
{
"cell_type": "code",
2021-06-27 18:45:49 +02:00
"execution_count": 6,
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)) "
]
},
{
"cell_type": "code",
2021-06-27 18:45:49 +02:00
"execution_count": 24,
2021-06-27 17:34:20 +02:00
"metadata": {
"scrolled": true
},
"outputs": [],
"source": [
2021-06-25 09:42:03 +02:00
"# Batch gradient descent (BGD)\n",
2021-06-27 14:09:23 +02:00
"def BGD(X, Y, theta, cost_function = mean_squared_error, learning_rate=0.1, 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",
"def momentum(X, Y, theta, cost_function = mean_squared_error, 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",
" delta_history.append(momentum * delta_history[-1] + learning_rate * gradient(theta, X, Y))\n",
" 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",
"# Mini-batch gradient descent (MBGD)\n",
2021-06-27 14:09:23 +02:00
"def MBGD(X, Y, theta, cost_function = mean_squared_error, 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",
"# Stochastic gradient descent (SGD)\n",
2021-06-27 14:09:23 +02:00
"def SGD(X, Y, theta, cost_function = mean_squared_error, learning_rate=0.1, epochs=5):\n",
2021-06-27 18:45:49 +02:00
" return MBGD(X, Y, theta, cost_function, learning_rate, epochs, 1)\n",
"\n",
"# Steepest descent\n",
"def steepest_descent(X, Y, theta, cost_function = mean_squared_error, 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"
2021-06-27 17:34:20 +02:00
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## 4. Zestawienie wyników"
]
},
{
"cell_type": "code",
2021-06-27 18:45:49 +02:00
"execution_count": 25,
2021-06-27 17:34:20 +02:00
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"BGD:\n",
2021-06-27 18:45:49 +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-27 18:45:49 +02:00
"f(x) = -20.49538398624665x^0 + 43.83203531549893x^1 + 74.9580517022499x^2 + 83.08157339221718x^3 + 75.75845309811228^4\n",
2021-06-27 17:34:20 +02:00
"37501 updates\n",
"\n",
"SGD:\n",
2021-06-27 18:45:49 +02:00
"f(x) = 38.980419583838696x^0 + 42.24440889357842x^1 + 43.5350614491982x^2 + 43.437875831269686x^3 + 42.39005292817251^4\n",
2021-06-27 17:34:20 +02:00
"600001 updates\n",
"\n",
"momentum:\n",
2021-06-27 18:45:49 +02:00
"f(x) = 8.015549563834483x^0 + 38.129978604712036x^1 + 58.338707783566186x^2 + 71.220198958028x^3 + 78.7251186900262^4\n",
"61 updates\n",
"\n",
"steepest descent:\n",
"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 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",
"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",
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
]
},
{
"attachments": {
"image.png": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAA70AAAFDCAYAAAD22mnsAAAgAElEQVR4Aey9i5MV1b33/fwBp97UqefkVl5m9gCHPSC3Y0TfWEblMigMaAheciByDorUaLQgJuflIFFHAoxIEIgKMUclyiUqCnEorAcPRnDAwQHHh0GMAySMWB7HGzMJMpMw7t9bq7tX9+q1e3ev3rt77758qaJm797d6/JZq7vXb/1u/4vwDwRAAARAAARAAARAAARAAARAAAQSSuB/JbRf6BYIgAAIgAAIgAAIgAAIgAAIgAAIEIReTAIQ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cv3pZKyLFR23eVKg9EHorBB7VggAIgEASCcRH6G2jh2ovSJywawnvWfrJK3+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-24 13:03:10 +02:00
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
2021-06-27 18:45:49 +02:00
"## 4. Reprezentacja graficzna regresji wielomianowej i funkcji kosztu"
2021-06-24 13:03:10 +02:00
]
},
{
"cell_type": "code",
2021-06-27 18:45:49 +02:00
"execution_count": 29,
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": "iVBORw0KGgoAAAANSUhEUgAAAlYAAAEzCAYAAADzdE1rAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuNCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8QVMy6AAAACXBIWXMAAAsTAAALEwEAmpwYAAAxRElEQVR4n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RT3kgT3PgLfeBv+dDB8/Wx/2izML6R2eq0/jUlaM7OFzrniaJ9pxkpERDpVUVJBblZuu3O5WbkU5BQE0t+Bq+Br/4amDLjhBP/aVYK6xIMCKxER6VTk8hl4dZ8amxqjJoH74cbnIdNB5WGwzMfqDUpQl3hQYCUiIlFFllgorypn0phJ9MvohyO4FJIjlsNZ70NjP7hxvH/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+z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Sz1mba5PslUkqmdO3c+3S5LkiTNOeO4nPozwP1VtbOq/hW4AXg58HC7REr7fqQtvx04vq/9MnqXX7e36en1p6iqy6tqsqomJyYmBrozkiRJ4zCOEPcAcFqSZ7anSU8H7gE2AevaMuuAG9v0JmBtkiVJVtB7gOH2dsl1V5LT2nrO6WsjSZI0ry0e9Qar6rYk1wOfBfYAnwMuB54FXJfkXHpB7+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-27 18:45:49 +02:00
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAlYAAAEzCAYAAADzdE1rAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuNCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8QVMy6AAAACXBIWXMAAAsTAAALEwEAmpwYAAAzdElEQVR4nO3deXhU5d3/8fc3IUBCIEpQy5qg4oLlUWvc6lI02iJIURBFg1Lp0yjUFrpo1dQqbdPHp1YftC1grAvqFEVREUGrRqlLqxLcAi6VnxBEkN2wJJDt/v1xJhBgss+cmcx8XtfFxZkzZ865vUbIh/t8z/c25xwiIiIi0n5J0R6AiIiISLxQsBIREREJEwUrERERkTB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S+GE9bAqw+tb1VoqUBe/KFiJiMgB6lsslJWX4XCUlZcxq2QWNXU1vo/loEr4/Sve9i+/C7tSWva5zNRMFaiL75ptt2Bm/YGHgW/grXNZ5Jy728x6Ao8D2cAq4FLn3NbgZ24CfgjUAj91zv0jIqMXEZGICNViIRozVQDTXoVelfBqNswb3PLPpXdOZ9MNmyI2LpFQWjJjVQP8wjl3LHAa8GMzGwzcCBQ75wYBxcHXBN8bBxwHDANmmFlyJAYvIiKRESuF3seth8lLoNZgyjDAWv7ZWPlvkMTSbLByzq1zzr0b3N4OfAz0BUYBs4OHzQYuCm6PAh5zzu12zq0EVgCnhHncIiISQTFR6O3g7hegk4NZOVD6jdZ9PCb+GyThtKrGysyygROBt4HDnHPrwAtfwKHBw/oCXzT42Jrgvv3PlW9mJWZWsnHjxjYMXUREIiV
"text/plain": [
"<Figure size 720x360 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAnEAAAE9CAYAAABk/zSyAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuNCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8QVMy6AAAACXBIWXMAAAsTAAALEwEAmpwYAAAiwklEQVR4nO3dfZBldX3n8fenu2eG4RlhIDgDDsYxWSA+Mcviw2bdJYnENaIpjWNpIAm1sxKyPmSzBtaq1WwVG41rVOKKxaoRXBckqAWbkijBp6SC4KAoTyKjIIwQZhTlSRyY7u/+cX89c6enu+fBvt19ut+vqlv33N85v3N/5zdnbn/uOff8TqoKSZIkdcvQXDdAkiRJe88QJ0mS1EGGOEmSpA4yxEmSJHWQIU6SJKmDDHGSJEkdNDKoFSf5KPAyYHNVnThh3p8A7wZWVNUPW9l5wFnAKPDGqvpcKz8J+BiwHPgs8KaqqiTLgEuAk4AfAa+pqrt3164jjjiiVq9ePRObKEmSNFA33njjD6tqxWTzBhbi6AWvD9ALW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+8ChhvaKddHkpzS1nNGX5254/WxkiRpFozM9htW1fVJrgC+DmwDvgFcBBwIXJ7kLHpB79Vt+VuTXA7c1pY/p6pG2+rOBj4GLAeubg9JkqQFb9ZDHEBVvR14+4TirfSOyk22/PnA+ZOUbwBOnPEGSpIkzXPesUGSJKmDDHGSJEkdZIiTJEnqIEPcgJRjjEiSpAEyxM2wOMaIJEmaBYY4SZKkDjLESZIkdZAhTpIkqYP2KMQl+fielEmSJGl27OmRuBP6XyQZBk6a+eZIkiRpT0wb4pKcl+QR4FlJHm6PR4DNzIebzc9jhWOMSJKkwZk2xFXVn1fVQcC7q+rg9ji
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 18:45:49 +02:00
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAlYAAAEzCAYAAADzdE1rAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuNCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8QVMy6AAAACXBIWXMAAAsTAAALEwEAmpwYAAA0IklEQVR4nO3deXhU5d3/8fc3ISAhEiXiUjSJVVRoqVqDte4ttlUU9wUbLK6pCxX76GO16a/q06aP7aOVbhbjSnVccAdFbU2rVtuqINaIgKAQRCkKaEC2bPfvjzsh22Q/M+fM5PO6rlyZOTNz5st1Knx63/f53uacQ0RERET6LiPsAkRERETShYKViIiISEAUrEREREQComAlIiIiEhAFKxEREZGAKFiJiIiIBKTLYGVme5jZ38xsoZktMLOpjcevN7MPzezNxp/xLT5zrZktNbPFZvadRP4BRERERKLCuupjZWa7Abs5594ws+2BecDJwJnA5865m9q8fzTwAHAw8AXgeWAf51x98OWLiIiIREeXI1bOuVXOuTcaH28AFgIjOvnIScCDzrmtzrllwFJ8yBIR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JRWlDJ+5HgGZAzAEf4Skp7qcIF6k9paOP10eOMN2Gsv31ZhyJDkFShpQ8FKRETaaWqxUFVdhcNRVV3F9LnTqWuoC7u0bssbnNf5AvUmzsGFF8Kf/wzDh8Nzz8HOOye3WEkbXY5xmtkewJ+AXYEGoNw59xszGwY8BBQCy4EznXOfNn7mWuACoB643Dn3XEKqFxGRhIjXYiHVRqpyBuaw5uo
"text/plain": [
"<Figure size 720x360 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAnEAAAE9CAYAAABk/zSyAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuNCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8QVMy6AAAACXBIWXMAAAsTAAALEwEAmpwYAAAs50lEQVR4nO3deZxcdZ3v/9enOwtbwpYGQgKEJYAQNokIriAqUVHQixqvCqPMZWSY6zYzDoz3jrMx12XccMHhJwool0UGNeMV2RUXJITNsBMIJCGQhYQkZO/uz++POh2KUFUJ3VVdfZLX8/GoR53+nqW+9U26+l3f8z3fE5mJJEmSyqWj3RWQJEnSK2eIkyRJKiFDnCRJUgkZ4iRJkkrIECdJklRChjhJkqQSGtaqA0fED4CTgYWZOWmjdX8DfAXoyszFRdl5wJlAD/DJzLy+KD8auATYFvgl8KnMzIgYCVwGHA08B3wwM5/cVL3GjBmTEyZMaMZblCRJaqm77rprcWZ21VrXshBHJXh9m0rQ2iAi9gLeBsypKjsEmAocCuwJ3BQRB2ZmD3AhcBbwRyohbgpwHZXAtzQzD4iIqcCXgA9uqlITJkxgxowZA35zkiRJrRYRT9Vb17LTqZl5G7CkxqqvA58DqmcZPgW4MjPXZuZsYBZwTESMBUZn5u1ZmZX4MuDUqn0uLZavAU6MiGj+O5EkSRp6BnVMXES8B3g6M+/baNU4YG7Vz/OKsnHF8sblL9knM7uBZcCuLai2JEnSkNPK06kvERHbAZ8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c3viDq3+ISI6gaObX50tRzpRnCRJaqGGIS4izouIFcDhEbG8eKygcnN671MqSZLUJg1DXGb+n8wcBXwlM0cXj1GZuWt
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/zvY21FhERERHpviS/ByAiIiISLxSsRERERDyiYCUiIiLiEQUrEREREY8oWImIiIh4RMFKRERExCPtBitjzAHGmDeNMYuNMYuMMVODy39ljPnGGPNJ8DGmyXduNsYsM8YsMcacEc7/ABEREZFoYdrrY2WMGQAMsNZ+ZIzZA1gInAWcD2yz1v6+xfrDgSeBY4H9gNeBg6219d4PX0RERCR6tHvGylq72lr7UfD1VmAxsH8bX5kAPGWt3WGt/RpYhgtZIiIiInGtUzVWxpgc4Cjgg+Cia40xnxljHjHG7BVctj+wosnXVtJ2EBMRERGJCz06uqIxJgN4Dphmrd1ijLkf+DVgg89/AC4FTIiv73a90RhTABQA9O7d+3vDhg3r/OhFRCThLVy10LuNGRi852D6rt0CGzfCXnvBgQd6t32JCwsXLtxgre0f6rMOBStjTAouVAWstXMArLVrm3z+F+BvwbcrgQOafH0gsKrlNq21xUAxQG5uri0tLe3IUERERJrJmZ5DRWWFJ9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BykN8Odj4IMDuradSIVASQw6YyUiIp6J5GTLP1kIJ6yEVRlwS17Xt1NRWeHdoCThKViJiIhnIlUIPmAL/PZ19/qnY2BLr65vy2DUz0o8o2AlIiKeidRky9NfgcwdMO9gmHNo97ZlsWq5IJ5RsBIRkXYFygLkTM9pt2P59rrtYR/LmC/h/H/DthS4Zgxgur9NtVwQr6h4XURE2tSyIL1px3JwdVWRqlPqvQNmvORe33oarNiz499NT0knrUcaG6s37vaZWi6IVxSsRESkTaEK0qtqq5j68lSq66ojVqwO8Ku3XM+qhQPgvmM7/r2stCzuPfNegN3uWkxPSacor8jjkUqi0qVAERFpU2uXyTZWb4xoqDpyNUx7H+oNFIyH+k40d6+uqwbcnIDF44vJzszGYMjOzKZ4fLHmChTPGGut32MgNzfXlpaW+j0MEREJIWd6ju8tCZIa4P2H4JhV8H/Hw89Gd34b2ZnZlE8r93xskniMMQuttbmhPtMZKxERaVNRXhHpKenNlqWnpJOVlhWxMUx734WqFX3gl6d2bRsqUJdIULASEZE2Nb18Bq7vU1VtVcgi8HA4aCP8+g33+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"
2021-06-27 18:45:49 +02:00
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAnEAAAE9CAYAAABk/zSyAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuNCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8QVMy6AAAACXBIWXMAAAsTAAALEwEAmpwYAABHa0lEQVR4nO3deXhc5X33//dX0ow0I0saSZZtbV4xGNtgG4zDHggkcSABQkkC2UhDQpPSZmn7NKG5nl+aPqVNmjYJJIU2ZQkkJIRSaEgIW9jCbmxs8ALG8i5LsuVF+z5z//6YM/JgZFnLnJmR+LyuS9ecuWfOmXsOxvr4Xs05h4iIiIhMLDmZroCIiIiIjJ5CnIiIiMgEpBAnIiIiMgEpxImIiIhMQApxIiIiIhOQQpyIiIjIBJTn14XN7Hbgw8A+59ziI177G+D7QIVzbr9Xdj1wDRAFvuKce9QrPxX4GRACfg981TnnzCwfuAs4FTgAfMI5t+NY9Zo6daqbPXt2Kr6iiIiIiK/WrFmz3zlXMdRrvoU44sHrJ8SD1iAzqwXeD+xKKlsIXAksAqqAP5jZ8c65KHALcC3wEvEQtxJ4mHjgO+ScO87MrgS+B3ziWJWaPXs2q1evHveXExEREfGbme082mu+dac65/4IHBzipR8CfwskrzJ8KXCPc67XObcdqANWmFklUOyce9HFVyW+C7gs6Zw7veP7gAvMzFL/TURERESyT1rHxJnZJcAe59xrR7xUDexOel7vlVV7x0eWv+0c59wA0AqU+1BtERERkazjZ3fq25hZGPgW8IGhXh6izA1TPtw5Q332tcS7ZJk5c+Yx6yoiIiKS7dLZEjcPmAO8ZmY7gBrgVTObQbyFrTbpvTVAg1deM0Q5yeeYWR5QwtDdtzjnfuqcW+6cW15RMeTYQBEREZEJJW0hzjm33jk3zTk32zk3m3gIO8U51wQ8CFxpZvlmNgeYD6xyzjUC7WZ2ujfe7bPAb7xLPghc7R1fATzpjZsTERERmfR8C3Fm9ivgReAEM6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hgNaJExERkZRK95i46c65RgDvcZpXXg3sTnpfvVdW7R0fWf62c5xzA0ArUO5bzcchEg6qO1VERERSKlsmNgzVguaGKR/unHde3OxaM1ttZqubm5vHWMWxi4QCmtggIiIiKZXuELfX6yLFe9znldcDtUnvqwEavPKaIcrfdo6Z5QElvLP7FgDn3E+dc8udc8srKipS9FVGrkTdqSIiIpJi6Q5xDwJXe8dXA79JKr/Sm3E6h/gEhlVel2u7mZ3ujXf77BHnJK51BfCkN24u60RCQdp7B+iPxjJdFREREZkk8vy6sJn9CjgPmGpm9cC3ge8C95rZNcAu4GMAzrmNZnYvsAkYAK5zzkW9S32Z+EzXEPCw9wNwG/BzM6sj3gJ3pV/fZbwSuza0dfdTPiU/w7URERGRycC3EOecu+ooL11wlPffANwwRPlqYPEQ5T14ITDbDW69pRAnIiIiKZItExsmtZKQ9k8VERGR1FKIS4PScBBAM1RFREQkZRTi0mCwO1UhTkRERFJEIS4NIiGvJa5bIU5ERERSQyEuDYoK8jCDVo2JExERkRRRiEuDnByjJBRQS5yIiIikjEJcmmjrLREREUklhbg0KQkH1RInIiIiKaMQlybxljiNiRMREZHUUIhLk9KwulNFREQkdRTi0iQSDqolTkRERFJGIS5NSkIB2noGiMZcpqsiIiIik4BCXJokdm1o0+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": "iVBORw0KGgoAAAANSUhEUgAAAlYAAAEzCAYAAADzdE1rAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuNCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8QVMy6AAAACXBI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vtvHnz/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/6h9uqur63Sf7rN31TnN+7VWrdr17F/PfrpXr08/z372TlUhSZKkzWVp0RWQJ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JUjcMcR3yESOSJKkrhrgOjQY9H/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-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 17:34:20 +02:00
"execution_count": 8,
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 17:34:20 +02:00
"execution_count": 9,
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 17:34:20 +02:00
"execution_count": 9,
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 17:34:20 +02:00
"execution_count": 10,
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 17:34:20 +02:00
"execution_count": 10,
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/4Mx5itjzAfRP0NqfOYGY8xCY8xnxphBfv4AIiIiIsnGNNYHzBjTA+hhrX3PGLMzMBc4ExgBbLDW3l7r/X2Bx4D+wG7Af4B9rLVV3ocvIiIiknwanQGz1q6w1r4XPV4PfALs3sBHzgAet9ZustYuAhbikjERERERoZk1YMaYXOAQ4O3oqd8YYz4yxjxojNk1em53YFmNjy2n4YRNREREpE1Ja+objTEdgCeBcdbadcaYycD/A2z09S/ArwBTx8d3WOc0xhQChQDt27c/bL/99mt+9CISvHXrYMEC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3yGHuNf33w83DklqkfII6zatC3TMq9+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 17:34:20 +02:00
"execution_count": 11,
2021-06-27 14:09:23 +02:00
"metadata": {},
"outputs": [
{
"data": {
2021-06-27 17:34:20 +02:00
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAlYAAAEzCAYAAADzdE1rAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuNCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8QVMy6AAAACXBIWXMAAAsTAAALEwEAmpwYAAA11UlEQVR4nO3deXyU5b3//9cnIUBCEElAxYUEFTeKW+NStWvq0WKp1qqHGiouGAV7ilZ/Vpu21m9PTnt6Wn/YhdrUpVSnerT11A1tNbXfnmM91eAWQf0hsgoiS0UgLIFcvz+uGZjAZCGZmWvumffz8eBx33PPZO4PvYt8uK7P9bnMOYeIiIiI9F9R6ABERERE8oUSKxEREZE0UWIlIiIikiZKrERERETSRImViIiISJoosRIRERFJkx4TKzM7xMyeNbM3zGyemc2IX/+umb1r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mMtKymisbQwXnOQVTQWKSPoMGKA9A/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
}