Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mooc-rr
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
92c55694c2aeccd81224d0e8936d266a
mooc-rr
Commits
44b26cb6
Commit
44b26cb6
authored
Jun 29, 2020
by
92c55694c2aeccd81224d0e8936d266a
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Small fixs
parent
ce6c7157
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
36 deletions
+27
-36
exercice.ipynb
module3/exo3/exercice.ipynb
+27
-36
No files found.
module3/exo3/exercice.ipynb
View file @
44b26cb6
...
...
@@ -16,7 +16,7 @@
},
{
"cell_type": "code",
"execution_count":
2
,
"execution_count":
97
,
"metadata": {},
"outputs": [],
"source": [
...
...
@@ -41,7 +41,7 @@
},
{
"cell_type": "code",
"execution_count":
3
,
"execution_count":
98
,
"metadata": {},
"outputs": [],
"source": [
...
...
@@ -60,7 +60,7 @@
},
{
"cell_type": "code",
"execution_count":
75
,
"execution_count":
99
,
"metadata": {
"scrolled": true
},
...
...
@@ -468,7 +468,7 @@
"[3173 rows x 2 columns]"
]
},
"execution_count":
75
,
"execution_count":
99
,
"metadata": {},
"output_type": "execute_result"
}
...
...
@@ -487,7 +487,7 @@
},
{
"cell_type": "code",
"execution_count":
76
,
"execution_count":
100
,
"metadata": {},
"outputs": [
{
...
...
@@ -526,7 +526,7 @@
"Index: []"
]
},
"execution_count":
76
,
"execution_count":
100
,
"metadata": {},
"output_type": "execute_result"
}
...
...
@@ -551,7 +551,7 @@
},
{
"cell_type": "code",
"execution_count":
77
,
"execution_count":
101
,
"metadata": {},
"outputs": [],
"source": [
...
...
@@ -568,7 +568,7 @@
},
{
"cell_type": "code",
"execution_count":
78
,
"execution_count":
102
,
"metadata": {
"scrolled": true
},
...
...
@@ -919,7 +919,7 @@
"[3173 rows x 1 columns]"
]
},
"execution_count":
78
,
"execution_count":
102
,
"metadata": {},
"output_type": "execute_result"
}
...
...
@@ -940,7 +940,7 @@
},
{
"cell_type": "code",
"execution_count":
8
,
"execution_count":
103
,
"metadata": {},
"outputs": [
{
...
...
@@ -998,16 +998,16 @@
},
{
"cell_type": "code",
"execution_count":
79
,
"execution_count":
104
,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<matplotlib.axes._subplots.AxesSubplot at 0x7efbd4
7e9fd0
>"
"<matplotlib.axes._subplots.AxesSubplot at 0x7efbd4
516ac8
>"
]
},
"execution_count":
79
,
"execution_count":
104
,
"metadata": {},
"output_type": "execute_result"
},
...
...
@@ -1038,7 +1038,7 @@
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": 10
5
,
"metadata": {},
"outputs": [
{
...
...
@@ -1047,7 +1047,7 @@
"31.942819190992758"
]
},
"execution_count": 10,
"execution_count": 10
5
,
"metadata": {},
"output_type": "execute_result"
}
...
...
@@ -1072,16 +1072,16 @@
},
{
"cell_type": "code",
"execution_count":
80
,
"execution_count":
106
,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<matplotlib.axes._subplots.AxesSubplot at 0x7efbd4
7d716
0>"
"<matplotlib.axes._subplots.AxesSubplot at 0x7efbd4
373cc
0>"
]
},
"execution_count":
80
,
"execution_count":
106
,
"metadata": {},
"output_type": "execute_result"
},
...
...
@@ -1132,25 +1132,16 @@
},
{
"cell_type": "code",
"execution_count":
71
,
"execution_count":
107
,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"(3173, 2)\n"
]
}
],
"outputs": [],
"source": [
"t = [date.toordinal() for date in sorted_data.index]\n",
"def transform_input(t):\n",
" X = np.reshape(t, newshape=(-1, 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",
"print(X.shape) # [nb_observations, 2]\n",
"c = sorted_data['CO2']\n",
"\n",
"reg = LinearRegression().fit(X, c)"
...
...
@@ -1165,7 +1156,7 @@
},
{
"cell_type": "code",
"execution_count":
67
,
"execution_count":
108
,
"metadata": {},
"outputs": [
{
...
...
@@ -1192,16 +1183,16 @@
},
{
"cell_type": "code",
"execution_count":
81
,
"execution_count":
109
,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[<matplotlib.lines.Line2D at 0x7efbd4
e56898
>]"
"[<matplotlib.lines.Line2D at 0x7efbd4
344e80
>]"
]
},
"execution_count":
81
,
"execution_count":
109
,
"metadata": {},
"output_type": "execute_result"
},
...
...
@@ -1237,7 +1228,7 @@
},
{
"cell_type": "code",
"execution_count":
74
,
"execution_count":
110
,
"metadata": {},
"outputs": [
{
...
...
@@ -1246,7 +1237,7 @@
"423.89403068381216"
]
},
"execution_count":
74
,
"execution_count":
110
,
"metadata": {},
"output_type": "execute_result"
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment