Small fixs

parent ce6c7157
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 2, "execution_count": 97,
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 3, "execution_count": 98,
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
...@@ -60,7 +60,7 @@ ...@@ -60,7 +60,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 75, "execution_count": 99,
"metadata": { "metadata": {
"scrolled": true "scrolled": true
}, },
...@@ -468,7 +468,7 @@ ...@@ -468,7 +468,7 @@
"[3173 rows x 2 columns]" "[3173 rows x 2 columns]"
] ]
}, },
"execution_count": 75, "execution_count": 99,
"metadata": {}, "metadata": {},
"output_type": "execute_result" "output_type": "execute_result"
} }
...@@ -487,7 +487,7 @@ ...@@ -487,7 +487,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 76, "execution_count": 100,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
...@@ -526,7 +526,7 @@ ...@@ -526,7 +526,7 @@
"Index: []" "Index: []"
] ]
}, },
"execution_count": 76, "execution_count": 100,
"metadata": {}, "metadata": {},
"output_type": "execute_result" "output_type": "execute_result"
} }
...@@ -551,7 +551,7 @@ ...@@ -551,7 +551,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 77, "execution_count": 101,
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
...@@ -568,7 +568,7 @@ ...@@ -568,7 +568,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 78, "execution_count": 102,
"metadata": { "metadata": {
"scrolled": true "scrolled": true
}, },
...@@ -919,7 +919,7 @@ ...@@ -919,7 +919,7 @@
"[3173 rows x 1 columns]" "[3173 rows x 1 columns]"
] ]
}, },
"execution_count": 78, "execution_count": 102,
"metadata": {}, "metadata": {},
"output_type": "execute_result" "output_type": "execute_result"
} }
...@@ -940,7 +940,7 @@ ...@@ -940,7 +940,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 8, "execution_count": 103,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
...@@ -998,16 +998,16 @@ ...@@ -998,16 +998,16 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 79, "execution_count": 104,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
"data": { "data": {
"text/plain": [ "text/plain": [
"<matplotlib.axes._subplots.AxesSubplot at 0x7efbd47e9fd0>" "<matplotlib.axes._subplots.AxesSubplot at 0x7efbd4516ac8>"
] ]
}, },
"execution_count": 79, "execution_count": 104,
"metadata": {}, "metadata": {},
"output_type": "execute_result" "output_type": "execute_result"
}, },
...@@ -1038,7 +1038,7 @@ ...@@ -1038,7 +1038,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 10, "execution_count": 105,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
...@@ -1047,7 +1047,7 @@ ...@@ -1047,7 +1047,7 @@
"31.942819190992758" "31.942819190992758"
] ]
}, },
"execution_count": 10, "execution_count": 105,
"metadata": {}, "metadata": {},
"output_type": "execute_result" "output_type": "execute_result"
} }
...@@ -1072,16 +1072,16 @@ ...@@ -1072,16 +1072,16 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 80, "execution_count": 106,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
"data": { "data": {
"text/plain": [ "text/plain": [
"<matplotlib.axes._subplots.AxesSubplot at 0x7efbd47d7160>" "<matplotlib.axes._subplots.AxesSubplot at 0x7efbd4373cc0>"
] ]
}, },
"execution_count": 80, "execution_count": 106,
"metadata": {}, "metadata": {},
"output_type": "execute_result" "output_type": "execute_result"
}, },
...@@ -1132,25 +1132,16 @@ ...@@ -1132,25 +1132,16 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 71, "execution_count": 107,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [],
{
"name": "stdout",
"output_type": "stream",
"text": [
"(3173, 2)\n"
]
}
],
"source": [ "source": [
"t = [date.toordinal() for date in sorted_data.index]\n", "t = [date.toordinal() for date in sorted_data.index]\n",
"def transform_input(t):\n", "def transform_input(t):\n",
" X = np.reshape(t, newshape=(-1, 1))\n", " X = np.reshape(t, newshape=(-1, 1))\n",
" X = np.concatenate([X**2, X], axis=1)\n", " X = np.concatenate([X**2, X], axis=1)\n",
" return X\n", " return X # [nb_observations, 2]\n",
"X = transform_input(t)\n", "X = transform_input(t)\n",
"print(X.shape) # [nb_observations, 2]\n",
"c = sorted_data['CO2']\n", "c = sorted_data['CO2']\n",
"\n", "\n",
"reg = LinearRegression().fit(X, c)" "reg = LinearRegression().fit(X, c)"
...@@ -1165,7 +1156,7 @@ ...@@ -1165,7 +1156,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 67, "execution_count": 108,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
...@@ -1192,16 +1183,16 @@ ...@@ -1192,16 +1183,16 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 81, "execution_count": 109,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
"data": { "data": {
"text/plain": [ "text/plain": [
"[<matplotlib.lines.Line2D at 0x7efbd4e56898>]" "[<matplotlib.lines.Line2D at 0x7efbd4344e80>]"
] ]
}, },
"execution_count": 81, "execution_count": 109,
"metadata": {}, "metadata": {},
"output_type": "execute_result" "output_type": "execute_result"
}, },
...@@ -1237,7 +1228,7 @@ ...@@ -1237,7 +1228,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 74, "execution_count": 110,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
...@@ -1246,7 +1237,7 @@ ...@@ -1246,7 +1237,7 @@
"423.89403068381216" "423.89403068381216"
] ]
}, },
"execution_count": 74, "execution_count": 110,
"metadata": {}, "metadata": {},
"output_type": "execute_result" "output_type": "execute_result"
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment