Skip to content

Commit

Permalink
0.19
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxHalford committed Sep 2, 2023
1 parent c658393 commit 2a41c6c
Show file tree
Hide file tree
Showing 26 changed files with 1,660 additions and 1,934 deletions.
207 changes: 80 additions & 127 deletions docs/examples/batch-to-online.ipynb

Large diffs are not rendered by default.

226 changes: 131 additions & 95 deletions docs/examples/bike-sharing-forecasting.ipynb

Large diffs are not rendered by default.

105 changes: 53 additions & 52 deletions docs/examples/building-a-simple-nowcasting-model.ipynb

Large diffs are not rendered by default.

250 changes: 125 additions & 125 deletions docs/examples/content-personalization.ipynb

Large diffs are not rendered by default.

141 changes: 96 additions & 45 deletions docs/examples/debugging-a-pipeline.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
"execution_count": 1,
"metadata": {
"execution": {
"iopub.execute_input": "2023-01-29T19:27:12.328598Z",
"iopub.status.busy": "2023-01-29T19:27:12.328456Z",
"iopub.status.idle": "2023-01-29T19:27:21.535869Z",
"shell.execute_reply": "2023-01-29T19:27:21.535304Z"
"iopub.execute_input": "2023-09-02T00:49:30.394238Z",
"iopub.status.busy": "2023-09-02T00:49:30.393986Z",
"iopub.status.idle": "2023-09-02T00:49:41.362597Z",
"shell.execute_reply": "2023-09-02T00:49:41.362266Z"
},
"tags": []
},
Expand All @@ -33,12 +33,12 @@
"name": "stdout",
"output_type": "stream",
"text": [
"30000 MAE: 2.220942\n",
"60000 MAE: 2.270271\n",
"90000 MAE: 2.301302\n",
"120000 MAE: 2.275876\n",
"150000 MAE: 2.275224\n",
"180000 MAE: 2.289347\n"
"30000 MAE: 13.328051\n",
"60000 MAE: 7.824087\n",
"90000 MAE: 6.003909\n",
"120000 MAE: 5.052855\n",
"150000 MAE: 4.496826\n",
"180000 MAE: 4.140702\n"
]
}
],
Expand Down Expand Up @@ -105,10 +105,10 @@
"execution_count": 2,
"metadata": {
"execution": {
"iopub.execute_input": "2023-01-29T19:27:21.538389Z",
"iopub.status.busy": "2023-01-29T19:27:21.538204Z",
"iopub.status.idle": "2023-01-29T19:27:21.555741Z",
"shell.execute_reply": "2023-01-29T19:27:21.555167Z"
"iopub.execute_input": "2023-09-02T00:49:41.364443Z",
"iopub.status.busy": "2023-09-02T00:49:41.364253Z",
"iopub.status.idle": "2023-09-02T00:49:41.386868Z",
"shell.execute_reply": "2023-09-02T00:49:41.386606Z"
},
"tags": []
},
Expand All @@ -124,33 +124,29 @@
" 'day': x['moment'].weekday()\n",
" }\n",
"\n",
"</code></details><div class=\"river-component river-union\"><details class=\"river-component river-estimator\"><summary class=\"river-summary\"><pre class=\"river-estimator-name\">['clouds', 'humidity', 'pressure', 'temperature', 'wind']</pre></summary><code class=\"river-estimator-params\">(\n",
"</code></details><div class=\"river-component river-union\"><details class=\"river-component river-estimator\"><summary class=\"river-summary\"><pre class=\"river-estimator-name\">['clouds', [...]</pre></summary><code class=\"river-estimator-params\">Select (\n",
" clouds\n",
" humidity\n",
" pressure\n",
" temperature\n",
" wind\n",
")\n",
"\n",
"</code></details><details class=\"river-component river-estimator\"><summary class=\"river-summary\"><pre class=\"river-estimator-name\">y_mean_by_station_and_hour</pre></summary><code class=\"river-estimator-params\">(\n",
"</code></details><details class=\"river-component river-estimator\"><summary class=\"river-summary\"><pre class=\"river-estimator-name\">y_mean_by_station_and_hour</pre></summary><code class=\"river-estimator-params\">TargetAgg (\n",
" by=['station', 'hour']\n",
" how=Mean ()\n",
" target_name=\"y\"\n",
")\n",
"\n",
"</code></details><details class=\"river-component river-estimator\"><summary class=\"river-summary\"><pre class=\"river-estimator-name\">y_ewm_0.5_by_station</pre></summary><code class=\"river-estimator-params\">(\n",
"</code></details><details class=\"river-component river-estimator\"><summary class=\"river-summary\"><pre class=\"river-estimator-name\">y_ewm_0.5_by_station</pre></summary><code class=\"river-estimator-params\">TargetAgg (\n",
" by=['station']\n",
" how=EWMean (\n",
" fading_factor=0.5\n",
" )\n",
" target_name=\"y\"\n",
")\n",
"\n",
"</code></details></div><details class=\"river-component river-estimator\"><summary class=\"river-summary\"><pre class=\"river-estimator-name\">StandardScaler</pre></summary><code class=\"river-estimator-params\">(\n",
"</code></details></div><details class=\"river-component river-estimator\"><summary class=\"river-summary\"><pre class=\"river-estimator-name\">StandardScaler</pre></summary><code class=\"river-estimator-params\">StandardScaler (\n",
" with_std=True\n",
")\n",
"\n",
"</code></details><details class=\"river-component river-estimator\"><summary class=\"river-summary\"><pre class=\"river-estimator-name\">LinearRegression</pre></summary><code class=\"river-estimator-params\">(\n",
"</code></details><details class=\"river-component river-estimator\"><summary class=\"river-summary\"><pre class=\"river-estimator-name\">LinearRegression</pre></summary><code class=\"river-estimator-params\">LinearRegression (\n",
" optimizer=SGD (\n",
" lr=Constant (\n",
" learning_rate=0.01\n",
Expand All @@ -166,19 +162,19 @@
" clip_gradient=1e+12\n",
" initializer=Zeros ()\n",
")\n",
"\n",
"</code></details></div><style scoped>\n",
".river-estimator {\n",
" padding: 1em;\n",
" border-style: solid;\n",
" background: white;\n",
" max-width: max-content;\n",
"}\n",
"\n",
".river-pipeline {\n",
" display: flex;\n",
" flex-direction: column;\n",
" align-items: center;\n",
" background: linear-gradient(#000, #000) no-repeat center / 3px 100%;\n",
" background: linear-gradient(#000, #000) no-repeat center / 1.5px 100%;\n",
"}\n",
"\n",
".river-union {\n",
Expand Down Expand Up @@ -215,6 +211,10 @@
" margin-top: 0;\n",
"}\n",
"\n",
".river-union > .river-component {\n",
" margin-top: 0;\n",
"}\n",
"\n",
".river-union > .pipeline {\n",
" margin-top: 0;\n",
"}\n",
Expand All @@ -230,19 +230,23 @@
".river-estimator-params {\n",
" display: block;\n",
" white-space: pre-wrap;\n",
" font-size: 120%;\n",
" margin-bottom: -1em;\n",
" font-size: 110%;\n",
" margin-top: 1em;\n",
"}\n",
"\n",
".river-estimator > .river-estimator-params,\n",
".river-wrapper > .river-details > river-estimator-params {\n",
" background-color: white !important;\n",
"}\n",
"\n",
".river-wrapper > .river-details {\n",
" margin-bottom: 1em;\n",
"}\n",
"\n",
".river-estimator-name {\n",
" display: inline;\n",
" margin: 0;\n",
" font-size: 130%;\n",
" font-size: 110%;\n",
"}\n",
"\n",
"/* Toggle */\n",
Expand All @@ -257,6 +261,53 @@
" width: 100%;\n",
"}\n",
"</style></div>"
],
"text/plain": [
"Pipeline (\n",
" FuncTransformer (\n",
" func=\"add_time_features\"\n",
" ),\n",
" TransformerUnion (\n",
" Select (\n",
" clouds\n",
" humidity\n",
" pressure\n",
" temperature\n",
" wind\n",
" ),\n",
" TargetAgg (\n",
" by=['station', 'hour']\n",
" how=Mean ()\n",
" target_name=\"y\"\n",
" ),\n",
" TargetAgg (\n",
" by=['station']\n",
" how=EWMean (\n",
" fading_factor=0.5\n",
" )\n",
" target_name=\"y\"\n",
" )\n",
" ),\n",
" StandardScaler (\n",
" with_std=True\n",
" ),\n",
" LinearRegression (\n",
" optimizer=SGD (\n",
" lr=Constant (\n",
" learning_rate=0.01\n",
" )\n",
" )\n",
" loss=Squared ()\n",
" l2=0.\n",
" l1=0.\n",
" intercept_init=0.\n",
" intercept_lr=Constant (\n",
" learning_rate=0.01\n",
" )\n",
" clip_gradient=1e+12\n",
" initializer=Zeros ()\n",
" )\n",
")"
]
},
"execution_count": 2,
Expand All @@ -280,10 +331,10 @@
"execution_count": 3,
"metadata": {
"execution": {
"iopub.execute_input": "2023-01-29T19:27:21.558294Z",
"iopub.status.busy": "2023-01-29T19:27:21.558145Z",
"iopub.status.idle": "2023-01-29T19:27:21.571901Z",
"shell.execute_reply": "2023-01-29T19:27:21.571426Z"
"iopub.execute_input": "2023-09-02T00:49:41.388613Z",
"iopub.status.busy": "2023-09-02T00:49:41.388503Z",
"iopub.status.idle": "2023-09-02T00:49:41.403489Z",
"shell.execute_reply": "2023-09-02T00:49:41.403226Z"
},
"tags": []
},
Expand Down Expand Up @@ -349,22 +400,22 @@
"pressure: 0.04916 (float)\n",
"temperature: -0.51938 (float)\n",
"wind: -0.69426 (float)\n",
"y_ewm_0.5_by_station: 0.19214 (float)\n",
"y_mean_by_station_and_hour: -0.26013 (float)\n",
"y_ewm_0.5_by_station: 0.19640 (float)\n",
"y_mean_by_station_and_hour: -0.27110 (float)\n",
"\n",
"4. LinearRegression\n",
"-------------------\n",
"Name Value Weight Contribution \n",
" Intercept 1.00000 9.22316 9.22316 \n",
" y_ewm_0.5_by_station 0.19214 9.26418 1.78000 \n",
" humidity 1.16366 1.01252 1.17823 \n",
" temperature -0.51938 -0.42112 0.21872 \n",
" wind -0.69426 -0.04088 0.02838 \n",
" pressure 0.04916 0.18137 0.00892 \n",
"y_mean_by_station_and_hour -0.26013 0.19801 -0.05151 \n",
" clouds 1.54778 -0.32697 -0.50608 \n",
"Name Value Weight Contribution \n",
"Intercept 1.00000 9.19960 9.19960 \n",
"y_ewm_0.5_by_station 0.19640 9.19349 1.80562 \n",
"humidity 1.16366 1.01680 1.18320 \n",
"temperature -0.51938 -0.41575 0.21593 \n",
" wind -0.69426 -0.03810 0.02645 \n",
"pressure 0.04916 0.18321 0.00901 \n",
"y_mean_by_station_and_hour -0.27110 0.19553 -0.05301 \n",
" clouds 1.54778 -0.32838 -0.50827 \n",
"\n",
"Prediction: 11.87982\n"
"Prediction: 11.87854\n"
]
}
],
Expand Down Expand Up @@ -396,7 +447,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.0"
"version": "3.10.8"
}
},
"nbformat": 4,
Expand Down
Loading

0 comments on commit 2a41c6c

Please sign in to comment.