Skip to content

Commit f2f6e50

Browse files
committed
final
1 parent 528ebe2 commit f2f6e50

File tree

1 file changed

+19
-20
lines changed

1 file changed

+19
-20
lines changed

Energy demand prediction using machine learning.ipynb

+19-20
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,14 @@
5252
},
5353
{
5454
"cell_type": "code",
55-
"execution_count": 72,
55+
"execution_count": 87,
5656
"metadata": {},
5757
"outputs": [],
5858
"source": [
5959
"# Importing libraries\n",
6060
"import pandas as pd\n",
6161
"import numpy as np\n",
6262
"import matplotlib.pyplot as plt\n",
63-
"from sklearn.model_selection import train_test_split\n",
6463
"from sklearn.ensemble import RandomForestRegressor\n",
6564
"from sklearn.metrics import mean_absolute_error, mean_squared_error, mean_absolute_percentage_error\n",
6665
"from sklearn.preprocessing import StandardScaler\n",
@@ -69,7 +68,7 @@
6968
},
7069
{
7170
"cell_type": "code",
72-
"execution_count": 73,
71+
"execution_count": 88,
7372
"metadata": {},
7473
"outputs": [
7574
{
@@ -313,7 +312,7 @@
313312
"[1000 rows x 10 columns]"
314313
]
315314
},
316-
"execution_count": 73,
315+
"execution_count": 88,
317316
"metadata": {},
318317
"output_type": "execute_result"
319318
}
@@ -327,7 +326,7 @@
327326
},
328327
{
329328
"cell_type": "code",
330-
"execution_count": 74,
329+
"execution_count": 89,
331330
"metadata": {},
332331
"outputs": [
333332
{
@@ -391,7 +390,7 @@
391390
},
392391
{
393392
"cell_type": "code",
394-
"execution_count": 75,
393+
"execution_count": 90,
395394
"metadata": {},
396395
"outputs": [
397396
{
@@ -422,7 +421,7 @@
422421
},
423422
{
424423
"cell_type": "code",
425-
"execution_count": 76,
424+
"execution_count": 91,
426425
"metadata": {},
427426
"outputs": [
428427
{
@@ -567,7 +566,7 @@
567566
"2022-01-01 04:00:00 0 70.811732 "
568567
]
569568
},
570-
"execution_count": 76,
569+
"execution_count": 91,
571570
"metadata": {},
572571
"output_type": "execute_result"
573572
}
@@ -585,7 +584,7 @@
585584
},
586585
{
587586
"cell_type": "code",
588-
"execution_count": 77,
587+
"execution_count": 92,
589588
"metadata": {},
590589
"outputs": [
591590
{
@@ -816,7 +815,7 @@
816815
"[1000 rows x 9 columns]"
817816
]
818817
},
819-
"execution_count": 77,
818+
"execution_count": 92,
820819
"metadata": {},
821820
"output_type": "execute_result"
822821
}
@@ -830,7 +829,7 @@
830829
},
831830
{
832831
"cell_type": "code",
833-
"execution_count": 78,
832+
"execution_count": 93,
834833
"metadata": {},
835834
"outputs": [],
836835
"source": [
@@ -841,7 +840,7 @@
841840
},
842841
{
843842
"cell_type": "code",
844-
"execution_count": null,
843+
"execution_count": 94,
845844
"metadata": {},
846845
"outputs": [],
847846
"source": [
@@ -854,19 +853,19 @@
854853
},
855854
{
856855
"cell_type": "code",
857-
"execution_count": 81,
856+
"execution_count": 95,
858857
"metadata": {},
859858
"outputs": [
860859
{
861860
"data": {
862861
"text/html": [
863-
"<style>#sk-container-id-4 {color: black;background-color: white;}#sk-container-id-4 pre{padding: 0;}#sk-container-id-4 div.sk-toggleable {background-color: white;}#sk-container-id-4 label.sk-toggleable__label {cursor: pointer;display: block;width: 100%;margin-bottom: 0;padding: 0.3em;box-sizing: border-box;text-align: center;}#sk-container-id-4 label.sk-toggleable__label-arrow:before {content: \"▸\";float: left;margin-right: 0.25em;color: #696969;}#sk-container-id-4 label.sk-toggleable__label-arrow:hover:before {color: black;}#sk-container-id-4 div.sk-estimator:hover label.sk-toggleable__label-arrow:before {color: black;}#sk-container-id-4 div.sk-toggleable__content {max-height: 0;max-width: 0;overflow: hidden;text-align: left;background-color: #f0f8ff;}#sk-container-id-4 div.sk-toggleable__content pre {margin: 0.2em;color: black;border-radius: 0.25em;background-color: #f0f8ff;}#sk-container-id-4 input.sk-toggleable__control:checked~div.sk-toggleable__content {max-height: 200px;max-width: 100%;overflow: auto;}#sk-container-id-4 input.sk-toggleable__control:checked~label.sk-toggleable__label-arrow:before {content: \"▾\";}#sk-container-id-4 div.sk-estimator input.sk-toggleable__control:checked~label.sk-toggleable__label {background-color: #d4ebff;}#sk-container-id-4 div.sk-label input.sk-toggleable__control:checked~label.sk-toggleable__label {background-color: #d4ebff;}#sk-container-id-4 input.sk-hidden--visually {border: 0;clip: rect(1px 1px 1px 1px);clip: rect(1px, 1px, 1px, 1px);height: 1px;margin: -1px;overflow: hidden;padding: 0;position: absolute;width: 1px;}#sk-container-id-4 div.sk-estimator {font-family: monospace;background-color: #f0f8ff;border: 1px dotted black;border-radius: 0.25em;box-sizing: border-box;margin-bottom: 0.5em;}#sk-container-id-4 div.sk-estimator:hover {background-color: #d4ebff;}#sk-container-id-4 div.sk-parallel-item::after {content: \"\";width: 100%;border-bottom: 1px solid gray;flex-grow: 1;}#sk-container-id-4 div.sk-label:hover label.sk-toggleable__label {background-color: #d4ebff;}#sk-container-id-4 div.sk-serial::before {content: \"\";position: absolute;border-left: 1px solid gray;box-sizing: border-box;top: 0;bottom: 0;left: 50%;z-index: 0;}#sk-container-id-4 div.sk-serial {display: flex;flex-direction: column;align-items: center;background-color: white;padding-right: 0.2em;padding-left: 0.2em;position: relative;}#sk-container-id-4 div.sk-item {position: relative;z-index: 1;}#sk-container-id-4 div.sk-parallel {display: flex;align-items: stretch;justify-content: center;background-color: white;position: relative;}#sk-container-id-4 div.sk-item::before, #sk-container-id-4 div.sk-parallel-item::before {content: \"\";position: absolute;border-left: 1px solid gray;box-sizing: border-box;top: 0;bottom: 0;left: 50%;z-index: -1;}#sk-container-id-4 div.sk-parallel-item {display: flex;flex-direction: column;z-index: 1;position: relative;background-color: white;}#sk-container-id-4 div.sk-parallel-item:first-child::after {align-self: flex-end;width: 50%;}#sk-container-id-4 div.sk-parallel-item:last-child::after {align-self: flex-start;width: 50%;}#sk-container-id-4 div.sk-parallel-item:only-child::after {width: 0;}#sk-container-id-4 div.sk-dashed-wrapped {border: 1px dashed gray;margin: 0 0.4em 0.5em 0.4em;box-sizing: border-box;padding-bottom: 0.4em;background-color: white;}#sk-container-id-4 div.sk-label label {font-family: monospace;font-weight: bold;display: inline-block;line-height: 1.2em;}#sk-container-id-4 div.sk-label-container {text-align: center;}#sk-container-id-4 div.sk-container {/* jupyter's `normalize.less` sets `[hidden] { display: none; }` but bootstrap.min.css set `[hidden] { display: none !important; }` so we also need the `!important` here to be able to override the default hidden behavior on the sphinx rendered scikit-learn.org. See: https://github.com/scikit-learn/scikit-learn/issues/21755 */display: inline-block !important;position: relative;}#sk-container-id-4 div.sk-text-repr-fallback {display: none;}</style><div id=\"sk-container-id-4\" class=\"sk-top-container\"><div class=\"sk-text-repr-fallback\"><pre>RandomForestRegressor(random_state=42)</pre><b>In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook. <br />On GitHub, the HTML representation is unable to render, please try loading this page with nbviewer.org.</b></div><div class=\"sk-container\" hidden><div class=\"sk-item\"><div class=\"sk-estimator sk-toggleable\"><input class=\"sk-toggleable__control sk-hidden--visually\" id=\"sk-estimator-id-4\" type=\"checkbox\" checked><label for=\"sk-estimator-id-4\" class=\"sk-toggleable__label sk-toggleable__label-arrow\">RandomForestRegressor</label><div class=\"sk-toggleable__content\"><pre>RandomForestRegressor(random_state=42)</pre></div></div></div></div></div>"
862+
"<style>#sk-container-id-5 {color: black;background-color: white;}#sk-container-id-5 pre{padding: 0;}#sk-container-id-5 div.sk-toggleable {background-color: white;}#sk-container-id-5 label.sk-toggleable__label {cursor: pointer;display: block;width: 100%;margin-bottom: 0;padding: 0.3em;box-sizing: border-box;text-align: center;}#sk-container-id-5 label.sk-toggleable__label-arrow:before {content: \"▸\";float: left;margin-right: 0.25em;color: #696969;}#sk-container-id-5 label.sk-toggleable__label-arrow:hover:before {color: black;}#sk-container-id-5 div.sk-estimator:hover label.sk-toggleable__label-arrow:before {color: black;}#sk-container-id-5 div.sk-toggleable__content {max-height: 0;max-width: 0;overflow: hidden;text-align: left;background-color: #f0f8ff;}#sk-container-id-5 div.sk-toggleable__content pre {margin: 0.2em;color: black;border-radius: 0.25em;background-color: #f0f8ff;}#sk-container-id-5 input.sk-toggleable__control:checked~div.sk-toggleable__content {max-height: 200px;max-width: 100%;overflow: auto;}#sk-container-id-5 input.sk-toggleable__control:checked~label.sk-toggleable__label-arrow:before {content: \"▾\";}#sk-container-id-5 div.sk-estimator input.sk-toggleable__control:checked~label.sk-toggleable__label {background-color: #d4ebff;}#sk-container-id-5 div.sk-label input.sk-toggleable__control:checked~label.sk-toggleable__label {background-color: #d4ebff;}#sk-container-id-5 input.sk-hidden--visually {border: 0;clip: rect(1px 1px 1px 1px);clip: rect(1px, 1px, 1px, 1px);height: 1px;margin: -1px;overflow: hidden;padding: 0;position: absolute;width: 1px;}#sk-container-id-5 div.sk-estimator {font-family: monospace;background-color: #f0f8ff;border: 1px dotted black;border-radius: 0.25em;box-sizing: border-box;margin-bottom: 0.5em;}#sk-container-id-5 div.sk-estimator:hover {background-color: #d4ebff;}#sk-container-id-5 div.sk-parallel-item::after {content: \"\";width: 100%;border-bottom: 1px solid gray;flex-grow: 1;}#sk-container-id-5 div.sk-label:hover label.sk-toggleable__label {background-color: #d4ebff;}#sk-container-id-5 div.sk-serial::before {content: \"\";position: absolute;border-left: 1px solid gray;box-sizing: border-box;top: 0;bottom: 0;left: 50%;z-index: 0;}#sk-container-id-5 div.sk-serial {display: flex;flex-direction: column;align-items: center;background-color: white;padding-right: 0.2em;padding-left: 0.2em;position: relative;}#sk-container-id-5 div.sk-item {position: relative;z-index: 1;}#sk-container-id-5 div.sk-parallel {display: flex;align-items: stretch;justify-content: center;background-color: white;position: relative;}#sk-container-id-5 div.sk-item::before, #sk-container-id-5 div.sk-parallel-item::before {content: \"\";position: absolute;border-left: 1px solid gray;box-sizing: border-box;top: 0;bottom: 0;left: 50%;z-index: -1;}#sk-container-id-5 div.sk-parallel-item {display: flex;flex-direction: column;z-index: 1;position: relative;background-color: white;}#sk-container-id-5 div.sk-parallel-item:first-child::after {align-self: flex-end;width: 50%;}#sk-container-id-5 div.sk-parallel-item:last-child::after {align-self: flex-start;width: 50%;}#sk-container-id-5 div.sk-parallel-item:only-child::after {width: 0;}#sk-container-id-5 div.sk-dashed-wrapped {border: 1px dashed gray;margin: 0 0.4em 0.5em 0.4em;box-sizing: border-box;padding-bottom: 0.4em;background-color: white;}#sk-container-id-5 div.sk-label label {font-family: monospace;font-weight: bold;display: inline-block;line-height: 1.2em;}#sk-container-id-5 div.sk-label-container {text-align: center;}#sk-container-id-5 div.sk-container {/* jupyter's `normalize.less` sets `[hidden] { display: none; }` but bootstrap.min.css set `[hidden] { display: none !important; }` so we also need the `!important` here to be able to override the default hidden behavior on the sphinx rendered scikit-learn.org. See: https://github.com/scikit-learn/scikit-learn/issues/21755 */display: inline-block !important;position: relative;}#sk-container-id-5 div.sk-text-repr-fallback {display: none;}</style><div id=\"sk-container-id-5\" class=\"sk-top-container\"><div class=\"sk-text-repr-fallback\"><pre>RandomForestRegressor(random_state=42)</pre><b>In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook. <br />On GitHub, the HTML representation is unable to render, please try loading this page with nbviewer.org.</b></div><div class=\"sk-container\" hidden><div class=\"sk-item\"><div class=\"sk-estimator sk-toggleable\"><input class=\"sk-toggleable__control sk-hidden--visually\" id=\"sk-estimator-id-5\" type=\"checkbox\" checked><label for=\"sk-estimator-id-5\" class=\"sk-toggleable__label sk-toggleable__label-arrow\">RandomForestRegressor</label><div class=\"sk-toggleable__content\"><pre>RandomForestRegressor(random_state=42)</pre></div></div></div></div></div>"
864863
],
865864
"text/plain": [
866865
"RandomForestRegressor(random_state=42)"
867866
]
868867
},
869-
"execution_count": 81,
868+
"execution_count": 95,
870869
"metadata": {},
871870
"output_type": "execute_result"
872871
}
@@ -879,7 +878,7 @@
879878
},
880879
{
881880
"cell_type": "code",
882-
"execution_count": 82,
881+
"execution_count": 96,
883882
"metadata": {},
884883
"outputs": [],
885884
"source": [
@@ -889,7 +888,7 @@
889888
},
890889
{
891890
"cell_type": "code",
892-
"execution_count": 83,
891+
"execution_count": 97,
893892
"metadata": {},
894893
"outputs": [],
895894
"source": [
@@ -902,7 +901,7 @@
902901
},
903902
{
904903
"cell_type": "code",
905-
"execution_count": 84,
904+
"execution_count": 98,
906905
"metadata": {},
907906
"outputs": [
908907
{
@@ -965,7 +964,7 @@
965964
},
966965
{
967966
"cell_type": "code",
968-
"execution_count": 85,
967+
"execution_count": 99,
969968
"metadata": {},
970969
"outputs": [
971970
{
@@ -994,7 +993,7 @@
994993
},
995994
{
996995
"cell_type": "code",
997-
"execution_count": 86,
996+
"execution_count": 100,
998997
"metadata": {},
999998
"outputs": [
1000999
{

0 commit comments

Comments
 (0)