Spaces:
Sleeping
Sleeping
Jompatron commited on
Commit ·
3361a9a
1
Parent(s): ee00e7c
without extra l
Browse files- app.py +1 -1
- helper.ipynb +81 -0
app.py
CHANGED
|
@@ -63,7 +63,7 @@ def load_resources():
|
|
| 63 |
weather_fg = fs.get_feature_group("dundee_weather_fg", version=1)
|
| 64 |
|
| 65 |
mr = project.get_model_registry()
|
| 66 |
-
model_obj = mr.get_model("
|
| 67 |
model_dir = model_obj.download()
|
| 68 |
|
| 69 |
model = XGBRegressor()
|
|
|
|
| 63 |
weather_fg = fs.get_feature_group("dundee_weather_fg", version=1)
|
| 64 |
|
| 65 |
mr = project.get_model_registry()
|
| 66 |
+
model_obj = mr.get_model("dundee_pm25_xgboost", version=2)
|
| 67 |
model_dir = model_obj.download()
|
| 68 |
|
| 69 |
model = XGBRegressor()
|
helper.ipynb
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"cells": [
|
| 3 |
+
{
|
| 4 |
+
"cell_type": "code",
|
| 5 |
+
"execution_count": 4,
|
| 6 |
+
"id": "d9e9e697",
|
| 7 |
+
"metadata": {},
|
| 8 |
+
"outputs": [
|
| 9 |
+
{
|
| 10 |
+
"name": "stdout",
|
| 11 |
+
"output_type": "stream",
|
| 12 |
+
"text": [
|
| 13 |
+
"2025-11-18 23:43:05,487 INFO: Closing external client and cleaning up certificates.\n",
|
| 14 |
+
"Connection closed.\n",
|
| 15 |
+
"2025-11-18 23:43:05,489 INFO: Initializing external client\n",
|
| 16 |
+
"2025-11-18 23:43:05,490 INFO: Base URL: https://c.app.hopsworks.ai:443\n"
|
| 17 |
+
]
|
| 18 |
+
},
|
| 19 |
+
{
|
| 20 |
+
"name": "stderr",
|
| 21 |
+
"output_type": "stream",
|
| 22 |
+
"text": [
|
| 23 |
+
"\n",
|
| 24 |
+
"\n"
|
| 25 |
+
]
|
| 26 |
+
},
|
| 27 |
+
{
|
| 28 |
+
"name": "stdout",
|
| 29 |
+
"output_type": "stream",
|
| 30 |
+
"text": [
|
| 31 |
+
"2025-11-18 23:43:06,826 INFO: Python Engine initialized.\n",
|
| 32 |
+
"\n",
|
| 33 |
+
"Logged in to project, explore it here https://c.app.hopsworks.ai:443/p/1286344\n"
|
| 34 |
+
]
|
| 35 |
+
},
|
| 36 |
+
{
|
| 37 |
+
"ename": "TypeError",
|
| 38 |
+
"evalue": "FeatureStore.get_feature_views() missing 1 required positional argument: 'name'",
|
| 39 |
+
"output_type": "error",
|
| 40 |
+
"traceback": [
|
| 41 |
+
"\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
|
| 42 |
+
"\u001b[1;31mTypeError\u001b[0m Traceback (most recent call last)",
|
| 43 |
+
"Cell \u001b[1;32mIn[4], line 4\u001b[0m\n\u001b[0;32m 2\u001b[0m project \u001b[38;5;241m=\u001b[39m hopsworks\u001b[38;5;241m.\u001b[39mlogin()\n\u001b[0;32m 3\u001b[0m fs \u001b[38;5;241m=\u001b[39m project\u001b[38;5;241m.\u001b[39mget_feature_store()\n\u001b[1;32m----> 4\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m fv \u001b[38;5;129;01min\u001b[39;00m \u001b[43mfs\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mget_feature_views\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m:\n\u001b[0;32m 5\u001b[0m \u001b[38;5;28mprint\u001b[39m(fv\u001b[38;5;241m.\u001b[39mname, fv\u001b[38;5;241m.\u001b[39mversion)\n",
|
| 44 |
+
"File \u001b[1;32mc:\\Users\\Johannes\\anaconda3\\envs\\mlfs\\lib\\site-packages\\hopsworks_common\\usage.py:246\u001b[0m, in \u001b[0;36mmethod_logger.<locals>.wrapper\u001b[1;34m(*args, **kwargs)\u001b[0m\n\u001b[0;32m 244\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m \u001b[38;5;167;01mException\u001b[39;00m \u001b[38;5;28;01mas\u001b[39;00m e:\n\u001b[0;32m 245\u001b[0m exception \u001b[38;5;241m=\u001b[39m e\n\u001b[1;32m--> 246\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m e\n\u001b[0;32m 247\u001b[0m \u001b[38;5;28;01mfinally\u001b[39;00m:\n\u001b[0;32m 248\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n",
|
| 45 |
+
"File \u001b[1;32mc:\\Users\\Johannes\\anaconda3\\envs\\mlfs\\lib\\site-packages\\hopsworks_common\\usage.py:242\u001b[0m, in \u001b[0;36mmethod_logger.<locals>.wrapper\u001b[1;34m(*args, **kwargs)\u001b[0m\n\u001b[0;32m 239\u001b[0m exception \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mNone\u001b[39;00m\n\u001b[0;32m 240\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[0;32m 241\u001b[0m \u001b[38;5;66;03m# Call the original method\u001b[39;00m\n\u001b[1;32m--> 242\u001b[0m result \u001b[38;5;241m=\u001b[39m func(\u001b[38;5;241m*\u001b[39margs, \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwargs)\n\u001b[0;32m 243\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m result\n\u001b[0;32m 244\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m \u001b[38;5;167;01mException\u001b[39;00m \u001b[38;5;28;01mas\u001b[39;00m e:\n",
|
| 46 |
+
"\u001b[1;31mTypeError\u001b[0m: FeatureStore.get_feature_views() missing 1 required positional argument: 'name'"
|
| 47 |
+
]
|
| 48 |
+
}
|
| 49 |
+
],
|
| 50 |
+
"source": [
|
| 51 |
+
"import hopsworks\n",
|
| 52 |
+
"project = hopsworks.login()\n",
|
| 53 |
+
"fs = project.get_feature_store()\n",
|
| 54 |
+
"for fv in fs.get_feature_views():\n",
|
| 55 |
+
" print(fv.name, fv.version)\n",
|
| 56 |
+
"\n"
|
| 57 |
+
]
|
| 58 |
+
}
|
| 59 |
+
],
|
| 60 |
+
"metadata": {
|
| 61 |
+
"kernelspec": {
|
| 62 |
+
"display_name": "mlfs",
|
| 63 |
+
"language": "python",
|
| 64 |
+
"name": "python3"
|
| 65 |
+
},
|
| 66 |
+
"language_info": {
|
| 67 |
+
"codemirror_mode": {
|
| 68 |
+
"name": "ipython",
|
| 69 |
+
"version": 3
|
| 70 |
+
},
|
| 71 |
+
"file_extension": ".py",
|
| 72 |
+
"mimetype": "text/x-python",
|
| 73 |
+
"name": "python",
|
| 74 |
+
"nbconvert_exporter": "python",
|
| 75 |
+
"pygments_lexer": "ipython3",
|
| 76 |
+
"version": "3.10.19"
|
| 77 |
+
}
|
| 78 |
+
},
|
| 79 |
+
"nbformat": 4,
|
| 80 |
+
"nbformat_minor": 5
|
| 81 |
+
}
|