Skip to content

Commit

Permalink
update notebooks with output
Browse files Browse the repository at this point in the history
  • Loading branch information
jperez999 committed Jun 29, 2023
1 parent 8081881 commit 68b66af
Show file tree
Hide file tree
Showing 2 changed files with 208 additions and 107 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@
"name": "stderr",
"output_type": "stream",
"text": [
"2023-06-29 19:20:02.816099: I tensorflow/core/platform/cpu_feature_guard.cc:194] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations: SSE3 SSE4.1 SSE4.2 AVX\n",
"2023-06-29 19:49:32.836544: I tensorflow/core/platform/cpu_feature_guard.cc:194] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations: SSE3 SSE4.1 SSE4.2 AVX\n",
"To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.\n",
"/usr/local/lib/python3.8/dist-packages/merlin/dtypes/mappings/torch.py:43: UserWarning: PyTorch dtype mappings did not load successfully due to an error: No module named 'torch'\n",
" warn(f\"PyTorch dtype mappings did not load successfully due to an error: {exc.msg}\")\n"
Expand All @@ -167,12 +167,12 @@
"name": "stderr",
"output_type": "stream",
"text": [
"2023-06-29 19:20:07.245419: I tensorflow/core/platform/cpu_feature_guard.cc:194] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations: SSE3 SSE4.1 SSE4.2 AVX\n",
"2023-06-29 19:49:37.094972: I tensorflow/core/platform/cpu_feature_guard.cc:194] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations: SSE3 SSE4.1 SSE4.2 AVX\n",
"To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.\n",
"2023-06-29 19:20:08.267091: W tensorflow/core/common_runtime/gpu/gpu_bfc_allocator.cc:42] Overriding orig_value setting because the TF_FORCE_GPU_ALLOW_GROWTH environment variable is set. Original config value was 0.\n",
"2023-06-29 19:20:08.267138: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1621] Created device /job:localhost/replica:0/task:0/device:GPU:0 with 24576 MB memory: -> device: 0, name: Quadro RTX 8000, pci bus id: 0000:15:00.0, compute capability: 7.5\n",
"2023-06-29 19:20:08.268109: W tensorflow/core/common_runtime/gpu/gpu_bfc_allocator.cc:42] Overriding orig_value setting because the TF_FORCE_GPU_ALLOW_GROWTH environment variable is set. Original config value was 0.\n",
"2023-06-29 19:20:08.268137: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1621] Created device /job:localhost/replica:0/task:0/device:GPU:1 with 24576 MB memory: -> device: 1, name: Quadro RTX 8000, pci bus id: 0000:2d:00.0, compute capability: 7.5\n",
"2023-06-29 19:49:38.134481: W tensorflow/core/common_runtime/gpu/gpu_bfc_allocator.cc:42] Overriding orig_value setting because the TF_FORCE_GPU_ALLOW_GROWTH environment variable is set. Original config value was 0.\n",
"2023-06-29 19:49:38.134526: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1621] Created device /job:localhost/replica:0/task:0/device:GPU:0 with 24576 MB memory: -> device: 0, name: Quadro RTX 8000, pci bus id: 0000:15:00.0, compute capability: 7.5\n",
"2023-06-29 19:49:38.135533: W tensorflow/core/common_runtime/gpu/gpu_bfc_allocator.cc:42] Overriding orig_value setting because the TF_FORCE_GPU_ALLOW_GROWTH environment variable is set. Original config value was 0.\n",
"2023-06-29 19:49:38.135562: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1621] Created device /job:localhost/replica:0/task:0/device:GPU:1 with 24576 MB memory: -> device: 1, name: Quadro RTX 8000, pci bus id: 0000:2d:00.0, compute capability: 7.5\n",
"/usr/local/lib/python3.8/dist-packages/tqdm/auto.py:21: TqdmWarning: IProgress not found. Please update jupyter and ipywidgets. See https://ipywidgets.readthedocs.io/en/stable/user_install.html\n",
" from .autonotebook import tqdm as notebook_tqdm\n"
]
Expand Down Expand Up @@ -235,7 +235,7 @@
"DATA_FOLDER = os.environ.get(\"DATA_FOLDER\", \"/workspace/data/\")\n",
"# set up the base dir for feature store\n",
"BASE_DIR = os.environ.get(\n",
" \"BASE_DIR\", \"/raid/workshared/merlin/examples/Building-and-deploying-multi-stage-RecSys/\"\n",
" \"BASE_DIR\", \"/Merlin/examples/Building-and-deploying-multi-stage-RecSys/\"\n",
")"
]
},
Expand Down Expand Up @@ -424,7 +424,7 @@
" <tr>\n",
" <th>6</th>\n",
" <td>7</td>\n",
" <td>530</td>\n",
" <td>590</td>\n",
" <td>1</td>\n",
" <td>1</td>\n",
" <td>1</td>\n",
Expand All @@ -433,28 +433,28 @@
" <td>1</td>\n",
" <td>1</td>\n",
" <td>1</td>\n",
" <td>154</td>\n",
" <td>264</td>\n",
" <td>28</td>\n",
" <td>2023-06-29 19:20:20.311986</td>\n",
" <td>2023-06-29 19:20:20.314307</td>\n",
" <td>171</td>\n",
" <td>293</td>\n",
" <td>31</td>\n",
" <td>2023-06-29 19:49:50.300270</td>\n",
" <td>2023-06-29 19:49:50.303330</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" user_id user_shops user_profile user_group user_gender user_age \\\n",
"6 7 530 1 1 1 1 \n",
"6 7 590 1 1 1 1 \n",
"\n",
" user_consumption_1 user_consumption_2 user_is_occupied user_geography \\\n",
"6 1 1 1 1 \n",
"\n",
" user_intentions user_brands user_categories datetime \\\n",
"6 154 264 28 2023-06-29 19:20:20.311986 \n",
"6 171 293 31 2023-06-29 19:49:50.300270 \n",
"\n",
" created \n",
"6 2023-06-29 19:20:20.314307 "
"6 2023-06-29 19:49:50.303330 "
]
},
"execution_count": 11,
Expand Down Expand Up @@ -549,48 +549,48 @@
" <td>1</td>\n",
" <td>1</td>\n",
" <td>1</td>\n",
" <td>2023-06-29 19:20:20.413296</td>\n",
" <td>2023-06-29 19:20:20.414521</td>\n",
" <td>2023-06-29 19:49:50.410715</td>\n",
" <td>2023-06-29 19:49:50.412307</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>2</td>\n",
" <td>7</td>\n",
" <td>457</td>\n",
" <td>158</td>\n",
" <td>73</td>\n",
" <td>2023-06-29 19:20:20.413296</td>\n",
" <td>2023-06-29 19:20:20.414521</td>\n",
" <td>6</td>\n",
" <td>412</td>\n",
" <td>142</td>\n",
" <td>66</td>\n",
" <td>2023-06-29 19:49:50.410715</td>\n",
" <td>2023-06-29 19:49:50.412307</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>3</td>\n",
" <td>13</td>\n",
" <td>914</td>\n",
" <td>315</td>\n",
" <td>146</td>\n",
" <td>2023-06-29 19:20:20.413296</td>\n",
" <td>2023-06-29 19:20:20.414521</td>\n",
" <td>12</td>\n",
" <td>824</td>\n",
" <td>284</td>\n",
" <td>132</td>\n",
" <td>2023-06-29 19:49:50.410715</td>\n",
" <td>2023-06-29 19:49:50.412307</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>4</td>\n",
" <td>20</td>\n",
" <td>1371</td>\n",
" <td>473</td>\n",
" <td>219</td>\n",
" <td>2023-06-29 19:20:20.413296</td>\n",
" <td>2023-06-29 19:20:20.414521</td>\n",
" <td>18</td>\n",
" <td>1236</td>\n",
" <td>426</td>\n",
" <td>197</td>\n",
" <td>2023-06-29 19:49:50.410715</td>\n",
" <td>2023-06-29 19:49:50.412307</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>5</td>\n",
" <td>26</td>\n",
" <td>1828</td>\n",
" <td>630</td>\n",
" <td>292</td>\n",
" <td>2023-06-29 19:20:20.413296</td>\n",
" <td>2023-06-29 19:20:20.414521</td>\n",
" <td>24</td>\n",
" <td>1648</td>\n",
" <td>568</td>\n",
" <td>263</td>\n",
" <td>2023-06-29 19:49:50.410715</td>\n",
" <td>2023-06-29 19:49:50.412307</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
Expand All @@ -599,17 +599,17 @@
"text/plain": [
" item_id item_category item_shop item_brand item_intention \\\n",
"0 1 1 1 1 1 \n",
"1 2 7 457 158 73 \n",
"2 3 13 914 315 146 \n",
"3 4 20 1371 473 219 \n",
"4 5 26 1828 630 292 \n",
"1 2 6 412 142 66 \n",
"2 3 12 824 284 132 \n",
"3 4 18 1236 426 197 \n",
"4 5 24 1648 568 263 \n",
"\n",
" datetime created \n",
"0 2023-06-29 19:20:20.413296 2023-06-29 19:20:20.414521 \n",
"1 2023-06-29 19:20:20.413296 2023-06-29 19:20:20.414521 \n",
"2 2023-06-29 19:20:20.413296 2023-06-29 19:20:20.414521 \n",
"3 2023-06-29 19:20:20.413296 2023-06-29 19:20:20.414521 \n",
"4 2023-06-29 19:20:20.413296 2023-06-29 19:20:20.414521 "
"0 2023-06-29 19:49:50.410715 2023-06-29 19:49:50.412307 \n",
"1 2023-06-29 19:49:50.410715 2023-06-29 19:49:50.412307 \n",
"2 2023-06-29 19:49:50.410715 2023-06-29 19:49:50.412307 \n",
"3 2023-06-29 19:49:50.410715 2023-06-29 19:49:50.412307 \n",
"4 2023-06-29 19:49:50.410715 2023-06-29 19:49:50.412307 "
]
},
"execution_count": 15,
Expand Down Expand Up @@ -890,13 +890,13 @@
"name": "stdout",
"output_type": "stream",
"text": [
"9/9 [==============================] - 10s 275ms/step - loss: 8.9538 - recall_at_10: 0.0055 - ndcg_at_10: 0.0038 - regularization_loss: 0.0000e+00 - loss_batch: 8.8710 - val_loss: 8.9181 - val_recall_at_10: 0.0165 - val_ndcg_at_10: 0.0109 - val_regularization_loss: 0.0000e+00 - val_loss_batch: 8.5802\n"
"9/9 [==============================] - 11s 275ms/step - loss: 8.9538 - recall_at_10: 0.0101 - ndcg_at_10: 0.0067 - regularization_loss: 0.0000e+00 - loss_batch: 8.8711 - val_loss: 8.9179 - val_recall_at_10: 0.0212 - val_ndcg_at_10: 0.0155 - val_regularization_loss: 0.0000e+00 - val_loss_batch: 8.5806\n"
]
},
{
"data": {
"text/plain": [
"<keras.callbacks.History at 0x7f75811a0f70>"
"<keras.callbacks.History at 0x7fd4b04139d0>"
]
},
"execution_count": 26,
Expand Down Expand Up @@ -1038,13 +1038,13 @@
"name": "stdout",
"output_type": "stream",
"text": [
"5/5 [==============================] - 5s 312ms/step - loss: 0.6931 - auc: 0.4991 - regularization_loss: 0.0000e+00 - loss_batch: 0.6932 - val_loss: 0.6931 - val_auc: 0.4983 - val_regularization_loss: 0.0000e+00 - val_loss_batch: 0.6931\n"
"5/5 [==============================] - 5s 305ms/step - loss: 0.6932 - auc: 0.5005 - regularization_loss: 0.0000e+00 - loss_batch: 0.6932 - val_loss: 0.6931 - val_auc: 0.5029 - val_regularization_loss: 0.0000e+00 - val_loss_batch: 0.6931\n"
]
},
{
"data": {
"text/plain": [
"<keras.callbacks.History at 0x7f75507fd670>"
"<keras.callbacks.History at 0x7fd449398a30>"
]
},
"execution_count": 31,
Expand All @@ -1067,7 +1067,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 32,
"id": "00447c12-ea80-4d98-ab47-cc1a982a6958",
"metadata": {},
"outputs": [],
Expand All @@ -1093,7 +1093,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 33,
"id": "e62f65f8-e8f1-447e-9500-5960807c36f2",
"metadata": {},
"outputs": [],
Expand All @@ -1107,17 +1107,86 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 34,
"id": "e02f0957-6665-400a-80c0-60b307466caf",
"metadata": {},
"outputs": [],
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>item_id</th>\n",
" <th>output_1</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>453</th>\n",
" <td>945</td>\n",
" <td>[0.012117806822061539, -0.02241620607674122, 0...</td>\n",
" </tr>\n",
" <tr>\n",
" <th>454</th>\n",
" <td>948</td>\n",
" <td>[0.012117806822061539, -0.02241620607674122, 0...</td>\n",
" </tr>\n",
" <tr>\n",
" <th>455</th>\n",
" <td>956</td>\n",
" <td>[0.012117806822061539, -0.02241620607674122, 0...</td>\n",
" </tr>\n",
" <tr>\n",
" <th>456</th>\n",
" <td>1437</td>\n",
" <td>[0.012117806822061539, -0.02241620607674122, 0...</td>\n",
" </tr>\n",
" <tr>\n",
" <th>457</th>\n",
" <td>1469</td>\n",
" <td>[0.012117806822061539, -0.02241620607674122, 0...</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" item_id output_1\n",
"453 945 [0.012117806822061539, -0.02241620607674122, 0...\n",
"454 948 [0.012117806822061539, -0.02241620607674122, 0...\n",
"455 956 [0.012117806822061539, -0.02241620607674122, 0...\n",
"456 1437 [0.012117806822061539, -0.02241620607674122, 0...\n",
"457 1469 [0.012117806822061539, -0.02241620607674122, 0..."
]
},
"execution_count": 34,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"item_embeddings.tail()"
]
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 35,
"id": "66d7271e-0ea6-4568-ac5a-04089735f542",
"metadata": {},
"outputs": [],
Expand All @@ -1144,7 +1213,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 36,
"id": "4ee27d67-e35a-42c5-8025-ed73f35c8e13",
"metadata": {},
"outputs": [],
Expand Down Expand Up @@ -1195,7 +1264,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 37,
"id": "48a5927c-840d-410c-8f5b-bebce4f79640",
"metadata": {},
"outputs": [],
Expand Down Expand Up @@ -1246,21 +1315,53 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 38,
"id": "57133c1e-18d9-4ccb-9704-cdebd271985e",
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Requirement already satisfied: seedir in /usr/local/lib/python3.8/dist-packages (0.4.2)\n",
"Requirement already satisfied: natsort in /usr/local/lib/python3.8/dist-packages (from seedir) (8.4.0)\n"
]
}
],
"source": [
"# install seedir\n",
"!pip install seedir"
]
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 39,
"id": "986d53ea-c946-4046-a390-6d3b8801d280",
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"feast_repo/\n",
"├─README.md\n",
"├─__init__.py\n",
"└─feature_repo/\n",
" ├─__init__.py\n",
" ├─__pycache__/\n",
" │ ├─__init__.cpython-38.pyc\n",
" │ ├─example_repo.cpython-38.pyc\n",
" │ └─test_workflow.cpython-38.pyc\n",
" ├─data/\n",
" │ ├─item_features.parquet\n",
" │ └─user_features.parquet\n",
" ├─feature_store.yaml\n",
" ├─item_features.py\n",
" ├─test_workflow.py\n",
" └─user_features.py\n"
]
}
],
"source": [
"import seedir as sd\n",
"\n",
Expand Down
Loading

0 comments on commit 68b66af

Please sign in to comment.