Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added docs/images/product_recommendation_overview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
"6. Materialize feature value to online store.\n",
"7. Fetch feature value in real-time from online store for online scoring.\n",
"\n",
"In this tutorial, we use Feathr Feature Store to create a model that predict users rating for a product."
"In this tutorial, we use Feathr Feature Store to create a model that predict users rating for a product. The feature flow is as below:\n",
"[Feature Flow](https://github.com/linkedin/feathr/blob/main/docs/images/product_recommendation_overview.png?raw=true)"
]
},
{
Expand Down Expand Up @@ -328,7 +329,7 @@
"# User purchase history dataset.\n",
"# Used to generate user features. This is activity type data, so we need to use aggregation to genearte features.\n",
"import pandas as pd\n",
"pd.read_csv(\"https://azurefeathrstorage.blob.core.windows.net/public/sample_data/product_recommendation_sample/user_purchase_history_mock_data\")"
"pd.read_csv(\"https://azurefeathrstorage.blob.core.windows.net/public/sample_data/product_recommendation_sample/user_purchase_history_mock_data.csv\")"
]
},
{
Expand Down Expand Up @@ -536,8 +537,7 @@
"if client.spark_runtime == 'databricks':\n",
" output_path = 'dbfs:/feathrazure_test.avro'\n",
"else:\n",
" # output_path = feathr_output_path\n",
" output_path = 'abfss://[email protected]/feathr_output/product_recommendation_output/'\n",
" output_path = feathr_output_path\n",
"\n",
"\n",
"feature_query = FeatureQuery(\n",
Expand All @@ -548,7 +548,6 @@
" \"feature_user_totla_purchase_in_90days\",\n",
" \"feature_user_purchasing_power\"], key=user_id)\n",
"settings = ObservationSettings(\n",
" # observation_path=\"wasbs://[email protected]/sample_data/green_tripdata_2020-04_with_index.csv\",\n",
" observation_path=\"wasbs://[email protected]/sample_data/product_recommendation_sample/user_observation_mock_data.csv\",\n",
" event_timestamp_column=\"event_timestamp\",\n",
" timestamp_format=\"yyyy-MM-dd\")\n",
Expand Down Expand Up @@ -605,7 +604,7 @@
"metadata": {},
"outputs": [],
"source": [
"# remove columns\n",
"# drop non-feature columns\n",
"from sklearn.ensemble import GradientBoostingRegressor\n",
"final_df = df_res\n",
"final_df.drop([\"event_timestamp\"], axis=1, inplace=True, errors='ignore')\n",
Expand Down Expand Up @@ -695,7 +694,7 @@
"metadata": {},
"outputs": [],
"source": [
"res = client.get_online_features('productRecommendationDemoFeature', '1', [\n",
"client.get_online_features('productRecommendationDemoFeature', '2', [\n",
" 'feature_user_age', 'feature_user_gift_card_balance'])"
]
},
Expand All @@ -705,7 +704,7 @@
"metadata": {},
"outputs": [],
"source": [
"client.multi_get_online_features(\"productRecommendationFeatureSetting\", [\"1\", \"2\"], [\n",
"client.multi_get_online_features('productRecommendationDemoFeature', ['1', '2'], [\n",
" 'feature_user_age', 'feature_user_gift_card_balance'])\n"
]
},
Expand Down