{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "8923489b",
   "metadata": {},
   "source": [
    "# Regressione"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "097a7965",
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "import numpy as np\n",
    "import matplotlib.pyplot as plt\n",
    "plt.style.use(\"seaborn\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "02959595",
   "metadata": {},
   "outputs": [],
   "source": [
    "metriquadri=[110,100,100,180,90,90,110,140,110,130,80,78,150,160,160,120,130,100,120,107,95,140,107,110,110,140,140]\n",
    "costo=[458,403,351,666,324,453,432,625,471,687,388,453,549,579,700,444,647,461,487,428,406,516,441,671,504,778,460]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "4c94ae5f",
   "metadata": {},
   "outputs": [],
   "source": [
    "df = pd.DataFrame(data={\"costo\":costo,\"metriquadri\":metriquadri})"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "8ad34938",
   "metadata": {},
   "outputs": [],
   "source": [
    "df.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "f06e0102",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "d6e89062",
   "metadata": {},
   "outputs": [],
   "source": [
    "from sklearn.linear_model import LinearRegression"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "f0ad9efa",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "557c9ddc",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "f38d9387",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "d1ba3746",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "dad52138",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "58d3f6d9",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "07d17a0a",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "6ce420c2",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "71242ee7",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "ee76d60b",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "markdown",
   "id": "787874c7",
   "metadata": {},
   "source": [
    "## Regressione multilineare"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "0f9658f7",
   "metadata": {},
   "source": [
    "$ y = a + b_1 x_1 + b_2 x_2 + ... + b_n x_n$"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "6b1d1171",
   "metadata": {},
   "outputs": [],
   "source": [
    "piano=[  1,  2,  0,  4,  3,  1,  5,  8,  5,  4,  5,  6,  7,  2,  0,  0,  1,  4,  2,  5,  5,  1,  2,  3,  4,  3,  5]        "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "f8ded199",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "fa75becb",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "ba54e418",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "35db8418",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "markdown",
   "id": "296e7ea5",
   "metadata": {},
   "source": [
    "## Regressione polinomiale (opzionale!)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "182d2fdb",
   "metadata": {},
   "source": [
    "$ y = a + b_1 x + b^2 x_2 + ... + b_n x^n$"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "40aea320",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "0fd0993b",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "f21d507e",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "f92f53d3",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "3ea9d301",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "markdown",
   "id": "46b93e6b",
   "metadata": {},
   "source": [
    "## Overfitting"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "9fee53f6",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "markdown",
   "id": "b2d47d81",
   "metadata": {},
   "source": [
    "## Underfitting"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "071460c8",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "05cd9021",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "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",
   "version": "3.8.11"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
