Skip to content

Commit

Permalink
[FSTORE-1396] Tutorials Update: Save/load XGBoost model as json file (#…
Browse files Browse the repository at this point in the history
…265)

* Replace pickling xgboost models with saving them as json objects for the model registry
  • Loading branch information
Maxxx-zh authored May 18, 2024
1 parent 0a247dc commit d67d459
Show file tree
Hide file tree
Showing 30 changed files with 957 additions and 990 deletions.
95 changes: 49 additions & 46 deletions advanced_tutorials/citibike/1_citibike_feature_backfill.ipynb

Large diffs are not rendered by default.

67 changes: 35 additions & 32 deletions advanced_tutorials/citibike/2_citibike_feature_pipeline.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "markdown",
"id": "74b6c01c",
"id": "d179fa38",
"metadata": {},
"source": [
"# <span style=\"font-width:bold; font-size: 3rem; color:#1EB182;\">**Hopsworks Feature Store** </span><span style=\"font-width:bold; font-size: 3rem; color:#333;\">- Part 02: Feature Pipeline</span>\n",
Expand All @@ -15,7 +15,7 @@
},
{
"cell_type": "markdown",
"id": "8d022a10",
"id": "66df50de",
"metadata": {},
"source": [
"### <span style='color:#ff5f27'> 📝 Imports"
Expand All @@ -24,15 +24,18 @@
{
"cell_type": "code",
"execution_count": null,
"id": "7faa949f",
"id": "5b87f18e",
"metadata": {},
"outputs": [],
"source": [
"from datetime import timedelta, datetime\n",
"import pandas as pd\n",
"import os\n",
"\n",
"from features import citibike, meteorological_measurements\n",
"from features import (\n",
" citibike, \n",
" meteorological_measurements,\n",
")\n",
"\n",
"# Mute warnings\n",
"import warnings\n",
Expand All @@ -41,15 +44,15 @@
},
{
"cell_type": "markdown",
"id": "d3dc1ac1",
"id": "b33339b0",
"metadata": {},
"source": [
"---"
]
},
{
"cell_type": "markdown",
"id": "77939976",
"id": "1dfacd9f",
"metadata": {},
"source": [
"## <span style=\"color:#ff5f27;\"> 📡 Connecting to Hopsworks Feature Store </span>"
Expand All @@ -58,7 +61,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "608986f1",
"id": "3046b3e4",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -72,7 +75,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "2cc9d553",
"id": "bd7ce002",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -90,7 +93,7 @@
},
{
"cell_type": "markdown",
"id": "bf4c2d52",
"id": "6c7b15a8",
"metadata": {},
"source": [
"### <span style=\"color:#ff5f27;\">📅 Getting tha last date</span>\n"
Expand All @@ -99,7 +102,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "6f339455",
"id": "ffeaec13",
"metadata": {
"scrolled": true
},
Expand All @@ -113,7 +116,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "41c8bce4",
"id": "e800d919",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -125,7 +128,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "93633194",
"id": "a97c80e1",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -137,23 +140,23 @@
},
{
"cell_type": "markdown",
"id": "dce30ea9",
"id": "05fabd24",
"metadata": {},
"source": [
"---"
]
},
{
"cell_type": "markdown",
"id": "2bfde864",
"id": "fd72808f",
"metadata": {},
"source": [
"## <span style=\"color:#ff5f27;\"> 🪄 Parsing new data</span>"
]
},
{
"cell_type": "markdown",
"id": "d41cb2c5",
"id": "32c5efb2",
"metadata": {},
"source": [
"### <span style=\"color:#ff5f27;\"> 🚲 Citibike usage info</span>"
Expand All @@ -162,7 +165,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "2ca902e0",
"id": "63aa1c27",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -177,7 +180,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "6efc7e2f",
"id": "19a46498",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -190,7 +193,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "62cb7d60",
"id": "198d0ba4",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -206,15 +209,15 @@
},
{
"cell_type": "markdown",
"id": "aa39e68f",
"id": "8bf55a65",
"metadata": {},
"source": [
"### <span style=\"color:#ff5f27;\"> 🌤 Meteorological measurements from VisualCrossing</span>"
]
},
{
"cell_type": "markdown",
"id": "623ed453",
"id": "cf040fe7",
"metadata": {},
"source": [
"You will parse weather data so you should get an API key from [VisualCrossing](https://www.visualcrossing.com/). You can use [this link](https://www.visualcrossing.com/weather-api).\n",
Expand All @@ -231,7 +234,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "525d223f",
"id": "af212086",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -245,7 +248,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "183769e6",
"id": "3773aa84",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -261,7 +264,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "74198dc8",
"id": "ce61c382",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -273,7 +276,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "3b343078",
"id": "28655bc8",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -288,15 +291,15 @@
},
{
"cell_type": "markdown",
"id": "ebdb3fa7",
"id": "f3426f85",
"metadata": {},
"source": [
"---"
]
},
{
"cell_type": "markdown",
"id": "d95d789c",
"id": "f5dad7d4",
"metadata": {},
"source": [
"## <span style=\"color:#ff5f27;\">⬆️ Uploading new data to the Feature Store</span>"
Expand All @@ -305,7 +308,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "d207b245",
"id": "9b144f46",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -316,7 +319,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "dfd8086a",
"id": "0c4a51b2",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -326,15 +329,15 @@
},
{
"cell_type": "markdown",
"id": "4f39826e",
"id": "a4b670d1",
"metadata": {},
"source": [
"---"
]
},
{
"cell_type": "markdown",
"id": "139be1e7",
"id": "84acdbfe",
"metadata": {},
"source": [
"## <span style=\"color:#ff5f27;\">⏭️ **Next:** Part 03: Training Pipeline </span>\n",
Expand All @@ -345,7 +348,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
Expand All @@ -359,7 +362,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.18"
"version": "3.10.11"
}
},
"nbformat": 4,
Expand Down
Loading

0 comments on commit d67d459

Please sign in to comment.