From 64a963357486492ec07b5aa7c4ba76eb9ae180b9 Mon Sep 17 00:00:00 2001 From: jordan Date: Wed, 20 Sep 2023 21:06:31 +0000 Subject: [PATCH] update FS intro --- 10-feature-store.ipynb | 127 ++++++++++++++++++++++++++++++++++------- 1 file changed, 107 insertions(+), 20 deletions(-) diff --git a/10-feature-store.ipynb b/10-feature-store.ipynb index f77a495..ac76dd2 100644 --- a/10-feature-store.ipynb +++ b/10-feature-store.ipynb @@ -1585,27 +1585,9 @@ }, { "cell_type": "code", - "execution_count": 68, + "execution_count": 71, "id": "d6c8ab48-2962-48a2-92f9-3b9583cd718f", "metadata": {}, - "outputs": [], - "source": [ - "track_aggregated_features = track_entity_type.read(\n", - " entity_ids=[\n", - " \"spotify:track:44FKqeyePqfAcWfJKJkpGy\", \n", - " \"spotify:track:2JozsL1ayPPjrZsOlQwHuk\", \n", - " \"spotify:track:5VGz4dSlyNwcPgokpwHKtr\",\n", - " # \"spotify:track:0tlhK4OvpHCYpReTABvKFb\"\n", - " ],\n", - " feature_ids=TRACKS_FEATURES_IDS,\n", - ")" - ] - }, - { - "cell_type": "code", - "execution_count": 69, - "id": "45926b1e-a57d-4944-b516-5b5ca41a58a5", - "metadata": {}, "outputs": [ { "data": { @@ -1778,15 +1760,120 @@ "[3 rows x 23 columns]" ] }, - "execution_count": 69, + "execution_count": 71, "metadata": {}, "output_type": "execute_result" } ], "source": [ + "# return all feature fields for an Entity\n", + "track_aggregated_features = track_entity_type.read(\n", + " entity_ids=[\n", + " \"spotify:track:44FKqeyePqfAcWfJKJkpGy\", \n", + " \"spotify:track:2JozsL1ayPPjrZsOlQwHuk\", \n", + " \"spotify:track:5VGz4dSlyNwcPgokpwHKtr\",\n", + " ],\n", + " feature_ids=TRACKS_FEATURES_IDS,\n", + ")\n", + "\n", "track_aggregated_features" ] }, + { + "cell_type": "code", + "execution_count": 72, + "id": "be9bc8a3-0d7d-4531-9fea-dd2c38d34307", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
entity_idtrack_name_canartist_name_canartist_genres_can
0spotify:track:2JozsL1ayPPjrZsOlQwHukTweezer ReprisePhish'blues rock', 'jam band'
1spotify:track:44FKqeyePqfAcWfJKJkpGyThat's It For The Other One [Live in San Franc...Grateful Dead'classic rock', 'cosmic american', 'country ro...
2spotify:track:5VGz4dSlyNwcPgokpwHKtrJuniorWidespread Panic'athens indie', 'jam band', 'roots rock', 'sou...
\n", + "
" + ], + "text/plain": [ + " entity_id \\\n", + "0 spotify:track:2JozsL1ayPPjrZsOlQwHuk \n", + "1 spotify:track:44FKqeyePqfAcWfJKJkpGy \n", + "2 spotify:track:5VGz4dSlyNwcPgokpwHKtr \n", + "\n", + " track_name_can artist_name_can \\\n", + "0 Tweezer Reprise Phish \n", + "1 That's It For The Other One [Live in San Franc... Grateful Dead \n", + "2 Junior Widespread Panic \n", + "\n", + " artist_genres_can \n", + "0 'blues rock', 'jam band' \n", + "1 'classic rock', 'cosmic american', 'country ro... \n", + "2 'athens indie', 'jam band', 'roots rock', 'sou... " + ] + }, + "execution_count": 72, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# return a subset of feature fields for an Entity\n", + "read_track_feats_test = track_entity_type.read(\n", + " entity_ids=[\n", + " \"spotify:track:44FKqeyePqfAcWfJKJkpGy\", \n", + " \"spotify:track:2JozsL1ayPPjrZsOlQwHuk\", \n", + " \"spotify:track:5VGz4dSlyNwcPgokpwHKtr\",\n", + " ],\n", + " feature_ids=[\"track_name_can\", \"artist_name_can\", \"artist_genres_can\"],\n", + ")\n", + "# display the dataframe\n", + "read_track_feats_test.head()" + ] + }, { "cell_type": "markdown", "id": "4340c676-0189-4cd3-8071-8c748ded84f6",