polynomial_regression/05_Regresja_wielomianowa.ipynb

865 lines
270 KiB
Plaintext
Raw Normal View History

2022-06-12 17:45:18 +02:00
{
"cells": [
{
"cell_type": "markdown",
"metadata": {
"slideshow": {
"slide_type": "slide"
}
},
"source": [
"# Regresja wielomianowa"
]
},
{
"cell_type": "code",
2022-06-18 17:22:26 +02:00
"execution_count": 1,
2022-06-12 17:45:18 +02:00
"metadata": {
"slideshow": {
"slide_type": "notes"
}
},
"outputs": [],
"source": [
"import ipywidgets as widgets\n",
"import matplotlib.pyplot as plt\n",
"import numpy as np\n",
"import pandas\n",
"\n",
"%matplotlib inline"
]
},
{
"cell_type": "code",
2022-06-18 17:22:26 +02:00
"execution_count": 2,
2022-06-12 17:45:18 +02:00
"metadata": {
"slideshow": {
"slide_type": "notes"
}
},
"outputs": [],
"source": [
"# Przydatne funkcje\n",
"\n",
"def cost(theta, X, y):\n",
" \"\"\"Wersja macierzowa funkcji kosztu\"\"\"\n",
" m = len(y)\n",
" J = 1.0 / (2.0 * m) * ((X * theta - y).T * (X * theta - y))\n",
" return J.item()\n",
"\n",
"def gradient(theta, X, y):\n",
" \"\"\"Wersja macierzowa gradientu funkcji kosztu\"\"\"\n",
" return 1.0 / len(y) * (X.T * (X * theta - y)) \n",
"\n",
"def gradient_descent(fJ, fdJ, theta, X, y, alpha=0.1, eps=10**-7):\n",
" \"\"\"Algorytm gradientu prostego (wersja macierzowa)\"\"\"\n",
" current_cost = fJ(theta, X, y)\n",
" logs = [[current_cost, theta]]\n",
" while True:\n",
" theta = theta - alpha * fdJ(theta, X, y)\n",
" current_cost, prev_cost = fJ(theta, X, y), current_cost\n",
" if abs(prev_cost - current_cost) > 10**15:\n",
" print('Algorithm does not converge!')\n",
" break\n",
" if abs(prev_cost - current_cost) <= eps:\n",
" break\n",
" logs.append([current_cost, theta]) \n",
" return theta, logs\n",
"\n",
"def plot_data(X, y, xlabel, ylabel):\n",
" \"\"\"Wykres danych (wersja macierzowa)\"\"\"\n",
" fig = plt.figure(figsize=(16*.6, 9*.6))\n",
" ax = fig.add_subplot(111)\n",
" fig.subplots_adjust(left=0.1, right=0.9, bottom=0.1, top=0.9)\n",
" ax.scatter([X[:, 1]], [y], c='r', s=50, label='Dane')\n",
" \n",
" ax.set_xlabel(xlabel)\n",
" ax.set_ylabel(ylabel)\n",
" ax.margins(.05, .05)\n",
" plt.ylim(y.min() - 1, y.max() + 1)\n",
" plt.xlim(np.min(X[:, 1]) - 1, np.max(X[:, 1]) + 1)\n",
" return fig\n",
"\n",
"def plot_fun(fig, fun, X):\n",
" \"\"\"Wykres funkcji `fun`\"\"\"\n",
" ax = fig.axes[0]\n",
" x0 = np.min(X[:, 1]) - 1.0\n",
" x1 = np.max(X[:, 1]) + 1.0\n",
" Arg = np.arange(x0, x1, 0.1)\n",
" Val = fun(Arg)\n",
" return ax.plot(Arg, Val, linewidth='2')"
]
},
{
"cell_type": "code",
2022-06-18 17:22:26 +02:00
"execution_count": 3,
2022-06-18 11:52:01 +02:00
"metadata": {},
2022-06-12 17:45:18 +02:00
"outputs": [],
"source": [
2022-06-18 11:52:01 +02:00
"def MSE(Y_true, Y_pred):\n",
" return np.square(np.subtract(Y_true,Y_pred)).mean()"
2022-06-12 17:45:18 +02:00
]
},
{
"cell_type": "code",
2022-06-18 17:22:26 +02:00
"execution_count": 4,
2022-06-12 17:45:18 +02:00
"metadata": {
"slideshow": {
"slide_type": "fragment"
}
},
"outputs": [],
"source": [
"# Funkcja regresji wielomianowej\n",
"\n",
"def h_poly(Theta, x):\n",
" \"\"\"Funkcja wielomianowa\"\"\"\n",
" return sum(theta * np.power(x, i) for i, theta in enumerate(Theta.tolist()))\n",
"\n",
"def get_poly_data(data, deg):\n",
" m, n_plus_1 = data.shape\n",
" n = n_plus_1 - 1\n",
"\n",
" X1 = data[:, 0:n]\n",
" X1 /= np.amax(X1, axis=0)\n",
"\n",
" Xs = [np.ones((m, 1)), X1]\n",
"\n",
" for i in range(2, deg+1):\n",
" Xn = np.power(X1, i)\n",
" Xn /= np.amax(Xn, axis=0)\n",
" Xs.append(Xn)\n",
"\n",
" X = np.matrix(np.concatenate(Xs, axis=1)).reshape(m, deg * n + 1)\n",
"\n",
" y = np.matrix(data[:, -1]).reshape(m, 1)\n",
"\n",
" return X, y\n",
"\n",
"\n",
2022-06-15 20:06:32 +02:00
"def polynomial_regression(X, y, n):\n",
2022-06-12 17:45:18 +02:00
" \"\"\"Funkcja regresji wielomianowej\"\"\"\n",
" theta_start = np.matrix([0] * (n+1)).reshape(n+1, 1)\n",
" theta, logs = gradient_descent(cost, gradient, theta_start, X, y)\n",
" return lambda x: h_poly(theta, x)"
]
},
{
"cell_type": "code",
2022-06-18 17:22:26 +02:00
"execution_count": 5,
2022-06-18 11:52:01 +02:00
"metadata": {},
"outputs": [],
"source": [
"def predict_values(model, data, n):\n",
" x, y = get_poly_data(np.array(data), n)\n",
" preprocessed_x = []\n",
" for i in x:\n",
" preprocessed_x.append(i.item(1))\n",
" return y, model(preprocessed_x), MSE(y, model(preprocessed_x))\n",
"\n",
"def plot_and_mse(data, data_test, n):\n",
" x, y = get_poly_data(np.array(data), n)\n",
" model = polynomial_regression(x, y, n)\n",
" \n",
" fig = plot_data(x, y, xlabel='x', ylabel='y')\n",
" plot_fun(fig, polynomial_regression(x, y, n), x)\n",
"\n",
" y_true, Y_pred, mse = predict_values(model, data_test, n)\n",
" print(f'Wielomian {n} stopnia, MSE = {mse}')"
]
},
{
"cell_type": "code",
2022-06-18 17:22:26 +02:00
"execution_count": 6,
2022-06-12 17:45:18 +02:00
"metadata": {
"slideshow": {
2022-06-18 11:52:01 +02:00
"slide_type": "notes"
2022-06-12 17:45:18 +02:00
}
},
"outputs": [
{
"data": {
2022-06-18 11:52:01 +02:00
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>sqrMetres</th>\n",
" <th>price</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
2022-06-18 17:22:26 +02:00
" <th>470</th>\n",
" <td>40</td>\n",
" <td>1140000.0</td>\n",
2022-06-18 11:52:01 +02:00
" </tr>\n",
" <tr>\n",
2022-06-18 12:59:24 +02:00
" <th>1171</th>\n",
" <td>90</td>\n",
2022-06-18 17:22:26 +02:00
" <td>855000.0</td>\n",
2022-06-18 11:52:01 +02:00
" </tr>\n",
" <tr>\n",
2022-06-18 17:22:26 +02:00
" <th>1128</th>\n",
" <td>37</td>\n",
" <td>288405.0</td>\n",
2022-06-18 11:52:01 +02:00
" </tr>\n",
" <tr>\n",
2022-06-18 17:22:26 +02:00
" <th>254</th>\n",
" <td>49</td>\n",
" <td>290000.0</td>\n",
2022-06-18 11:52:01 +02:00
" </tr>\n",
" <tr>\n",
2022-06-18 17:22:26 +02:00
" <th>508</th>\n",
" <td>91</td>\n",
" <td>375606.0</td>\n",
2022-06-18 11:52:01 +02:00
" </tr>\n",
" <tr>\n",
" <th>...</th>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" </tr>\n",
" <tr>\n",
2022-06-18 17:22:26 +02:00
" <th>389</th>\n",
" <td>56</td>\n",
" <td>325000.0</td>\n",
2022-06-18 11:52:01 +02:00
" </tr>\n",
" <tr>\n",
2022-06-18 17:22:26 +02:00
" <th>1403</th>\n",
" <td>69</td>\n",
" <td>399000.0</td>\n",
2022-06-18 11:52:01 +02:00
" </tr>\n",
" <tr>\n",
2022-06-18 17:22:26 +02:00
" <th>957</th>\n",
" <td>94</td>\n",
" <td>595000.0</td>\n",
2022-06-18 11:52:01 +02:00
" </tr>\n",
" <tr>\n",
2022-06-18 17:22:26 +02:00
" <th>356</th>\n",
" <td>53</td>\n",
" <td>339200.0</td>\n",
2022-06-18 11:52:01 +02:00
" </tr>\n",
" <tr>\n",
2022-06-18 17:22:26 +02:00
" <th>160</th>\n",
" <td>44</td>\n",
" <td>349668.0</td>\n",
2022-06-18 11:52:01 +02:00
" </tr>\n",
" </tbody>\n",
"</table>\n",
"<p>1674 rows × 2 columns</p>\n",
"</div>"
],
2022-06-12 17:45:18 +02:00
"text/plain": [
2022-06-18 12:59:24 +02:00
" sqrMetres price\n",
2022-06-18 17:22:26 +02:00
"470 40 1140000.0\n",
"1171 90 855000.0\n",
"1128 37 288405.0\n",
"254 49 290000.0\n",
"508 91 375606.0\n",
2022-06-18 12:59:24 +02:00
"... ... ...\n",
2022-06-18 17:22:26 +02:00
"389 56 325000.0\n",
"1403 69 399000.0\n",
"957 94 595000.0\n",
"356 53 339200.0\n",
"160 44 349668.0\n",
2022-06-18 11:52:01 +02:00
"\n",
"[1674 rows x 2 columns]"
2022-06-12 17:45:18 +02:00
]
},
2022-06-18 17:22:26 +02:00
"execution_count": 6,
2022-06-12 17:45:18 +02:00
"metadata": {},
2022-06-18 11:52:01 +02:00
"output_type": "execute_result"
}
],
"source": [
"# Wczytanie danych (mieszkania) przy pomocy biblioteki pandas\n",
"\n",
"alldata = pandas.read_csv('data_flats.tsv', header=0, sep='\\t',\n",
" usecols=['price', 'rooms', 'sqrMetres'])\n",
"alldata = alldata[['sqrMetres', 'price']]\n",
2022-06-18 12:59:24 +02:00
"alldata = alldata.sample(frac=1)\n",
2022-06-18 11:52:01 +02:00
"alldata"
]
},
{
"cell_type": "code",
2022-06-18 17:22:26 +02:00
"execution_count": 7,
2022-06-18 11:52:01 +02:00
"metadata": {},
"outputs": [],
"source": [
"# alldata = np.matrix(alldata[['sqrMetres', 'price']])\n",
"data_train = alldata[0:1600]\n",
2022-06-18 12:59:24 +02:00
"data_test = alldata[1600:]\n",
"data_train = np.matrix(data_train).astype(float)\n",
"data_test = np.matrix(data_test).astype(float)"
2022-06-18 11:52:01 +02:00
]
},
{
"cell_type": "code",
2022-06-18 17:22:26 +02:00
"execution_count": 8,
2022-06-18 11:52:01 +02:00
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
2022-06-18 17:22:26 +02:00
"Wielomian 1 stopnia, MSE = 34232245972.377033\n",
"Wielomian 2 stopnia, MSE = 84918416526.0791\n",
"Wielomian 3 stopnia, MSE = 83924720748.3686\n"
2022-06-18 11:52:01 +02:00
]
},
{
"data": {
2022-06-18 17:22:26 +02:00
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAmQAAAFvCAYAAADkPtfiAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAAAsTAAALEwEAmpwYAABA20lEQVR4nO3deXCc1Z3v/89prbYkr/KqFjZgYWNbYCwFAhGExZAgSCC2FGcmlWRSrnAnIfkN42RqkvnNb+7UvTOBm6nKvZkBhkpIhsmdSeKRbJYEEwcbCDiExW1s5BUZs7gt72tLtqzt/P442pB7k9TdT7f6/apSSX6eR08fP2qsD+d7FmOtFQAAALzj87oBAAAA2Y5ABgAA4DECGQAAgMcIZAAAAB4jkAEAAHiMQAYAAOCxjAxkxpifGWOOGmN2xHn9540xu4wxO40xv0h2+wAAAIbDZOI6ZMaYmyS1Svq5tXZxjGsrJP2XpFuttaeMMdOttUdT0U4AAIB4ZGQPmbX2ZUknBx8zxlxujPmtMSZgjHnFGLOg99TXJD1irT3V+72EMQAAkFYyMpBF8GNJ37LWVkn6jqRHe49fIekKY8wfjDGvGWM+7VkLAQAAwsj1ugGJYIwplnSDpAZjTN/hgt7PuZIqJN0syS/pFWPMYmvt6RQ3EwAAIKwxEcjkevpOW2uXhDkXlPSatbZT0nvGmL1yAe3NFLYPAAAgojFRsrTWnpULW/WSZJyre08/JemW3uOlciXM/V60EwAAIJyMDGTGmF9K+qOk+caYoDFmlaQvSlpljNkuaaeke3ov3yDphDFml6QXJf2VtfaEF+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"<Figure size 691.2x388.8 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
2022-06-12 17:45:18 +02:00
},
{
"data": {
2022-06-18 17:22:26 +02:00
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAmQAAAFvCAYAAADkPtfiAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAAAsTAAALEwEAmpwYAABW8UlEQVR4nO3dd3yUVdr/8c+Z9EYPLfQuKKIgWBC7q1jXhp1V1rKLrqy7z8qW37P7uEXXXV117WIviCKWXbCvq6B0UKSHJoRQQp8kpM75/XEnJISZZCaZyT2Z+b5fr7wmmfueey4mQ3LlnOtcx1hrERERERH3eNwOQERERCTeKSETERERcZkSMhERERGXKSETERERcZkSMhERERGXKSETERERcVmLTMiMMc8bY3YaY5YHef5VxpiVxpgVxpjXIx2fiIiISChMS+xDZowZAxQCL1trj27g3P7Am8CZ1tq9xpiO1tqdzRGniIiISDBa5AiZtfZLYE/t+4wxfY0xHxpjFhtjZhtjBlUdugV43Fq7t+qxSsZEREQkqrTIhCyAZ4A7rbXDgV8CT1TdPwAYYIz5yhgzzxhznmsRioiIiPiR6HYA4WCMyQROBt4yxlTfnVJ1mwj0B04HugGzjTFHW2v3NXOYIiIiIn7FREKGM9K3z1o7zM+xPGCetbYc2GiMWYOToC1sxvhEREREAoqJKUtr7QGcZOtKAOM4turwu8AZVfd3wJnC3OBGnCIiIiL+tMiEzBgzFZgLDDTG5BljJgDXAROMMd8CK4BLqk7/CNhtjFkJfA78j7V2txtxi4iIiPjTItteiIiIiMSSFjlCJiIiIhJLlJCJiIiIuKzFrbLs0KGD7dWrFwDFZZWsLygk0WMY1KUVpv6HikgsycuDHTsCH+/cGXJymi8eiRs7DpSw01tK2/RkurVNczsciSKLFy/eZa3NbsxjW1xC1qtXLxYtWgSAtZazH/qC9QVFPDB+BGcd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X5O7wsuj7vWQkJ3DRsV3dDkfiXNwlZABXaNpSRCTuVbe6uHhYVzJSItYnXSQocZmQjR3ahbSkBBZs3MP6gkK3wxERkWZWWlF5qAXSuBPUe0zcF5cJWWZKIpcMc4anX5u32eVoRESkuX28Ygd7i8sZ1DmLY7u1djsckfhMyACuP7EnANMXb+FgWaXL0YiISHOq7j12zcgeGFPvtssizSJuE7Kjc1ozrHsbDpRU8K9v890OR0REmsnm3cV8tW43KYkeLh2W43Y4IkAcJ2QAN1SNkr06/3uXIxERkeYybZEzOjb2mC60Tk9yORoRR1wnZBcM7UKb9CSW5e3n2y373A5HREQirKLSx1uLnGJ+9R6TaBLXCVlqUgJXjXD+Q746T6NkIiKx7vM1Bez0ltKng9OTUiRaxHVCBnDtSGe58/vf5rOvuMzlaEREJJKqO/OPO6G7ivklqsR9QtarQwZjBmRTWuFTo1gRkRi2bf9BPl+zk6QEw+XDu7kdjshh4j4hA7h+lDNK9tr8zfh81uVoREQkEqYvysNn4ZzBneiQmeJ2OCKHUUIGnDmoI11bp7JxVxFfr9/tdjgiIhJmPp9l2iJnqyR15pdopIQMSEzwcE1VLdkr8za5G4yIiITdnHW7yNt7kJw2aZzar4Pb4YgcQQlZlXEju5PoMXy6aifb9h90OxwREQmj6s78407ojsejYn6JPkrIqnTMSuUHR3em0meZumCL2+GIiEiY7Cos5ZOVO/AYuHKEivklOikhq+X6UU7n/jcWbKa80udyNCIiEg4zluRRXmk5fWBHurROczscEb+UkNVyYp929OuYyU6v89eUiIi0bNZa3ljozHqoM79EMyVktRhjDrXAUOd+EZGWb+GmvWwoKKJjVgpnDurodjgiASkhq+Oy4d1IS0rg6/W7Wbez0O1wRESkCao7818xvBuJCfq
2022-06-18 11:52:01 +02:00
"text/plain": [
"<Figure size 691.2x388.8 with 1 Axes>"
]
2022-06-12 17:45:18 +02:00
},
"metadata": {
"needs_background": "light"
2022-06-18 11:52:01 +02:00
},
"output_type": "display_data"
},
{
"data": {
2022-06-18 17:22:26 +02:00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piZySm4218N4qjZKJiESzlxZtoazSxymDs8ntluV2OBJnlJC1Um1vyzlfKyETEYlWFVU+npu/CXBKXYi0NSVkrXTmsG4kJ3pY8M1eth8sdTscERFpgXdWbmfnoXIGdc3klNwubocjcUgJWSu1T0virKO6YS28uazQ7XBERCRI1lqenOeUurjhJBWCFXcoIQuBi0fmAPD60gKstS5HIyIiwVi8eT9fFRykY3rS4Z/nIm1NCVkInDI4m84ZyeTtKmLltkNuhyMiIkF48jNndOyqsX1JTUpwORqJV0rIQiApwcP5xzrtNV6r2TItIiKRb+u+Et5fvYOkBMM141UIVtyjhCxELhnZC4C3VxRSWe1zORoREQnEM19swmfhvBE96dYu1e1wJI4pIQuR4TntyO2ayd7iCj5dv9vtcEREpBneskpmfrkVUKkLcZ8SshAxxnBxzSjZ60u3uRyNiIg059+LCygqr2JM/04Mz2nvdjgS55SQhdB3j++JMfDBmp0cLKl0OxwREfGj2md5+ou6UhciblNCFkI92qdx4sDOVFT5mP31drfDERERPz5YvZOt+0rp0ymds4Z1czscESVkoXbx8bXTltptKSISqZ763Bkd+/6J/UjwqBCsuE8JWYidPbw7aUkJLN68n817i90OR0REGli57SCLvtlHZkoi3xvdy+1wRAAlZCGXkZJ4uOH4G8u0uF9EJNLUtkmackJvslKTXI5GxKGELAzq77ZUKyURkcix81AZb68oxGOc6UqRSKGELAzGD+xM93apbNlXwpLN+90
2022-06-18 11:52:01 +02:00
"text/plain": [
"<Figure size 691.2x388.8 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
2022-06-12 17:45:18 +02:00
}
],
"source": [
2022-06-18 12:59:24 +02:00
"for n in range(1, 4):\n",
" plot_and_mse(data_train, data_test, n) "
2022-06-18 11:52:01 +02:00
]
},
{
"cell_type": "code",
2022-06-18 12:59:24 +02:00
"execution_count": 145,
2022-06-18 11:52:01 +02:00
"metadata": {},
"outputs": [],
"source": [
"# Ilość nauki do oceny"
]
},
{
"cell_type": "code",
2022-06-18 17:22:26 +02:00
"execution_count": 9,
2022-06-18 11:52:01 +02:00
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>number_courses</th>\n",
" <th>time_study</th>\n",
" <th>Marks</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>3</td>\n",
" <td>4.508</td>\n",
" <td>19.202</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>4</td>\n",
" <td>0.096</td>\n",
" <td>7.734</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>4</td>\n",
" <td>3.133</td>\n",
" <td>13.811</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>6</td>\n",
" <td>7.909</td>\n",
" <td>53.018</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>8</td>\n",
" <td>7.811</td>\n",
" <td>55.299</td>\n",
" </tr>\n",
" <tr>\n",
" <th>...</th>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" </tr>\n",
" <tr>\n",
" <th>95</th>\n",
" <td>6</td>\n",
" <td>3.561</td>\n",
" <td>19.128</td>\n",
" </tr>\n",
" <tr>\n",
" <th>96</th>\n",
" <td>3</td>\n",
" <td>0.301</td>\n",
" <td>5.609</td>\n",
" </tr>\n",
" <tr>\n",
" <th>97</th>\n",
" <td>4</td>\n",
" <td>7.163</td>\n",
" <td>41.444</td>\n",
" </tr>\n",
" <tr>\n",
" <th>98</th>\n",
" <td>7</td>\n",
" <td>0.309</td>\n",
" <td>12.027</td>\n",
" </tr>\n",
" <tr>\n",
" <th>99</th>\n",
" <td>3</td>\n",
" <td>6.335</td>\n",
" <td>32.357</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"<p>100 rows × 3 columns</p>\n",
"</div>"
],
"text/plain": [
" number_courses time_study Marks\n",
"0 3 4.508 19.202\n",
"1 4 0.096 7.734\n",
"2 4 3.133 13.811\n",
"3 6 7.909 53.018\n",
"4 8 7.811 55.299\n",
".. ... ... ...\n",
"95 6 3.561 19.128\n",
"96 3 0.301 5.609\n",
"97 4 7.163 41.444\n",
"98 7 0.309 12.027\n",
"99 3 6.335 32.357\n",
"\n",
"[100 rows x 3 columns]"
]
},
2022-06-18 17:22:26 +02:00
"execution_count": 9,
2022-06-18 11:52:01 +02:00
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
2022-06-18 12:59:24 +02:00
"data_marks_all = pandas.read_csv('Student_Marks.csv')\n",
2022-06-18 11:52:01 +02:00
"data_marks_all"
]
},
{
"cell_type": "code",
2022-06-18 17:22:26 +02:00
"execution_count": 10,
2022-06-18 11:52:01 +02:00
"metadata": {},
2022-06-18 12:59:24 +02:00
"outputs": [],
2022-06-18 11:52:01 +02:00
"source": [
"data_marks_all = data_marks_all[['time_study', 'Marks']]\n",
2022-06-18 12:59:24 +02:00
"# data_marks_all = data_marks_all.sample(frac=1)\n",
"data_marks_train = data_marks_all[0:70]\n",
2022-06-18 11:52:01 +02:00
"data_marks_test = data_marks_all[70:]\n",
2022-06-18 12:59:24 +02:00
"data_marks_train = np.matrix(data_marks_train).astype(float)\n",
"data_marks_test = np.matrix(data_marks_test).astype(float)"
2022-06-18 11:52:01 +02:00
]
},
{
"cell_type": "code",
2022-06-18 17:22:26 +02:00
"execution_count": 17,
2022-06-18 11:52:01 +02:00
"metadata": {},
"outputs": [
{
2022-06-18 12:59:24 +02:00
"name": "stdout",
"output_type": "stream",
"text": [
2022-06-18 17:22:26 +02:00
"Wielomian 1 stopnia, MSE = 381.1693728350544\n",
"Wielomian 2 stopnia, MSE = 394.1863119057109\n",
"Wielomian 3 stopnia, MSE = 391.50171107305584\n"
2022-06-18 12:59:24 +02:00
]
2022-06-18 11:52:01 +02:00
},
{
"data": {
2022-06-18 17:22:26 +02:00
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAmEAAAFkCAYAAABo0OxlAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAAAsTAAALEwEAmpwYAAA6yUlEQVR4nO3deXxU9dXH8c9vssIk7PsmAkH2YKWu1CpuiGvZ0vZ5WtvS2lp9LIIK7q0rolBtrbZU29pFDeIuuKJWcQclIIskIgKGfZ0kZJv5PX/cxIQwk0yWmTsz+b5fL16TzL135jivUY6/37nnGGstIiIiIhJdHrcDEBEREWmNlISJiIiIuEBJmIiIiIgLlISJiIiIuEBJmIiIiIgLlISJiIiIuCDZ7QDC0aVLF9u/f3+3wxARkQRTGbBs2OHDH7D06tCGzt5Ut0OSOLNixYrd1tquTbk2LpKw/v37s3z5crfDEBGRBGKt5Zf/WsH+tTs4ZVBn/vWzE/B4jNthSZwxxnzV1GvjIgkTEZE44fNBbi7k50NWFuTkQGam21EF9cynX/Pq2h1kpCUzd3K2EjCJOiVhIiLSMpYtgwkTIBCA4mLwemHGDFiyBMaOdTu6w2w7cIhbnl8DwM0XDKN3hzYuRyStkQrzRUSk+Xw+JwHz+ZwEDJzH6ueLityNrxZrLdcuWoWvtJIzhnRjynF93A5JWiklYSIi0ny5uc4KWDCBgHM8Rjz20Wbeyd9Nh7Yp3DVxJMZoG1LcoSRMRESaLz+/ZgWsruJiKCiIbjwhbN5Twh2L1wFw20Uj6NYu3eWIpDVTEiYiIs2XleXUgAXj9cKgQdGNJ4hAwHL1k3mUlPs5b1RPLsju5XZI0sopCRMRkebLyQFPiL9SPB7nuMv+9u6XfLRpL10y0rjtohFuhyOiJExERFpAZqZzF2R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W3vrCWbQdKObZfBy79zgC3wxGJKiVhIiLiilfXbOepT7aSnuJh3pRskpP0V5K0LvrGi4hI1O0tLuf6Z1YDMGv8EAZ0zXA5IpHoUxImIiJRZa3lxmdXs7uonBMHdOKSk/q7HZKIK5SEiYhIVL2wahtLVm/Hm5rEPZOz8XiM2yGJuEJJmIiIRM3Og6Xc9OxnANx0/jD6dmrrckQi7lESJiIiUWGtZfbTqzlwqILTjulKzrf7uh2SiKuUhImISFQ8uXwrb6zfSfs2Kdw9aRTGaBtSWreIDfAWEZE45/NBbi7k50NWFuTkQGZmk15q674Sbn1xLQC3XjSc7u3SWzJSkbikJExERI60bBlMmACBABQXg9cLM2bAkiUwdmyjXioQsFy7aBVFZZWcO6IHF2b3ilDQIvFF25EiInI4n89JwHw+JwED57H6+aKiRr3cvz74ive+2ENnbyq3XzxC25AiVZSEiYjI4XJznRWwYAIB53iYvtxdzF0vrQPgzokj6ZyR1hIRiiQEJWEiInK4/PyaFbC6iouhoCCsl/EHLDMXrqS0IsDEY3tzzvAeLRikSPxTEiYiIofLynJqwILxemHQoLBe5q/vbOSTzfvp0S6dWy4Y3oIBiiQGJWEiInK4nBzwhPjrweNxjjfg8+0+5r+6AYA5k0bSvm1KS0YokhCUhImIyOEyM527IDMza1bEvN6a5zPqH7Zd4Q8wY+FKyv0BfnhCP047plsUghaJP2pRISIiRxo7FgoLnSL8ggJnCzInp8EEDOCBNwpYU3iQvp3acP2EoVEIViQ+KQkTEZHgMjJg2rRGXbJ66wEeeLMAY+CeydlkpOmvGZFQtB0pIiItorTCz4yFK/EHLD89+WhOHNDZ7ZBEYpqSMBERaRG/f20D+TuLGNDVy7Xjj3E7HJGYpyRMRESabfmmvSx4ZyMeA/OmZJOekuR2SCIxT0m
2022-06-18 11:52:01 +02:00
"text/plain": [
"<Figure size 691.2x388.8 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
},
{
"data": {
2022-06-18 17:22:26 +02:00
"image/png": "iVBORw0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q0M2fXOzOV1WxcfbjtZ/gohIAnK2Ip0dg1v8fRZFpOHCdnWktXYXMCTA/ceA68P1c5vqliGd2HJoK7PXFTK6f0e3wxERiTobC0+z+1gp7bPSuFxXk4s0mtaQL1BzleS8TYc5U6EtSRGRC73tXwUbNyhXza1FmkBJ2AW6tstgSOdWlFRUs3BrVFwzICISNay1zKm5KnKwrooUaQolYQHc4r/cuqbmQUREHGv2nWT/iTPktkxneLc2bocjEtOUhAVws7/QdP7mIorLq1yORkQketT0Bhs3KA+PtiJFmkRJWAB5rVpwafc2lFf5mL/5sNvhiIhEBZ+v1lbkEF0VKdJUSsKCqNmSVONWERHHyr0nOHS6jPzWLRjWpbXb4YjEPCVhQYwdmIfHwD+3HeFUaaXb4YiIuK7mQ+n4wXkYo61IkaZSEhZETnYaI3q2o7La8t6mQ26HIyLiqmqfZe5653ehrooUaR5Kwupwi2ZJiogAsHTXMY4Wl9OtXQYD81u6HY5IXFASVoebBuaS7DF8svMYx4rL3Q5HRMQ1b5/tDaatSJHmoiSsDq0zUrm6oD3VPss7G7QlKSKJqbLax7sb1KBVpLkpCavHeG1JikiC+2TnMU6UVtIzJ5O+udluhyMSN8I2wDtejBnQkdQ3PCzbfZzDp8vo2DLd7ZBERCLD64WZM5m93YDJZXzfdtqKFGlGWgmrR8v0FK7rk4O1nG1SKCIS9xYtgvx8KqZ+l/fKswC45YG7nftFpFkoCQvB2S1JzZIUkUTg9cK4ceD18nG
2022-06-18 11:52:01 +02:00
"text/plain": [
2022-06-18 12:59:24 +02:00
"<Figure size 691.2x388.8 with 1 Axes>"
2022-06-18 11:52:01 +02:00
]
},
2022-06-18 12:59:24 +02:00
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
2022-06-18 11:52:01 +02:00
},
{
"data": {
2022-06-18 17:22:26 +02:00
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAmEAAAFkCAYAAABo0OxlAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLj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idNdv6gI0lU7JtJVCmEiIgLAriOn2XnkNBnJ8cy7KMv/ScXFsGCBs5F3ba3TxHXxYqeJ6+zZfTtgkSin5UgREQFg1WZnFuzmqbkkxcedf4Lb7QQwt9sJYOA8+p6vqenD0YpEP4UwERGh1WP5szeE3TFjhP+Tli93ZsD88Xic4yISNIUwERHh7/uqqHQ3kj8khRmjMv2fVFJydgasvdpa2LcvZOMTiUUKYSIicrY32IwRGGP8n1RQ4NSA+ZOa6uwvKSJBUwgTEennahpb+OuOo0An2xQVFYErwP82XC7nuIgETSFMRKSf+8sHR2ho9nDZ6MGMHJwS+MT0dOcuyPT0szNiqalnn09L65sBi8QItagQEennfL3BgtqmaPZsKC93ivD37XOWIIuKFMBEukEhTESkHys7Wcfb+4+TGO9iwZSc4C5KS4P77w/twET6AS1Hioj0Y6u3lAMwf2I2GckJYR6NSP+iECYi0k9Za1nhvStyYaDeYCISMlqOFBHpp7aWnWL/sVqGpiXysYKhgU/UXpEiIaEQJiLST/l6g906LY/4uAALI9orUiRktBwpItIPNbV4WLPVqQe7Y0aAuyK1V6RISCmEiYj0Q6/tqaS6rpkJw9OZmJPh/yTtFSkSUlqOFBGJRZ3UcZ3dpig
2022-06-18 11:52:01 +02:00
"text/plain": [
"<Figure size 691.2x388.8 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
2022-06-18 12:59:24 +02:00
"for n in range(1, 4):\n",
2022-06-18 17:22:26 +02:00
" plot_and_mse(data_marks_train, data_marks_test, n) "
2022-06-18 11:52:01 +02:00
]
},
{
"cell_type": "code",
2022-06-18 17:22:26 +02:00
"execution_count": 13,
2022-06-18 11:52:01 +02:00
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>age</th>\n",
" <th>sex</th>\n",
" <th>bmi</th>\n",
" <th>children</th>\n",
" <th>smoker</th>\n",
" <th>region</th>\n",
" <th>charges</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
2022-06-18 17:22:26 +02:00
" <th>955</th>\n",
" <td>31</td>\n",
2022-06-18 12:59:24 +02:00
" <td>male</td>\n",
2022-06-18 17:22:26 +02:00
" <td>39.490</td>\n",
" <td>1</td>\n",
" <td>no</td>\n",
" <td>southeast</td>\n",
" <td>3875.73410</td>\n",
2022-06-18 11:52:01 +02:00
" </tr>\n",
" <tr>\n",
2022-06-18 17:22:26 +02:00
" <th>644</th>\n",
" <td>43</td>\n",
2022-06-18 12:59:24 +02:00
" <td>male</td>\n",
2022-06-18 17:22:26 +02:00
" <td>35.310</td>\n",
" <td>2</td>\n",
2022-06-18 11:52:01 +02:00
" <td>no</td>\n",
2022-06-18 17:22:26 +02:00
" <td>southeast</td>\n",
" <td>18806.14547</td>\n",
2022-06-18 11:52:01 +02:00
" </tr>\n",
" <tr>\n",
2022-06-18 17:22:26 +02:00
" <th>1210</th>\n",
" <td>36</td>\n",
2022-06-18 12:59:24 +02:00
" <td>male</td>\n",
2022-06-18 17:22:26 +02:00
" <td>30.875</td>\n",
" <td>1</td>\n",
" <td>no</td>\n",
" <td>northwest</td>\n",
" <td>5373.36425</td>\n",
2022-06-18 11:52:01 +02:00
" </tr>\n",
" <tr>\n",
2022-06-18 17:22:26 +02:00
" <th>260</th>\n",
" <td>58</td>\n",
2022-06-18 11:52:01 +02:00
" <td>female</td>\n",
2022-06-18 17:22:26 +02:00
" <td>25.200</td>\n",
" <td>0</td>\n",
2022-06-18 11:52:01 +02:00
" <td>no</td>\n",
2022-06-18 12:59:24 +02:00
" <td>southwest</td>\n",
2022-06-18 17:22:26 +02:00
" <td>11837.16000</td>\n",
2022-06-18 11:52:01 +02:00
" </tr>\n",
" <tr>\n",
2022-06-18 17:22:26 +02:00
" <th>740</th>\n",
" <td>45</td>\n",
2022-06-18 12:59:24 +02:00
" <td>male</td>\n",
2022-06-18 17:22:26 +02:00
" <td>24.035</td>\n",
2022-06-18 12:59:24 +02:00
" <td>2</td>\n",
2022-06-18 11:52:01 +02:00
" <td>no</td>\n",
2022-06-18 17:22:26 +02:00
" <td>northeast</td>\n",
" <td>8604.48365</td>\n",
2022-06-18 11:52:01 +02:00
" </tr>\n",
" <tr>\n",
" <th>...</th>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" </tr>\n",
" <tr>\n",
2022-06-18 17:22:26 +02:00
" <th>808</th>\n",
" <td>18</td>\n",
2022-06-18 11:52:01 +02:00
" <td>male</td>\n",
2022-06-18 17:22:26 +02:00
" <td>30.140</td>\n",
2022-06-18 11:52:01 +02:00
" <td>0</td>\n",
" <td>no</td>\n",
2022-06-18 12:59:24 +02:00
" <td>southeast</td>\n",
2022-06-18 17:22:26 +02:00
" <td>1131.50660</td>\n",
2022-06-18 11:52:01 +02:00
" </tr>\n",
" <tr>\n",
2022-06-18 17:22:26 +02:00
" <th>301</th>\n",
" <td>53</td>\n",
" <td>female</td>\n",
" <td>22.610</td>\n",
" <td>3</td>\n",
" <td>yes</td>\n",
2022-06-18 12:59:24 +02:00
" <td>northeast</td>\n",
2022-06-18 17:22:26 +02:00
" <td>24873.38490</td>\n",
2022-06-18 11:52:01 +02:00
" </tr>\n",
" <tr>\n",
2022-06-18 17:22:26 +02:00
" <th>664</th>\n",
" <td>64</td>\n",
" <td>female</td>\n",
" <td>22.990</td>\n",
" <td>0</td>\n",
2022-06-18 12:59:24 +02:00
" <td>yes</td>\n",
2022-06-18 17:22:26 +02:00
" <td>southeast</td>\n",
" <td>27037.91410</td>\n",
2022-06-18 11:52:01 +02:00
" </tr>\n",
" <tr>\n",
2022-06-18 17:22:26 +02:00
" <th>989</th>\n",
" <td>24</td>\n",
2022-06-18 11:52:01 +02:00
" <td>female</td>\n",
2022-06-18 17:22:26 +02:00
" <td>20.520</td>\n",
2022-06-18 11:52:01 +02:00
" <td>0</td>\n",
2022-06-18 17:22:26 +02:00
" <td>yes</td>\n",
" <td>northeast</td>\n",
" <td>14571.89080</td>\n",
2022-06-18 11:52:01 +02:00
" </tr>\n",
" <tr>\n",
2022-06-18 17:22:26 +02:00
" <th>1121</th>\n",
2022-06-18 12:59:24 +02:00
" <td>46</td>\n",
2022-06-18 11:52:01 +02:00
" <td>male</td>\n",
2022-06-18 17:22:26 +02:00
" <td>38.170</td>\n",
" <td>2</td>\n",
2022-06-18 12:59:24 +02:00
" <td>no</td>\n",
2022-06-18 17:22:26 +02:00
" <td>southeast</td>\n",
" <td>8347.16430</td>\n",
2022-06-18 11:52:01 +02:00
" </tr>\n",
" </tbody>\n",
"</table>\n",
"<p>1338 rows × 7 columns</p>\n",
"</div>"
],
"text/plain": [
" age sex bmi children smoker region charges\n",
2022-06-18 17:22:26 +02:00
"955 31 male 39.490 1 no southeast 3875.73410\n",
"644 43 male 35.310 2 no southeast 18806.14547\n",
"1210 36 male 30.875 1 no northwest 5373.36425\n",
"260 58 female 25.200 0 no southwest 11837.16000\n",
"740 45 male 24.035 2 no northeast 8604.48365\n",
2022-06-18 11:52:01 +02:00
"... ... ... ... ... ... ... ...\n",
2022-06-18 17:22:26 +02:00
"808 18 male 30.140 0 no southeast 1131.50660\n",
"301 53 female 22.610 3 yes northeast 24873.38490\n",
"664 64 female 22.990 0 yes southeast 27037.91410\n",
"989 24 female 20.520 0 yes northeast 14571.89080\n",
"1121 46 male 38.170 2 no southeast 8347.16430\n",
2022-06-18 11:52:01 +02:00
"\n",
"[1338 rows x 7 columns]"
]
},
2022-06-18 17:22:26 +02:00
"execution_count": 13,
2022-06-18 11:52:01 +02:00
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"data_ins = pandas.read_csv('insurance.csv')\n",
"data_ins = data_ins.sample(frac=1)\n",
"data_ins"
]
},
{
"cell_type": "code",
2022-06-18 17:22:26 +02:00
"execution_count": 14,
2022-06-18 11:52:01 +02:00
"metadata": {},
2022-06-18 12:59:24 +02:00
"outputs": [],
2022-06-18 11:52:01 +02:00
"source": [
2022-06-18 12:59:24 +02:00
"data_ins = data_ins[['age', 'charges']]\n",
"data_ins_train = data_ins[0:1200]\n",
"data_ins_test = data_ins[1200:]\n",
"data_ins_train = np.matrix(data_ins_train).astype(float)\n",
"data_ins_test = np.matrix(data_ins_test).astype(float)"
2022-06-18 11:52:01 +02:00
]
},
{
"cell_type": "code",
2022-06-18 17:22:26 +02:00
"execution_count": 15,
2022-06-18 11:52:01 +02:00
"metadata": {},
"outputs": [
2022-06-18 12:59:24 +02:00
{
"name": "stdout",
"output_type": "stream",
"text": [
2022-06-18 17:22:26 +02:00
"Wielomian 1 stopnia, MSE = 195836517.14979035\n",
"Wielomian 2 stopnia, MSE = 196081038.617658\n",
"Wielomian 3 stopnia, MSE = 196407183.82186848\n"
2022-06-18 12:59:24 +02:00
]
},
2022-06-18 11:52:01 +02:00
{
"data": {
2022-06-18 17:22:26 +02:00
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAnQAAAFkCAYAAACpV6bJAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAAAsTAAALEwEAmpwYAABefElEQVR4nO3deXzV5Z3//deVnYSIguwhcUPcUUSStnRR21rRqlUQJNxyz23Hmaozrc4idn73PfObdkbazthxinamPzqjHYKAqNWqSOvShdaERbGKguCSEMOirAkQsl33H9c55HD4nu/Zt+T9fDzySPie7TqJgY/XdX3el7HWIiIiIiL5qyDbAxARERGR5KigExEREclzKuhERERE8pwKOhEREZE8p4JOREREJM+poBMRERHJc0XZHkCmn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1Etvb/++uFiVlbm9d5Fe99Ch/qXgjo74nltEolJBJyKST9ascc0M3/oWfP/77vO4ca64CxZ4M2ZELtYKCvq7XZ9/3n0OFmHBhoe+vvgLuuJieOstt7R6+umuqcKLcuhE0kJNESIi+cKv2eH733efg9EjCxfCggXeXa7BpoTp0/sbJDZtgh//2F3v7o5/bF//OlxyiQsUjhQqHByvcuhEUk4FnYhIvvBrdggKFngLFsC777q8uG3b+pdZwztMhw6F225zM3uFhYmP7Yc/jP2+VVXR7yMicVFBJyKSL/yaHcIdOeKWYBctOj5MOBXPLSI5R3voRETyhV+zQ7ieHnjsMbffLpbO0mjPXVKS3AxeqPffT83
2022-06-18 11:52:01 +02:00
"text/plain": [
2022-06-18 12:59:24 +02:00
"<Figure size 691.2x388.8 with 1 Axes>"
2022-06-18 11:52:01 +02:00
]
},
2022-06-18 12:59:24 +02:00
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
2022-06-18 11:52:01 +02:00
},
{
"data": {
2022-06-18 17:22:26 +02:00
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAnQAAAFkCAYAAACpV6bJAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAAAsTAAALEwEAmpwYAABq60lEQVR4nO3dd5yU1dn/8c/ZXgHpvQmCiKKAiopGo7Fgr1giJGJMLIklRTTJkx7RJ9GQoOYxJBErGOwFjS0/xSgCCgoIgoACS6/Lwvbz++PMsMMyc09vu9/367WvWe6573vO7LLsxTnnui5jrUVEREREsldOugcgIiIiIvFRQCciIiKS5RTQiYiIiGQ5BXQiIiIiWU4BnYiIiEiWU0AnIiIikuXy0j2AVOvYsaPt27dvuochIq3F2rWwcWPo57t2hR49UjceEUmLdTv2sq2qlqK8XAZ0LsOYA8+ZP3/+Fmttp1ju3+oCur59+zJv3rx0D0NEWoupU+GWW6Cq6sDnSkvht7+FCRNSPiwR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rtiC3fN+gyAP142jIFdWtd/BBXQiUhmCCyP4effjD9mjAsoFECkT1kZTJiQ7lGIBLVux15uevJjGi3ccPLBnDm0W7qHlHLaQycimUHlMUQkBtV1DXzv0flsq6rlpEM68cPTB6V7SGmhgE5EMoPKY4hIlKy1/PTZRXy6bie92hfz58uPJDendSRBNKeATkQyg8pjiEiUHv3gS57+aC1F+Tn83zdH0q6kIN1DShsFdCKSGVQeQ0SiMHf1Nn794hIA7r74CIZ0b5PmEaVXUgM6Y8xqY8y
2022-06-18 11:52:01 +02:00
"text/plain": [
"<Figure size 691.2x388.8 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
},
{
2022-06-18 12:59:24 +02:00
"data": {
2022-06-18 17:22:26 +02:00
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAnQAAAFkCAYAAACpV6bJAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAAAsTAAALEwEAmpwYAABjkklEQVR4nO3deZxU1Z3//9fpnV4Q2VdFBEHcUNC4oFHccYsrZpPMoGZcJlEziZjkNzPfiYlk05CgJgYzouOCgxoZFXHDRIwbKKhsgoCCzb5WN/R+fn+cKrsobt3at+738/HoRzW36t57qouWj+ecz+djrLWIiIiISOEqyvUARERERCQ1CuhERERECpwCOhEREZECp4BOREREpMApoBMREREpcAroRERERApcSa4HkG09e/a0gwcPzvUwRKSzWL8eNm2K/nzfvjBgQPbGIxJm995mPtu+h8qyYg7tVZ3r4XR6Cxcu3Gqt7ZXMuZ0uoBs8eDALFizI9TBEpLOYPh1uuQXq6/d/rqoK7rwTJk3K+rBEAG57chFPv/8Ft583ghtOPzTXw+n0jDGfJXuullxFRDJpwgQoivKf2qIi97xIDrS0tvHa8s0AnD2yT45HI6lSQCcikkk1NfDCC+6xqsodq6pqP16tZS7JjffW7mDnnmaG9KpiaG/9PSx0nW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jDNGGOstTYbb0REMkDlMToOFYlOm71NrTz/0QZArb7EW6YDOgu8ZIyxwJ+stQ8Afay1GwCstRuMMb2Drx2Am4ELWR881hz8PvJ46Jx1wWu1GGN2AT2A8BlBjDHX42b4OOigg9L37kRExJu
2022-06-18 12:59:24 +02:00
"text/plain": [
"<Figure size 691.2x388.8 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
2022-06-18 11:52:01 +02:00
}
],
"source": [
2022-06-18 12:59:24 +02:00
"for n in range(1, 4):\n",
" plot_and_mse(data_ins_train, data_ins_test, n) "
2022-06-12 17:45:18 +02:00
]
2022-06-18 17:22:26 +02:00
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
2022-06-12 17:45:18 +02:00
}
],
"metadata": {
"author": "Paweł Skórzewski",
"celltoolbar": "Slideshow",
"email": "pawel.skorzewski@amu.edu.pl",
"kernelspec": {
2022-06-18 11:52:01 +02:00
"display_name": "Python 3 (ipykernel)",
2022-06-12 17:45:18 +02:00
"language": "python",
"name": "python3"
},
"lang": "pl",
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
2022-06-18 17:22:26 +02:00
"version": "3.9.12"
2022-06-12 17:45:18 +02:00
},
"livereveal": {
"start_slideshow_at": "selected",
"theme": "white"
},
"subtitle": "5.Regresja wielomianowa. Problem nadmiernego dopasowania[wykład]",
"title": "Uczenie maszynowe",
"year": "2021"
},
"nbformat": 4,
"nbformat_minor": 4
2022-06-18 11:52:01 +02:00
}