Skip to content

Commit

Permalink
update FS intro
Browse files Browse the repository at this point in the history
  • Loading branch information
tottenjordan committed Sep 20, 2023
1 parent 3d6dd5b commit 64a9633
Showing 1 changed file with 107 additions and 20 deletions.
127 changes: 107 additions & 20 deletions 10-feature-store.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down Expand Up @@ -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": [
"<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>entity_id</th>\n",
" <th>track_name_can</th>\n",
" <th>artist_name_can</th>\n",
" <th>artist_genres_can</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>spotify:track:2JozsL1ayPPjrZsOlQwHuk</td>\n",
" <td>Tweezer Reprise</td>\n",
" <td>Phish</td>\n",
" <td>'blues rock', 'jam band'</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>spotify:track:44FKqeyePqfAcWfJKJkpGy</td>\n",
" <td>That's It For The Other One [Live in San Franc...</td>\n",
" <td>Grateful Dead</td>\n",
" <td>'classic rock', 'cosmic american', 'country ro...</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>spotify:track:5VGz4dSlyNwcPgokpwHKtr</td>\n",
" <td>Junior</td>\n",
" <td>Widespread Panic</td>\n",
" <td>'athens indie', 'jam band', 'roots rock', 'sou...</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"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",
Expand Down

0 comments on commit 64a9633

Please sign in to comment.