Skip to content

Commit 438fbcf

Browse files
Created using Colaboratory
1 parent c7e616f commit 438fbcf

File tree

1 file changed

+42
-42
lines changed

1 file changed

+42
-42
lines changed

07_Simple_and_Multiple_Regression.ipynb

Lines changed: 42 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
"base_uri": "https://localhost:8080/",
3535
"height": 73
3636
},
37-
"outputId": "a3ee0a12-0104-4c4c-b4ae-58c4d1790fde"
37+
"outputId": "b942fff1-46a4-493e-fee0-55b910ae3173"
3838
},
3939
"source": [
4040
"# Libraries \n",
@@ -67,7 +67,7 @@
6767
"base_uri": "https://localhost:8080/",
6868
"height": 204
6969
},
70-
"outputId": "28170068-8b0a-41d0-c232-52ad620b6004"
70+
"outputId": "35052345-2dba-4323-a36a-1f0c33c64279"
7171
},
7272
"source": [
7373
"# Load the Datasets (For indepth analysis please refer to Part O1 All About Datasets)\n",
@@ -236,7 +236,7 @@
236236
"base_uri": "https://localhost:8080/",
237237
"height": 395
238238
},
239-
"outputId": "c0ba3c2a-5d1b-4fcd-b45b-345f8ab0f690"
239+
"outputId": "e3a6efdc-4e96-41de-86ad-50ccabb17b41"
240240
},
241241
"source": [
242242
"# Dataset overall Information\n",
@@ -282,7 +282,7 @@
282282
"base_uri": "https://localhost:8080/",
283283
"height": 107
284284
},
285-
"outputId": "5d67a37d-833e-4520-e101-ad5403a54b30"
285+
"outputId": "349a9591-0a95-4e8a-a892-bad733ee880e"
286286
},
287287
"source": [
288288
"# Let set the BASE MODEL on which we will improve\n",
@@ -318,7 +318,7 @@
318318
"base_uri": "https://localhost:8080/",
319319
"height": 688
320320
},
321-
"outputId": "625eb866-7bfd-4aec-e722-d6b968cc4d0a"
321+
"outputId": "864677de-26f1-4b44-cbf5-d665de057d4f"
322322
},
323323
"source": [
324324
"# Base Model\n",
@@ -349,7 +349,7 @@
349349
" <th>Date:</th> <td>Wed, 02 Sep 2020</td> <th> Prob (F-statistic):</th> <td>2.38e-320</td>\n",
350350
"</tr>\n",
351351
"<tr>\n",
352-
" <th>Time:</th> <td>11:15:35</td> <th> Log-Likelihood: </th> <td> -1556.1</td> \n",
352+
" <th>Time:</th> <td>11:18:47</td> <th> Log-Likelihood: </th> <td> -1556.1</td> \n",
353353
"</tr>\n",
354354
"<tr>\n",
355355
" <th>No. Observations:</th> <td> 506</td> <th> AIC: </th> <td> 3136.</td> \n",
@@ -429,7 +429,7 @@
429429
"Model: OLS Adj. R-squared (uncentered): 0.953\n",
430430
"Method: Least Squares F-statistic: 846.6\n",
431431
"Date: Wed, 02 Sep 2020 Prob (F-statistic): 2.38e-320\n",
432-
"Time: 11:15:35 Log-Likelihood: -1556.1\n",
432+
"Time: 11:18:47 Log-Likelihood: -1556.1\n",
433433
"No. Observations: 506 AIC: 3136.\n",
434434
"Df Residuals: 494 BIC: 3187.\n",
435435
"Df Model: 12 \n",
@@ -479,7 +479,7 @@
479479
"base_uri": "https://localhost:8080/",
480480
"height": 755
481481
},
482-
"outputId": "a909a773-e369-40bf-edad-6c72f05aa72b"
482+
"outputId": "60b78f0e-9956-4d18-b995-b5a0882a5d58"
483483
},
484484
"source": [
485485
"# Model Properties\n",
@@ -667,7 +667,7 @@
667667
"base_uri": "https://localhost:8080/",
668668
"height": 89
669669
},
670-
"outputId": "1c03ab7c-c0fe-48f9-ab84-b87a2dd2dc55"
670+
"outputId": "76569343-32db-4b52-9b67-33305321afc4"
671671
},
672672
"source": [
673673
"# Let test the Base Model\n",
@@ -703,7 +703,7 @@
703703
"base_uri": "https://localhost:8080/",
704704
"height": 688
705705
},
706-
"outputId": "29556eda-af03-43fc-e4c9-577b78a47df1"
706+
"outputId": "d1d85ad3-f047-48d1-ebab-f923ec7febaa"
707707
},
708708
"source": [
709709
"# Base Model\n",
@@ -731,7 +731,7 @@
731731
" <th>Date:</th> <td>Wed, 02 Sep 2020</td> <th> Prob (F-statistic):</th> <td>1.06e-223</td>\n",
732732
"</tr>\n",
733733
"<tr>\n",
734-
" <th>Time:</th> <td>11:15:35</td> <th> Log-Likelihood: </th> <td> -1078.0</td> \n",
734+
" <th>Time:</th> <td>11:18:48</td> <th> Log-Likelihood: </th> <td> -1078.0</td> \n",
735735
"</tr>\n",
736736
"<tr>\n",
737737
" <th>No. Observations:</th> <td> 354</td> <th> AIC: </th> <td> 2180.</td> \n",
@@ -811,7 +811,7 @@
811811
"Model: OLS Adj. R-squared (uncentered): 0.954\n",
812812
"Method: Least Squares F-statistic: 619.5\n",
813813
"Date: Wed, 02 Sep 2020 Prob (F-statistic): 1.06e-223\n",
814-
"Time: 11:15:35 Log-Likelihood: -1078.0\n",
814+
"Time: 11:18:48 Log-Likelihood: -1078.0\n",
815815
"No. Observations: 354 AIC: 2180.\n",
816816
"Df Residuals: 342 BIC: 2226.\n",
817817
"Df Model: 12 \n",
@@ -861,7 +861,7 @@
861861
"base_uri": "https://localhost:8080/",
862862
"height": 89
863863
},
864-
"outputId": "14e5ec3d-d30a-4dde-f243-697d9b857e6b"
864+
"outputId": "7e5f7f5c-c2b6-4044-e3df-bfb5c09fe978"
865865
},
866866
"source": [
867867
"# Base Model Test and Metrics\n",
@@ -910,7 +910,7 @@
910910
"base_uri": "https://localhost:8080/",
911911
"height": 668
912912
},
913-
"outputId": "5948c239-5cc0-4c5a-d270-ae4b03535302"
913+
"outputId": "72050626-3b7d-484b-b626-c24febbd8ff6"
914914
},
915915
"source": [
916916
"# Model 2, let do some data cleaning\n",
@@ -930,7 +930,7 @@
930930
"output_type": "execute_result",
931931
"data": {
932932
"text/plain": [
933-
"<matplotlib.axes._subplots.AxesSubplot at 0x7fc1a2aacef0>"
933+
"<matplotlib.axes._subplots.AxesSubplot at 0x7fa4ec497eb8>"
934934
]
935935
},
936936
"metadata": {
@@ -962,7 +962,7 @@
962962
"base_uri": "https://localhost:8080/",
963963
"height": 421
964964
},
965-
"outputId": "a5d701eb-ab8c-4b3f-e649-ce78d8d5099e"
965+
"outputId": "393561f7-f1eb-4b04-ac15-27e05e88db26"
966966
},
967967
"source": [
968968
"# Filtering Highly Positive or Negative Correlated Values\n",
@@ -1228,7 +1228,7 @@
12281228
"base_uri": "https://localhost:8080/",
12291229
"height": 89
12301230
},
1231-
"outputId": "80b3e50b-abb0-4d11-c254-b1a7bb73e7ad"
1231+
"outputId": "58adb35d-61b0-4d33-d4f6-fffdfe530224"
12321232
},
12331233
"source": [
12341234
"# Find index of feature columns with correlation greater than 0.75\n",
@@ -1304,7 +1304,7 @@
13041304
"base_uri": "https://localhost:8080/",
13051305
"height": 517
13061306
},
1307-
"outputId": "a9a4751a-d915-4276-f53d-7fd6c6ff014e"
1307+
"outputId": "3be53026-e6b3-4f46-a6d6-ee74b7a8546e"
13081308
},
13091309
"source": [
13101310
"# Now check Outlier in the data\n",
@@ -1365,7 +1365,7 @@
13651365
"base_uri": "https://localhost:8080/",
13661366
"height": 535
13671367
},
1368-
"outputId": "efc04a52-9e44-4af5-ddfe-1161bfeedfe1"
1368+
"outputId": "cf78a8dc-8237-40c4-b64f-e817e009a684"
13691369
},
13701370
"source": [
13711371
"# ZN Column\n",
@@ -1403,7 +1403,7 @@
14031403
"output_type": "execute_result",
14041404
"data": {
14051405
"text/plain": [
1406-
"<matplotlib.axes._subplots.AxesSubplot at 0x7fc1a2aac780>"
1406+
"<matplotlib.axes._subplots.AxesSubplot at 0x7fa4e7320080>"
14071407
]
14081408
},
14091409
"metadata": {
@@ -1435,7 +1435,7 @@
14351435
"base_uri": "https://localhost:8080/",
14361436
"height": 535
14371437
},
1438-
"outputId": "c9505075-8b9a-40d6-b26b-088afe6a838b"
1438+
"outputId": "49ff2c16-77f8-462b-9beb-6dd165edcb63"
14391439
},
14401440
"source": [
14411441
"# CRIM Column\n",
@@ -1472,7 +1472,7 @@
14721472
"output_type": "execute_result",
14731473
"data": {
14741474
"text/plain": [
1475-
"<matplotlib.axes._subplots.AxesSubplot at 0x7fc19f604fd0>"
1475+
"<matplotlib.axes._subplots.AxesSubplot at 0x7fa4e72acba8>"
14761476
]
14771477
},
14781478
"metadata": {
@@ -1504,7 +1504,7 @@
15041504
"base_uri": "https://localhost:8080/",
15051505
"height": 517
15061506
},
1507-
"outputId": "912f850a-3176-47fb-e4fe-a889b62be5c3"
1507+
"outputId": "29fcab85-2354-4406-8497-89ee77dc4fe1"
15081508
},
15091509
"source": [
15101510
"# CHAS Column\n",
@@ -1563,7 +1563,7 @@
15631563
"base_uri": "https://localhost:8080/",
15641564
"height": 535
15651565
},
1566-
"outputId": "a2c2de83-cf0c-4871-c589-f2c180d05ac2"
1566+
"outputId": "46ae1502-1750-4dfd-d2f0-faca0788c0b5"
15671567
},
15681568
"source": [
15691569
"# AGE Column \n",
@@ -1600,7 +1600,7 @@
16001600
"output_type": "execute_result",
16011601
"data": {
16021602
"text/plain": [
1603-
"<matplotlib.axes._subplots.AxesSubplot at 0x7fc19d80a860>"
1603+
"<matplotlib.axes._subplots.AxesSubplot at 0x7fa4e71f9fd0>"
16041604
]
16051605
},
16061606
"metadata": {
@@ -1632,7 +1632,7 @@
16321632
"base_uri": "https://localhost:8080/",
16331633
"height": 517
16341634
},
1635-
"outputId": "f2f76a7c-e752-4c57-e572-a5173ec04a56"
1635+
"outputId": "408fe42d-abb0-4361-b60e-10fd52f0b156"
16361636
},
16371637
"source": [
16381638
"# DIS Column\n",
@@ -1691,7 +1691,7 @@
16911691
"base_uri": "https://localhost:8080/",
16921692
"height": 535
16931693
},
1694-
"outputId": "34d2f9a5-fff0-4d19-914f-66d4e8994e2e"
1694+
"outputId": "051626d0-b0bc-40cd-d446-6bc8e53d4da5"
16951695
},
16961696
"source": [
16971697
"# RAD Column \n",
@@ -1728,7 +1728,7 @@
17281728
"output_type": "execute_result",
17291729
"data": {
17301730
"text/plain": [
1731-
"<matplotlib.axes._subplots.AxesSubplot at 0x7fc19d76a4a8>"
1731+
"<matplotlib.axes._subplots.AxesSubplot at 0x7fa4e71599e8>"
17321732
]
17331733
},
17341734
"metadata": {
@@ -1760,7 +1760,7 @@
17601760
"base_uri": "https://localhost:8080/",
17611761
"height": 517
17621762
},
1763-
"outputId": "86733563-e5c5-4ec4-88ef-844ba5cec7a6"
1763+
"outputId": "24bc009c-15cd-4fbd-9b6d-3ba75ce51561"
17641764
},
17651765
"source": [
17661766
"# B Column\n",
@@ -1819,7 +1819,7 @@
18191819
"base_uri": "https://localhost:8080/",
18201820
"height": 266
18211821
},
1822-
"outputId": "5c5e6409-3cc3-4108-d3f1-0561b3f19b48"
1822+
"outputId": "21451197-0d54-4fe3-aab1-7b42ef5e6cd3"
18231823
},
18241824
"source": [
18251825
"# Lets check Skewness in the Data\n",
@@ -1919,7 +1919,7 @@
19191919
"base_uri": "https://localhost:8080/",
19201920
"height": 143
19211921
},
1922-
"outputId": "b271b85d-1eac-4be1-93f3-c6b71cb21f24"
1922+
"outputId": "45014745-cddc-4761-b371-47b455fe4a58"
19231923
},
19241924
"source": [
19251925
"# Lets remove Skewness one by one\n",
@@ -1974,7 +1974,7 @@
19741974
"base_uri": "https://localhost:8080/",
19751975
"height": 181
19761976
},
1977-
"outputId": "d788a1e6-5981-458e-8502-1c5b7c68be15"
1977+
"outputId": "81cf6594-e560-4da9-cbc8-916dbb421812"
19781978
},
19791979
"source": [
19801980
"# ZN Variable\n",
@@ -2030,7 +2030,7 @@
20302030
"base_uri": "https://localhost:8080/",
20312031
"height": 143
20322032
},
2033-
"outputId": "361702f4-29b1-431f-947a-c3ccadcc5053"
2033+
"outputId": "bbc21ebe-22e3-4f62-d8cf-f3f2a18968cd"
20342034
},
20352035
"source": [
20362036
"# B Variable\n",
@@ -2084,7 +2084,7 @@
20842084
"base_uri": "https://localhost:8080/",
20852085
"height": 204
20862086
},
2087-
"outputId": "0e3a12f1-f55e-4c9e-c511-0dd0aac61f36"
2087+
"outputId": "0d27725b-4371-4ab9-ea94-617c90ef6169"
20882088
},
20892089
"source": [
20902090
"# Removing variables (raw variables) which are transformed and keep one set also (no removing)\n",
@@ -2210,7 +2210,7 @@
22102210
"base_uri": "https://localhost:8080/",
22112211
"height": 549
22122212
},
2213-
"outputId": "9c382304-e0b3-4d83-9a65-3dffe61fed16"
2213+
"outputId": "ed95ef32-583d-4138-caa0-32296fba66d7"
22142214
},
22152215
"source": [
22162216
"# Now lets train the model\n",
@@ -2253,7 +2253,7 @@
22532253
" <th>Date:</th> <td>Wed, 02 Sep 2020</td> <th> Prob (F-statistic):</th> <td>8.87e-181</td>\n",
22542254
"</tr>\n",
22552255
"<tr>\n",
2256-
" <th>Time:</th> <td>11:15:38</td> <th> Log-Likelihood: </th> <td> -1196.2</td> \n",
2256+
" <th>Time:</th> <td>11:18:51</td> <th> Log-Likelihood: </th> <td> -1196.2</td> \n",
22572257
"</tr>\n",
22582258
"<tr>\n",
22592259
" <th>No. Observations:</th> <td> 354</td> <th> AIC: </th> <td> 2406.</td> \n",
@@ -2318,7 +2318,7 @@
23182318
"Model: OLS Adj. R-squared (uncentered): 0.912\n",
23192319
"Method: Least Squares F-statistic: 528.2\n",
23202320
"Date: Wed, 02 Sep 2020 Prob (F-statistic): 8.87e-181\n",
2321-
"Time: 11:15:38 Log-Likelihood: -1196.2\n",
2321+
"Time: 11:18:51 Log-Likelihood: -1196.2\n",
23222322
"No. Observations: 354 AIC: 2406.\n",
23232323
"Df Residuals: 347 BIC: 2434.\n",
23242324
"Df Model: 7 \n",
@@ -2361,7 +2361,7 @@
23612361
"base_uri": "https://localhost:8080/",
23622362
"height": 89
23632363
},
2364-
"outputId": "7722cf1c-6236-4b70-867e-46acdff4de25"
2364+
"outputId": "62c653ac-c601-4e2c-8350-b787e4c009d3"
23652365
},
23662366
"source": [
23672367
"# Prediction of Model 2 \n",
@@ -2397,7 +2397,7 @@
23972397
"base_uri": "https://localhost:8080/",
23982398
"height": 507
23992399
},
2400-
"outputId": "4b45c80b-7cc1-4260-8a9f-8b51107ea8f9"
2400+
"outputId": "ab66b478-3e63-406d-bcd5-0b958375ff33"
24012401
},
24022402
"source": [
24032403
"# Model 3\n",
@@ -2443,7 +2443,7 @@
24432443
" <th>Date:</th> <td>Wed, 02 Sep 2020</td> <th> Prob (F-statistic):</th> <td>5.60e-182</td>\n",
24442444
"</tr>\n",
24452445
"<tr>\n",
2446-
" <th>Time:</th> <td>11:15:38</td> <th> Log-Likelihood: </th> <td> -1200.1</td> \n",
2446+
" <th>Time:</th> <td>11:18:51</td> <th> Log-Likelihood: </th> <td> -1200.1</td> \n",
24472447
"</tr>\n",
24482448
"<tr>\n",
24492449
" <th>No. Observations:</th> <td> 354</td> <th> AIC: </th> <td> 2410.</td> \n",
@@ -2502,7 +2502,7 @@
25022502
"Model: OLS Adj. R-squared (uncentered): 0.911\n",
25032503
"Method: Least Squares F-statistic: 726.0\n",
25042504
"Date: Wed, 02 Sep 2020 Prob (F-statistic): 5.60e-182\n",
2505-
"Time: 11:15:38 Log-Likelihood: -1200.1\n",
2505+
"Time: 11:18:51 Log-Likelihood: -1200.1\n",
25062506
"No. Observations: 354 AIC: 2410.\n",
25072507
"Df Residuals: 349 BIC: 2430.\n",
25082508
"Df Model: 5 \n",
@@ -2543,7 +2543,7 @@
25432543
"base_uri": "https://localhost:8080/",
25442544
"height": 89
25452545
},
2546-
"outputId": "d230f68a-87e8-40ac-e5d8-4a2e487d5802"
2546+
"outputId": "92f764cc-3387-4a8f-c22d-dea8f934f75e"
25472547
},
25482548
"source": [
25492549
"# Prediction of Model 3\n",

0 commit comments

Comments
 (0)