{
"cells": [
{
"cell_type": "markdown",
"metadata": {
"colab_type": "text",
"id": "view-in-github"
},
"source": [
" "
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Linear models: a classic example"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {
"colab": {},
"colab_type": "code",
"id": "oIimJROu2Hc_"
},
"outputs": [],
"source": [
"import pandas as pd\n",
"import numpy as np\n",
"from sklearn.linear_model import LinearRegression\n",
"import matplotlib.pyplot as plt\n"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
"height": 201
},
"colab_type": "code",
"id": "vsVJc6lS2Qov",
"outputId": "fc0b2fe3-eccd-4f2a-819f-084bc8e2602d"
},
"outputs": [
{
"data": {
"text/html": [
"
\n", " | Region | \n", "Fertility | \n", "Agriculture | \n", "Examination | \n", "Education | \n", "Catholic | \n", "Infant.Mortality | \n", "
---|---|---|---|---|---|---|---|
0 | \n", "Courtelary | \n", "80.2 | \n", "17.0 | \n", "15 | \n", "12 | \n", "9.96 | \n", "22.2 | \n", "
1 | \n", "Delemont | \n", "83.1 | \n", "45.1 | \n", "6 | \n", "9 | \n", "84.84 | \n", "22.2 | \n", "
2 | \n", "Franches-Mnt | \n", "92.5 | \n", "39.7 | \n", "5 | \n", "5 | \n", "93.40 | \n", "20.2 | \n", "
3 | \n", "Moutier | \n", "85.8 | \n", "36.5 | \n", "12 | \n", "7 | \n", "33.77 | \n", "20.3 | \n", "
4 | \n", "Neuveville | \n", "76.9 | \n", "43.5 | \n", "17 | \n", "15 | \n", "5.16 | \n", "20.6 | \n", "