Created
April 19, 2021 16:45
-
-
Save jukomol/bc564295d92e9c4afd3aa79d221667b9 to your computer and use it in GitHub Desktop.
Created on Skills Network Labs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"cells": [ | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"button": false, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"source": [ | |
"<center>\n", | |
" <img src=\"https://cf-courses-data.s3.us.cloud-object-storage.appdomain.cloud/IBMDeveloperSkillsNetwork-ML0101EN-SkillsNetwork/labs/Module%202/images/IDSNlogo.png\" width=\"300\" alt=\"cognitiveclass.ai logo\" />\n", | |
"</center>\n", | |
"\n", | |
"# Multiple Linear Regression\n", | |
"\n", | |
"Estimated time needed: **15** minutes\n", | |
"\n", | |
"## Objectives\n", | |
"\n", | |
"After completing this lab you will be able to:\n", | |
"\n", | |
"- Use scikit-learn to implement Multiple Linear Regression\n", | |
"- Create a model, train,test and use the model\n" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"<h1>Table of contents</h1>\n", | |
"\n", | |
"<div class=\"alert alert-block alert-info\" style=\"margin-top: 20px\">\n", | |
" <ol>\n", | |
" <li><a href=\"#understanding-data\">Understanding the Data</a></li>\n", | |
" <li><a href=\"#reading_data\">Reading the Data in</a></li>\n", | |
" <li><a href=\"#multiple_regression_model\">Multiple Regression Model</a></li>\n", | |
" <li><a href=\"#prediction\">Prediction</a></li>\n", | |
" <li><a href=\"#practice\">Practice</a></li>\n", | |
" </ol>\n", | |
"</div>\n", | |
"<br>\n", | |
"<hr>\n" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"button": false, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"source": [ | |
"### Importing Needed packages\n" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 1, | |
"metadata": { | |
"button": false, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"outputs": [], | |
"source": [ | |
"import matplotlib.pyplot as plt\n", | |
"import pandas as pd\n", | |
"import pylab as pl\n", | |
"import numpy as np\n", | |
"%matplotlib inline" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"button": false, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"source": [ | |
"### Downloading Data\n", | |
"\n", | |
"To download the data, we will use !wget to download it from IBM Object Storage.\n" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 2, | |
"metadata": { | |
"button": false, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"--2021-04-18 15:29:10-- https://cf-courses-data.s3.us.cloud-object-storage.appdomain.cloud/IBMDeveloperSkillsNetwork-ML0101EN-SkillsNetwork/labs/Module%202/data/FuelConsumptionCo2.csv\n", | |
"Resolving cf-courses-data.s3.us.cloud-object-storage.appdomain.cloud (cf-courses-data.s3.us.cloud-object-storage.appdomain.cloud)... 169.63.118.104\n", | |
"Connecting to cf-courses-data.s3.us.cloud-object-storage.appdomain.cloud (cf-courses-data.s3.us.cloud-object-storage.appdomain.cloud)|169.63.118.104|:443... connected.\n", | |
"HTTP request sent, awaiting response... 200 OK\n", | |
"Length: 72629 (71K) [text/csv]\n", | |
"Saving to: ‘FuelConsumption.csv’\n", | |
"\n", | |
"FuelConsumption.csv 100%[===================>] 70.93K --.-KB/s in 0.03s \n", | |
"\n", | |
"2021-04-18 15:29:10 (2.06 MB/s) - ‘FuelConsumption.csv’ saved [72629/72629]\n", | |
"\n" | |
] | |
} | |
], | |
"source": [ | |
"!wget -O FuelConsumption.csv https://cf-courses-data.s3.us.cloud-object-storage.appdomain.cloud/IBMDeveloperSkillsNetwork-ML0101EN-SkillsNetwork/labs/Module%202/data/FuelConsumptionCo2.csv" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"**Did you know?** When it comes to Machine Learning, you will likely be working with large datasets. As a business, where can you host your data? IBM is offering a unique opportunity for businesses, with 10 Tb of IBM Cloud Object Storage: [Sign up now for free](http://cocl.us/ML0101EN-IBM-Offer-CC)\n" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"button": false, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"source": [ | |
"<h2 id=\"understanding_data\">Understanding the Data</h2>\n", | |
"\n", | |
"### `FuelConsumption.csv`:\n", | |
"\n", | |
"We have downloaded a fuel consumption dataset, **`FuelConsumption.csv`**, which contains model-specific fuel consumption ratings and estimated carbon dioxide emissions for new light-duty vehicles for retail sale in Canada. [Dataset source](http://open.canada.ca/data/en/dataset/98f1a129-f628-4ce4-b24d-6f16bf24dd64?cm_mmc=Email_Newsletter-_-Developer_Ed%2BTech-_-WW_WW-_-SkillsNetwork-Courses-IBMDeveloperSkillsNetwork-ML0101EN-SkillsNetwork-20718538&cm_mmca1=000026UJ&cm_mmca2=10006555&cm_mmca3=M12345678&cvosrc=email.Newsletter.M12345678&cvo_campaign=000026UJ&cm_mmc=Email_Newsletter-_-Developer_Ed%2BTech-_-WW_WW-_-SkillsNetwork-Courses-IBMDeveloperSkillsNetwork-ML0101EN-SkillsNetwork-20718538&cm_mmca1=000026UJ&cm_mmca2=10006555&cm_mmca3=M12345678&cvosrc=email.Newsletter.M12345678&cvo_campaign=000026UJ&cm_mmc=Email_Newsletter-_-Developer_Ed%2BTech-_-WW_WW-_-SkillsNetwork-Courses-IBMDeveloperSkillsNetwork-ML0101EN-SkillsNetwork-20718538&cm_mmca1=000026UJ&cm_mmca2=10006555&cm_mmca3=M12345678&cvosrc=email.Newsletter.M12345678&cvo_campaign=000026UJ&cm_mmc=Email_Newsletter-_-Developer_Ed%2BTech-_-WW_WW-_-SkillsNetwork-Courses-IBMDeveloperSkillsNetwork-ML0101EN-SkillsNetwork-20718538&cm_mmca1=000026UJ&cm_mmca2=10006555&cm_mmca3=M12345678&cvosrc=email.Newsletter.M12345678&cvo_campaign=000026UJ)\n", | |
"\n", | |
"- **MODELYEAR** e.g. 2014\n", | |
"- **MAKE** e.g. Acura\n", | |
"- **MODEL** e.g. ILX\n", | |
"- **VEHICLE CLASS** e.g. SUV\n", | |
"- **ENGINE SIZE** e.g. 4.7\n", | |
"- **CYLINDERS** e.g 6\n", | |
"- **TRANSMISSION** e.g. A6\n", | |
"- **FUELTYPE** e.g. z\n", | |
"- **FUEL CONSUMPTION in CITY(L/100 km)** e.g. 9.9\n", | |
"- **FUEL CONSUMPTION in HWY (L/100 km)** e.g. 8.9\n", | |
"- **FUEL CONSUMPTION COMB (L/100 km)** e.g. 9.2\n", | |
"- **CO2 EMISSIONS (g/km)** e.g. 182 --> low --> 0\n" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"button": false, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"source": [ | |
"<h2 id=\"reading_data\">Reading the data in</h2>\n" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 4, | |
"metadata": { | |
"button": false, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"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>MODELYEAR</th>\n", | |
" <th>MAKE</th>\n", | |
" <th>MODEL</th>\n", | |
" <th>VEHICLECLASS</th>\n", | |
" <th>ENGINESIZE</th>\n", | |
" <th>CYLINDERS</th>\n", | |
" <th>TRANSMISSION</th>\n", | |
" <th>FUELTYPE</th>\n", | |
" <th>FUELCONSUMPTION_CITY</th>\n", | |
" <th>FUELCONSUMPTION_HWY</th>\n", | |
" <th>FUELCONSUMPTION_COMB</th>\n", | |
" <th>FUELCONSUMPTION_COMB_MPG</th>\n", | |
" <th>CO2EMISSIONS</th>\n", | |
" </tr>\n", | |
" </thead>\n", | |
" <tbody>\n", | |
" <tr>\n", | |
" <th>0</th>\n", | |
" <td>2014</td>\n", | |
" <td>ACURA</td>\n", | |
" <td>ILX</td>\n", | |
" <td>COMPACT</td>\n", | |
" <td>2.0</td>\n", | |
" <td>4</td>\n", | |
" <td>AS5</td>\n", | |
" <td>Z</td>\n", | |
" <td>9.9</td>\n", | |
" <td>6.7</td>\n", | |
" <td>8.5</td>\n", | |
" <td>33</td>\n", | |
" <td>196</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>1</th>\n", | |
" <td>2014</td>\n", | |
" <td>ACURA</td>\n", | |
" <td>ILX</td>\n", | |
" <td>COMPACT</td>\n", | |
" <td>2.4</td>\n", | |
" <td>4</td>\n", | |
" <td>M6</td>\n", | |
" <td>Z</td>\n", | |
" <td>11.2</td>\n", | |
" <td>7.7</td>\n", | |
" <td>9.6</td>\n", | |
" <td>29</td>\n", | |
" <td>221</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>2</th>\n", | |
" <td>2014</td>\n", | |
" <td>ACURA</td>\n", | |
" <td>ILX HYBRID</td>\n", | |
" <td>COMPACT</td>\n", | |
" <td>1.5</td>\n", | |
" <td>4</td>\n", | |
" <td>AV7</td>\n", | |
" <td>Z</td>\n", | |
" <td>6.0</td>\n", | |
" <td>5.8</td>\n", | |
" <td>5.9</td>\n", | |
" <td>48</td>\n", | |
" <td>136</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>3</th>\n", | |
" <td>2014</td>\n", | |
" <td>ACURA</td>\n", | |
" <td>MDX 4WD</td>\n", | |
" <td>SUV - SMALL</td>\n", | |
" <td>3.5</td>\n", | |
" <td>6</td>\n", | |
" <td>AS6</td>\n", | |
" <td>Z</td>\n", | |
" <td>12.7</td>\n", | |
" <td>9.1</td>\n", | |
" <td>11.1</td>\n", | |
" <td>25</td>\n", | |
" <td>255</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>4</th>\n", | |
" <td>2014</td>\n", | |
" <td>ACURA</td>\n", | |
" <td>RDX AWD</td>\n", | |
" <td>SUV - SMALL</td>\n", | |
" <td>3.5</td>\n", | |
" <td>6</td>\n", | |
" <td>AS6</td>\n", | |
" <td>Z</td>\n", | |
" <td>12.1</td>\n", | |
" <td>8.7</td>\n", | |
" <td>10.6</td>\n", | |
" <td>27</td>\n", | |
" <td>244</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>5</th>\n", | |
" <td>2014</td>\n", | |
" <td>ACURA</td>\n", | |
" <td>RLX</td>\n", | |
" <td>MID-SIZE</td>\n", | |
" <td>3.5</td>\n", | |
" <td>6</td>\n", | |
" <td>AS6</td>\n", | |
" <td>Z</td>\n", | |
" <td>11.9</td>\n", | |
" <td>7.7</td>\n", | |
" <td>10.0</td>\n", | |
" <td>28</td>\n", | |
" <td>230</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>6</th>\n", | |
" <td>2014</td>\n", | |
" <td>ACURA</td>\n", | |
" <td>TL</td>\n", | |
" <td>MID-SIZE</td>\n", | |
" <td>3.5</td>\n", | |
" <td>6</td>\n", | |
" <td>AS6</td>\n", | |
" <td>Z</td>\n", | |
" <td>11.8</td>\n", | |
" <td>8.1</td>\n", | |
" <td>10.1</td>\n", | |
" <td>28</td>\n", | |
" <td>232</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>7</th>\n", | |
" <td>2014</td>\n", | |
" <td>ACURA</td>\n", | |
" <td>TL AWD</td>\n", | |
" <td>MID-SIZE</td>\n", | |
" <td>3.7</td>\n", | |
" <td>6</td>\n", | |
" <td>AS6</td>\n", | |
" <td>Z</td>\n", | |
" <td>12.8</td>\n", | |
" <td>9.0</td>\n", | |
" <td>11.1</td>\n", | |
" <td>25</td>\n", | |
" <td>255</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>8</th>\n", | |
" <td>2014</td>\n", | |
" <td>ACURA</td>\n", | |
" <td>TL AWD</td>\n", | |
" <td>MID-SIZE</td>\n", | |
" <td>3.7</td>\n", | |
" <td>6</td>\n", | |
" <td>M6</td>\n", | |
" <td>Z</td>\n", | |
" <td>13.4</td>\n", | |
" <td>9.5</td>\n", | |
" <td>11.6</td>\n", | |
" <td>24</td>\n", | |
" <td>267</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>9</th>\n", | |
" <td>2014</td>\n", | |
" <td>ACURA</td>\n", | |
" <td>TSX</td>\n", | |
" <td>COMPACT</td>\n", | |
" <td>2.4</td>\n", | |
" <td>4</td>\n", | |
" <td>AS5</td>\n", | |
" <td>Z</td>\n", | |
" <td>10.6</td>\n", | |
" <td>7.5</td>\n", | |
" <td>9.2</td>\n", | |
" <td>31</td>\n", | |
" <td>212</td>\n", | |
" </tr>\n", | |
" </tbody>\n", | |
"</table>\n", | |
"</div>" | |
], | |
"text/plain": [ | |
" MODELYEAR MAKE MODEL VEHICLECLASS ENGINESIZE CYLINDERS \\\n", | |
"0 2014 ACURA ILX COMPACT 2.0 4 \n", | |
"1 2014 ACURA ILX COMPACT 2.4 4 \n", | |
"2 2014 ACURA ILX HYBRID COMPACT 1.5 4 \n", | |
"3 2014 ACURA MDX 4WD SUV - SMALL 3.5 6 \n", | |
"4 2014 ACURA RDX AWD SUV - SMALL 3.5 6 \n", | |
"5 2014 ACURA RLX MID-SIZE 3.5 6 \n", | |
"6 2014 ACURA TL MID-SIZE 3.5 6 \n", | |
"7 2014 ACURA TL AWD MID-SIZE 3.7 6 \n", | |
"8 2014 ACURA TL AWD MID-SIZE 3.7 6 \n", | |
"9 2014 ACURA TSX COMPACT 2.4 4 \n", | |
"\n", | |
" TRANSMISSION FUELTYPE FUELCONSUMPTION_CITY FUELCONSUMPTION_HWY \\\n", | |
"0 AS5 Z 9.9 6.7 \n", | |
"1 M6 Z 11.2 7.7 \n", | |
"2 AV7 Z 6.0 5.8 \n", | |
"3 AS6 Z 12.7 9.1 \n", | |
"4 AS6 Z 12.1 8.7 \n", | |
"5 AS6 Z 11.9 7.7 \n", | |
"6 AS6 Z 11.8 8.1 \n", | |
"7 AS6 Z 12.8 9.0 \n", | |
"8 M6 Z 13.4 9.5 \n", | |
"9 AS5 Z 10.6 7.5 \n", | |
"\n", | |
" FUELCONSUMPTION_COMB FUELCONSUMPTION_COMB_MPG CO2EMISSIONS \n", | |
"0 8.5 33 196 \n", | |
"1 9.6 29 221 \n", | |
"2 5.9 48 136 \n", | |
"3 11.1 25 255 \n", | |
"4 10.6 27 244 \n", | |
"5 10.0 28 230 \n", | |
"6 10.1 28 232 \n", | |
"7 11.1 25 255 \n", | |
"8 11.6 24 267 \n", | |
"9 9.2 31 212 " | |
] | |
}, | |
"execution_count": 4, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"df = pd.read_csv(\"FuelConsumption.csv\")\n", | |
"\n", | |
"# take a look at the dataset\n", | |
"df.head(10)" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"Lets select some features that we want to use for regression.\n" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 5, | |
"metadata": { | |
"button": false, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"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>ENGINESIZE</th>\n", | |
" <th>CYLINDERS</th>\n", | |
" <th>FUELCONSUMPTION_CITY</th>\n", | |
" <th>FUELCONSUMPTION_HWY</th>\n", | |
" <th>FUELCONSUMPTION_COMB</th>\n", | |
" <th>CO2EMISSIONS</th>\n", | |
" </tr>\n", | |
" </thead>\n", | |
" <tbody>\n", | |
" <tr>\n", | |
" <th>0</th>\n", | |
" <td>2.0</td>\n", | |
" <td>4</td>\n", | |
" <td>9.9</td>\n", | |
" <td>6.7</td>\n", | |
" <td>8.5</td>\n", | |
" <td>196</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>1</th>\n", | |
" <td>2.4</td>\n", | |
" <td>4</td>\n", | |
" <td>11.2</td>\n", | |
" <td>7.7</td>\n", | |
" <td>9.6</td>\n", | |
" <td>221</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>2</th>\n", | |
" <td>1.5</td>\n", | |
" <td>4</td>\n", | |
" <td>6.0</td>\n", | |
" <td>5.8</td>\n", | |
" <td>5.9</td>\n", | |
" <td>136</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>3</th>\n", | |
" <td>3.5</td>\n", | |
" <td>6</td>\n", | |
" <td>12.7</td>\n", | |
" <td>9.1</td>\n", | |
" <td>11.1</td>\n", | |
" <td>255</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>4</th>\n", | |
" <td>3.5</td>\n", | |
" <td>6</td>\n", | |
" <td>12.1</td>\n", | |
" <td>8.7</td>\n", | |
" <td>10.6</td>\n", | |
" <td>244</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>5</th>\n", | |
" <td>3.5</td>\n", | |
" <td>6</td>\n", | |
" <td>11.9</td>\n", | |
" <td>7.7</td>\n", | |
" <td>10.0</td>\n", | |
" <td>230</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>6</th>\n", | |
" <td>3.5</td>\n", | |
" <td>6</td>\n", | |
" <td>11.8</td>\n", | |
" <td>8.1</td>\n", | |
" <td>10.1</td>\n", | |
" <td>232</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>7</th>\n", | |
" <td>3.7</td>\n", | |
" <td>6</td>\n", | |
" <td>12.8</td>\n", | |
" <td>9.0</td>\n", | |
" <td>11.1</td>\n", | |
" <td>255</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>8</th>\n", | |
" <td>3.7</td>\n", | |
" <td>6</td>\n", | |
" <td>13.4</td>\n", | |
" <td>9.5</td>\n", | |
" <td>11.6</td>\n", | |
" <td>267</td>\n", | |
" </tr>\n", | |
" </tbody>\n", | |
"</table>\n", | |
"</div>" | |
], | |
"text/plain": [ | |
" ENGINESIZE CYLINDERS FUELCONSUMPTION_CITY FUELCONSUMPTION_HWY \\\n", | |
"0 2.0 4 9.9 6.7 \n", | |
"1 2.4 4 11.2 7.7 \n", | |
"2 1.5 4 6.0 5.8 \n", | |
"3 3.5 6 12.7 9.1 \n", | |
"4 3.5 6 12.1 8.7 \n", | |
"5 3.5 6 11.9 7.7 \n", | |
"6 3.5 6 11.8 8.1 \n", | |
"7 3.7 6 12.8 9.0 \n", | |
"8 3.7 6 13.4 9.5 \n", | |
"\n", | |
" FUELCONSUMPTION_COMB CO2EMISSIONS \n", | |
"0 8.5 196 \n", | |
"1 9.6 221 \n", | |
"2 5.9 136 \n", | |
"3 11.1 255 \n", | |
"4 10.6 244 \n", | |
"5 10.0 230 \n", | |
"6 10.1 232 \n", | |
"7 11.1 255 \n", | |
"8 11.6 267 " | |
] | |
}, | |
"execution_count": 5, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"cdf = df[['ENGINESIZE','CYLINDERS','FUELCONSUMPTION_CITY','FUELCONSUMPTION_HWY','FUELCONSUMPTION_COMB','CO2EMISSIONS']]\n", | |
"cdf.head(9)" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"Lets plot Emission values with respect to Engine size:\n" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 6, | |
"metadata": { | |
"button": false, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
}, | |
"scrolled": true | |
}, | |
"outputs": [ | |
{ | |
"data": { | |
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAYUAAAEHCAYAAABBW1qbAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuNCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8QVMy6AAAACXBIWXMAAAsTAAALEwEAmpwYAAAwDElEQVR4nO2df5xddXnn389MJiGTqMAksoGQGUqBdmItypTWTX+gAbHRF2i3unFHzUt9NZjQFu36smazW7XddNnWttLdJjYVJJqpLFvtyotSlERtV0ulAQFJkCUuCQSykIA/QBBI8uwf59yZM3fOuefHPeeeO3c+79fr+7r3fs/5nvPcm8z3Od/neb7PY+6OEEIIAdBXtwBCCCG6BykFIYQQk0gpCCGEmERKQQghxCRSCkIIISaRUhBCCDHJvCovbmYHgKeB48Axdx8zs1OB/wGMAAeAt7n798LzNwHvDc//bXf/UqvrL1myxEdGRqoSXwghepI777zzqLsvjTtWqVIIea27H418/jCw292vNrMPh59/18xGgbXASuB0YJeZnevux5MuPDIywp49e6qUXQgheg4zO5h0rA7z0eXAjvD9DuDNkf4b3P15d38I2A9c2HnxhBBi7lK1UnDgy2Z2p5mtD/tOc/fDAOHry8P+M4BHImMPhX1CCCE6RNXmo1Xu/piZvRy4zcy+0+Jci+mbkYMjVC7rAVasWFGOlEIIIYCKVwru/lj4+gTwtwTmoMfNbBlA+PpEePoh4MzI8OXAYzHX3O7uY+4+tnRprJ9ECCFEQSpTCma2yMxe0ngPvB64D7gJWBeetg74Yvj+JmC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myiq8LcVf8N+HV3vwC4DtgSM/b3gEvd/WcJkrhNw93XhEkH3wscBP5X+P4H7v5zwM8Bv2FmZ2X8DYRoyby6BRCigzwXTrBxNNIi3An8Wvj+F4G3ALj7rWb2vYSxd7j7IYAwlfgI8H3gFcBt4cKhnyBVcjPfAK4Pi63EpmYIVyefBd7m7j8ws9cDrzSzXw9PeRlwDvBQgnxCZEZKQYiA58PX40z9XVjOsdHxBux195YlK939fWb28wSFgO42s/Ojx8MKYjcAv+/ujSR5BvyWu38po3xCZEbmIyGS+TrwNoDw6fyUHGMfAJZaWMfYzAbMbGXzSWZ2trt/091/DzgKnNl0ytXAve5+Q6TvS8CG0ESFmZ3b5QVvxCxCKwUxl1gYmnca3OrurcJSPwZ8LvQ9/AOB+efpLDdy9xdC886fm9nLCP7WPgHsbTr1j83sHIKn/93APcCvRI5/ENgbkfv3CEqLjgB3hU7tI8Cbs8glRBoKSRUiATNbABx392PhE/+2Fj4JIXoCrRSESGYFcKOZ9QEvAL9RszxCVI5WCkIIISaRo1kIIcQkUgpCCCEmkVIQQggxiZSCEEKISaQUhBBCTCKlIIQQYpL/D/ZoRF15citXAAAAAElFTkSuQmCC\n", | |
"text/plain": [ | |
"<Figure size 432x288 with 1 Axes>" | |
] | |
}, | |
"metadata": { | |
"needs_background": "light" | |
}, | |
"output_type": "display_data" | |
} | |
], | |
"source": [ | |
"plt.scatter(cdf.ENGINESIZE, cdf.CO2EMISSIONS, color='blue')\n", | |
"plt.xlabel(\"Engine size\")\n", | |
"plt.ylabel(\"Emission\")\n", | |
"plt.show()" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"button": false, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"source": [ | |
"#### Creating train and test dataset\n", | |
"\n", | |
"Train/Test Split involves splitting the dataset into training and testing sets respectively, which are mutually exclusive. After which, you train with the training set and test with the testing set. \n", | |
"This will provide a more accurate evaluation on out-of-sample accuracy because the testing dataset is not part of the dataset that have been used to train the data. It is more realistic for real world problems.\n", | |
"\n", | |
"This means that we know the outcome of each data point in this dataset, making it great to test with! And since this data has not been used to train the model, the model has no knowledge of the outcome of these data points. So, in essence, it’s truly an out-of-sample testing.\n" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 7, | |
"metadata": { | |
"button": false, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"outputs": [], | |
"source": [ | |
"msk = np.random.rand(len(df)) < 0.8\n", | |
"train = cdf[msk]\n", | |
"test = cdf[~msk]" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"button": false, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"source": [ | |
"#### Train data distribution\n" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 8, | |
"metadata": { | |
"button": false, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"outputs": [ | |
{ | |
"data": { | |
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAYUAAAEHCAYAAABBW1qbAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuNCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8QVMy6AAAACXBIWXMAAAsTAAALEwEAmpwYAAAucklEQVR4nO3dfbRddX3n8ff33tyE3EQNhMgKhNzLYGonWBslpTrpg5ogFF2gnerEuToUaVMTWtGOyyEyU3XWpItla6udmVBSRe5Mbk0zakcWpVAIUGtrxYA8BWSIAwmRDAR8IqBAbr7zx97n3n3P3fvsh7P32eec+3mttdc553f23ud3LmR/z/49fH/m7oiIiAAM1F0BERHpHgoKIiIyRUFBRESmKCiIiMgUBQUREZmioCAiIlPmVXlyM3sMeBaYBI65+1ozOwn4K2AUeAx4t7v/INx/K3BpuP8H3f3mVuc/+eSTfXR0tKrqi4j0pbvuuutpd18W916lQSH0Znd/OvL6CmCPu19lZleEr/+Dma0GNgJnAacCt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YTmPjR5vwD53b7lkpbt/wMx+kWAhoHvMbE30/XAFsV3Af3b3RpI8A37P3W/OWD+RzNR8JJLs68C7AcJf5yfmOPZhYJmF6xib2ZCZndW8k5md6e7fdPc/AJ4GTm/a5SrgPnffFSm7GdgcNlFhZj/T5QveSA/RnYLMJQvD5p2Gm9y91bDUTwJfDPse/p6g+efZLB/k7i+GzTt/ZmavIPi39hlgX9Ouf2Rmqwh+/e8B7gV+NfL+R4B9kXr/AcHSoqPA3WGn9hHgHVnqJZJGQ1JFEpjZAmDS3Y+Fv/ivbtEnIdIXdKcgkmwlsNvMBoAXgd+uuT4ildOdgoiITFFHs4iITFFQEBGRKQoKIiIyRUFBRESmKCiIiMgUBQUREZny/wE/l3dA5FH4GwAAAABJRU5ErkJggg==\n", | |
"text/plain": [ | |
"<Figure size 432x288 with 1 Axes>" | |
] | |
}, | |
"metadata": { | |
"needs_background": "light" | |
}, | |
"output_type": "display_data" | |
} | |
], | |
"source": [ | |
"plt.scatter(train.ENGINESIZE, train.CO2EMISSIONS, color='blue')\n", | |
"plt.xlabel(\"Engine size\")\n", | |
"plt.ylabel(\"Emission\")\n", | |
"plt.show()" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"button": false, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"source": [ | |
"<h2 id=\"multiple_regression_model\">Multiple Regression Model</h2>\n" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"In reality, there are multiple variables that predict the Co2emission. When more than one independent variable is present, the process is called multiple linear regression. For example, predicting co2emission using FUELCONSUMPTION_COMB, EngineSize and Cylinders of cars. The good thing here is that Multiple linear regression is the extension of simple linear regression model.\n" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 9, | |
"metadata": { | |
"button": false, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"Coefficients: [[12.912973 5.98172475 9.57928464]]\n" | |
] | |
} | |
], | |
"source": [ | |
"from sklearn import linear_model\n", | |
"regr = linear_model.LinearRegression()\n", | |
"x = np.asanyarray(train[['ENGINESIZE','CYLINDERS','FUELCONSUMPTION_COMB']])\n", | |
"y = np.asanyarray(train[['CO2EMISSIONS']])\n", | |
"regr.fit (x, y)\n", | |
"# The coefficients\n", | |
"print ('Coefficients: ', regr.coef_)" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"As mentioned before, **Coefficient** and **Intercept** , are the parameters of the fit line. \n", | |
"Given that it is a multiple linear regression, with 3 parameters, and knowing that the parameters are the intercept and coefficients of hyperplane, sklearn can estimate them from our data. Scikit-learn uses plain Ordinary Least Squares method to solve this problem.\n", | |
"\n", | |
"#### Ordinary Least Squares (OLS)\n", | |
"\n", | |
"OLS is a method for estimating the unknown parameters in a linear regression model. OLS chooses the parameters of a linear function of a set of explanatory variables by minimizing the sum of the squares of the differences between the target dependent variable and those predicted by the linear function. In other words, it tries to minimizes the sum of squared errors (SSE) or mean squared error (MSE) between the target variable (y) and our predicted output ($\\hat{y}$) over all samples in the dataset.\n", | |
"\n", | |
"OLS can find the best parameters using of the following methods:\n", | |
"\n", | |
"```\n", | |
"- Solving the model parameters analytically using closed-form equations\n", | |
"- Using an optimization algorithm (Gradient Descent, Stochastic Gradient Descent, Newton’s Method, etc.)\n", | |
"```\n" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"<h2 id=\"prediction\">Prediction</h2>\n" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 10, | |
"metadata": { | |
"button": false, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"Residual sum of squares: 518.43\n", | |
"Variance score: 0.86\n" | |
] | |
} | |
], | |
"source": [ | |
"y_hat= regr.predict(test[['ENGINESIZE','CYLINDERS','FUELCONSUMPTION_COMB']])\n", | |
"x = np.asanyarray(test[['ENGINESIZE','CYLINDERS','FUELCONSUMPTION_COMB']])\n", | |
"y = np.asanyarray(test[['CO2EMISSIONS']])\n", | |
"print(\"Residual sum of squares: %.2f\"\n", | |
" % np.mean((y_hat - y) ** 2))\n", | |
"\n", | |
"# Explained variance score: 1 is perfect prediction\n", | |
"print('Variance score: %.2f' % regr.score(x, y))" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"**explained variance regression score:** \n", | |
"If $\\hat{y}$ is the estimated target output, y the corresponding (correct) target output, and Var is Variance, the square of the standard deviation, then the explained variance is estimated as follow:\n", | |
"\n", | |
"$\\texttt{explainedVariance}(y, \\hat{y}) = 1 - \\frac{Var{ y - \\hat{y}}}{Var{y}}$ \n", | |
"The best possible score is 1.0, lower values are worse.\n" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"<h2 id=\"practice\">Practice</h2>\n", | |
"Try to use a multiple linear regression with the same dataset but this time use __FUEL CONSUMPTION in CITY__ and \n", | |
"__FUEL CONSUMPTION in HWY__ instead of FUELCONSUMPTION_COMB. Does it result in better accuracy?\n" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 11, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"Coefficients: [[12.97014731 5.61728897 6.21008279 3.08693056]]\n", | |
"Residual sum of squares: 520.10\n", | |
"Variance score: 0.86\n" | |
] | |
} | |
], | |
"source": [ | |
"regr = linear_model.LinearRegression()\n", | |
"x = np.asanyarray(train[['ENGINESIZE','CYLINDERS','FUELCONSUMPTION_CITY','FUELCONSUMPTION_HWY']])\n", | |
"y = np.asanyarray(train[['CO2EMISSIONS']])\n", | |
"regr.fit (x, y)\n", | |
"# The coefficients\n", | |
"print ('Coefficients: ', regr.coef_)\n", | |
"y_hat= regr.predict(test[['ENGINESIZE','CYLINDERS','FUELCONSUMPTION_CITY','FUELCONSUMPTION_HWY']])\n", | |
"x = np.asanyarray(test[['ENGINESIZE','CYLINDERS','FUELCONSUMPTION_CITY','FUELCONSUMPTION_HWY']])\n", | |
"y = np.asanyarray(test[['CO2EMISSIONS']])\n", | |
"print(\"Residual sum of squares: %.2f\"\n", | |
" % np.mean((y_hat - y) ** 2))\n", | |
"\n", | |
"# Explained variance score: 1 is perfect prediction\n", | |
"print('Variance score: %.2f' % regr.score(x, y))" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"<details><summary>Click here for the solution</summary>\n", | |
"\n", | |
"```python\n", | |
"regr = linear_model.LinearRegression()\n", | |
"x = np.asanyarray(train[['ENGINESIZE','CYLINDERS','FUELCONSUMPTION_CITY','FUELCONSUMPTION_HWY']])\n", | |
"y = np.asanyarray(train[['CO2EMISSIONS']])\n", | |
"regr.fit (x, y)\n", | |
"print ('Coefficients: ', regr.coef_)\n", | |
"y_= regr.predict(test[['ENGINESIZE','CYLINDERS','FUELCONSUMPTION_CITY','FUELCONSUMPTION_HWY']])\n", | |
"x = np.asanyarray(test[['ENGINESIZE','CYLINDERS','FUELCONSUMPTION_CITY','FUELCONSUMPTION_HWY']])\n", | |
"y = np.asanyarray(test[['CO2EMISSIONS']])\n", | |
"print(\"Residual sum of squares: %.2f\"% np.mean((y_ - y) ** 2))\n", | |
"print('Variance score: %.2f' % regr.score(x, y))\n", | |
"\n", | |
"```\n", | |
"\n", | |
"</details>\n" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"button": false, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"source": [ | |
"<h2>Want to learn more?</h2>\n", | |
"\n", | |
"IBM SPSS Modeler is a comprehensive analytics platform that has many machine learning algorithms. It has been designed to bring predictive intelligence to decisions made by individuals, by groups, by systems – by your enterprise as a whole. A free trial is available through this course, available here: <a href=\"https://www.ibm.com/analytics/spss-statistics-software\">SPSS Modeler</a>\n", | |
"\n", | |
"Also, you can use Watson Studio to run these notebooks faster with bigger datasets. Watson Studio is IBM's leading cloud solution for data scientists, built by data scientists. With Jupyter notebooks, RStudio, Apache Spark and popular libraries pre-packaged in the cloud, Watson Studio enables data scientists to collaborate on their projects without having to install anything. Join the fast-growing community of Watson Studio users today with a free account at <a href=\"https://www.ibm.com/cloud/watson-studio\">Watson Studio</a>\n" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"### Thank you for completing this lab!\n", | |
"\n", | |
"## Author\n", | |
"\n", | |
"Saeed Aghabozorgi\n", | |
"\n", | |
"### Other Contributors\n", | |
"\n", | |
"<a href=\"https://www.linkedin.com/in/joseph-s-50398b136/\" target=\"_blank\">Joseph Santarcangelo</a>\n", | |
"\n", | |
"## Change Log\n", | |
"\n", | |
"| Date (YYYY-MM-DD) | Version | Changed By | Change Description |\n", | |
"| ----------------- | ------- | ---------- | ---------------------------------- |\n", | |
"| 2020-11-03 | 2.1 | Lakshmi | Made changes in URL |\n", | |
"| 2020-08-27 | 2.0 | Lavanya | Moved lab to course repo in GitLab |\n", | |
"| | | | |\n", | |
"| | | | |\n", | |
"\n", | |
"## <h3 align=\"center\"> © IBM Corporation 2020. All rights reserved. <h3/>\n" | |
] | |
} | |
], | |
"metadata": { | |
"kernelspec": { | |
"display_name": "Python", | |
"language": "python", | |
"name": "conda-env-python-py" | |
}, | |
"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.6.13" | |
}, | |
"widgets": { | |
"state": {}, | |
"version": "1.1.2" | |
} | |
}, | |
"nbformat": 4, | |
"nbformat_minor": 4 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment