diff --git a/docs/images/product_recommendation_overview.png b/docs/images/product_recommendation_overview.png new file mode 100644 index 000000000..46e4c8710 Binary files /dev/null and b/docs/images/product_recommendation_overview.png differ diff --git a/feathr_project/feathrcli/data/feathr_user_workspace/product_rating_demo.ipynb b/feathr_project/feathrcli/data/feathr_user_workspace/product_recommendation_demo.ipynb similarity index 97% rename from feathr_project/feathrcli/data/feathr_user_workspace/product_rating_demo.ipynb rename to feathr_project/feathrcli/data/feathr_user_workspace/product_recommendation_demo.ipynb index 05502119d..65774bf1c 100644 --- a/feathr_project/feathrcli/data/feathr_user_workspace/product_rating_demo.ipynb +++ b/feathr_project/feathrcli/data/feathr_user_workspace/product_recommendation_demo.ipynb @@ -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)" ] }, { @@ -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\")" ] }, { @@ -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://feathrazuretest3fs@feathrazuretest3storage.dfs.core.windows.net/feathr_output/product_recommendation_output/'\n", + " output_path = feathr_output_path\n", "\n", "\n", "feature_query = FeatureQuery(\n", @@ -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://public@azurefeathrstorage.blob.core.windows.net/sample_data/green_tripdata_2020-04_with_index.csv\",\n", " observation_path=\"wasbs://public@azurefeathrstorage.blob.core.windows.net/sample_data/product_recommendation_sample/user_observation_mock_data.csv\",\n", " event_timestamp_column=\"event_timestamp\",\n", " timestamp_format=\"yyyy-MM-dd\")\n", @@ -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", @@ -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'])" ] }, @@ -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" ] },