diff --git a/sdk/python/examples/quickstart/Quickstart.ipynb b/sdk/python/examples/quickstart/Quickstart.ipynb
index 9fd1680ea9c..96e55f2992c 100644
--- a/sdk/python/examples/quickstart/Quickstart.ipynb
+++ b/sdk/python/examples/quickstart/Quickstart.ipynb
@@ -2,10 +2,8 @@
"cells": [
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {
- "collapsed": true
- },
+ "execution_count": 1,
+ "metadata": {},
"outputs": [],
"source": [
"import pandas as pd\n",
@@ -13,13 +11,10 @@
"\n",
"from feast.sdk.resources.entity import Entity\n",
"from feast.sdk.resources.storage import Storage\n",
- "from feast.sdk.resources.feature import Feature, Datastore, ValueType\n",
- "from feast.sdk.resources.feature_set import FeatureSet, FileType\n",
- "import feast.specs.FeatureSpec_pb2 as feature_pb\n",
- "\n",
+ "from feast.sdk.resources.feature import Feature\n",
+ "from feast.sdk.resources.feature_set import FeatureSet\n",
"from feast.sdk.importer import Importer\n",
- "\n",
- "from feast.sdk.client import Client, ServingRequestType"
+ "from feast.sdk.client import Client"
]
},
{
@@ -31,11 +26,164 @@
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {
- "collapsed": true
- },
- "outputs": [],
+ "execution_count": 2,
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/html": [
+ "
\n",
+ "\n",
+ "
\n",
+ " \n",
+ " \n",
+ " | \n",
+ " ride | \n",
+ " pickup_datetime | \n",
+ " log_trip_duration | \n",
+ " distance_haversine | \n",
+ " distance_dummy_manhattan | \n",
+ " direction | \n",
+ " month | \n",
+ " day_of_month | \n",
+ " hour | \n",
+ " day_of_week | \n",
+ " vi_1 | \n",
+ " vi_2 | \n",
+ " sf_n | \n",
+ " sf_y | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " 0 | \n",
+ " id2875421 | \n",
+ " 2016-03-14 17:24:55 | \n",
+ " 6.122493 | \n",
+ " 1.498521 | \n",
+ " 1.735433 | \n",
+ " 99.970196 | \n",
+ " 3 | \n",
+ " 14 | \n",
+ " 17 | \n",
+ " 0 | \n",
+ " 0 | \n",
+ " 1 | \n",
+ " 1 | \n",
+ " 0 | \n",
+ "
\n",
+ " \n",
+ " 1 | \n",
+ " id2377394 | \n",
+ " 2016-06-12 00:43:35 | \n",
+ " 6.498282 | \n",
+ " 1.805507 | \n",
+ " 2.430506 | \n",
+ " -117.153768 | \n",
+ " 6 | \n",
+ " 12 | \n",
+ " 0 | \n",
+ " 6 | \n",
+ " 1 | \n",
+ " 0 | \n",
+ " 1 | \n",
+ " 0 | \n",
+ "
\n",
+ " \n",
+ " 2 | \n",
+ " id3858529 | \n",
+ " 2016-01-19 11:35:24 | \n",
+ " 7.661527 | \n",
+ " 6.385098 | \n",
+ " 8.203575 | \n",
+ " -159.680165 | \n",
+ " 1 | \n",
+ " 19 | \n",
+ " 11 | \n",
+ " 1 | \n",
+ " 0 | \n",
+ " 1 | \n",
+ " 1 | \n",
+ " 0 | \n",
+ "
\n",
+ " \n",
+ " 3 | \n",
+ " id3504673 | \n",
+ " 2016-04-06 19:32:31 | \n",
+ " 6.063785 | \n",
+ " 1.485498 | \n",
+ " 1.661331 | \n",
+ " -172.737700 | \n",
+ " 4 | \n",
+ " 6 | \n",
+ " 19 | \n",
+ " 2 | \n",
+ " 0 | \n",
+ " 1 | \n",
+ " 1 | \n",
+ " 0 | \n",
+ "
\n",
+ " \n",
+ " 4 | \n",
+ " id2181028 | \n",
+ " 2016-03-26 13:30:55 | \n",
+ " 6.077642 | \n",
+ " 1.188588 | \n",
+ " 1.199457 | \n",
+ " 179.473585 | \n",
+ " 3 | \n",
+ " 26 | \n",
+ " 13 | \n",
+ " 5 | \n",
+ " 0 | \n",
+ " 1 | \n",
+ " 1 | \n",
+ " 0 | \n",
+ "
\n",
+ " \n",
+ "
\n",
+ "
"
+ ],
+ "text/plain": [
+ " ride pickup_datetime log_trip_duration distance_haversine \\\n",
+ "0 id2875421 2016-03-14 17:24:55 6.122493 1.498521 \n",
+ "1 id2377394 2016-06-12 00:43:35 6.498282 1.805507 \n",
+ "2 id3858529 2016-01-19 11:35:24 7.661527 6.385098 \n",
+ "3 id3504673 2016-04-06 19:32:31 6.063785 1.485498 \n",
+ "4 id2181028 2016-03-26 13:30:55 6.077642 1.188588 \n",
+ "\n",
+ " distance_dummy_manhattan direction month day_of_month hour \\\n",
+ "0 1.735433 99.970196 3 14 17 \n",
+ "1 2.430506 -117.153768 6 12 0 \n",
+ "2 8.203575 -159.680165 1 19 11 \n",
+ "3 1.661331 -172.737700 4 6 19 \n",
+ "4 1.199457 179.473585 3 26 13 \n",
+ "\n",
+ " day_of_week vi_1 vi_2 sf_n sf_y \n",
+ "0 0 0 1 1 0 \n",
+ "1 6 1 0 1 0 \n",
+ "2 1 0 1 1 0 \n",
+ "3 2 0 1 1 0 \n",
+ "4 5 0 1 1 0 "
+ ]
+ },
+ "execution_count": 2,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
"source": [
"# Feature engineering steps \n",
"## Referenced from https://www.kaggle.com/karelrv/nyct-from-a-to-z-with-xgboost-tutorial/notebook\n",
@@ -99,22 +247,19 @@
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {
- "collapsed": true
- },
+ "execution_count": 3,
+ "metadata": {},
"outputs": [],
"source": [
- "FEAST_CORE_URL = 'localhost:6565'\n",
- "FEAST_SERVING_URL = 'localhost:6566'\n",
- "STAGING_LOCATION = 'gs://feast-bucket/staging'"
+ "FEAST_CORE_URL = 'localhost:8433'\n",
+ "FEAST_SERVING_URL = 'localhost:8433'\n",
+ "STAGING_LOCATION = 'gs://bucket/staging'"
]
},
{
"cell_type": "code",
- "execution_count": null,
+ "execution_count": 5,
"metadata": {
- "collapsed": true,
"scrolled": true
},
"outputs": [],
@@ -124,26 +269,224 @@
"# Initialise client\n",
"fs = Client(core_url=FEAST_CORE_URL, verbose=True)\n",
"\n",
- "serving_ds=Datastore(id='REDIS1')\n",
- "warehouse_ds=Datastore(id='NOOP')\n",
- "\n",
"# Create importer\n",
"importer = Importer.from_df(df_complete, \n",
- " entity='ride', \n",
- " granularity=Granularity.NONE,\n",
+ " entity='ride',\n",
" owner='user@website.com', \n",
" staging_location=STAGING_LOCATION,\n",
" id_column='ride', \n",
- " timestamp_column='pickup_datetime',\n",
- " serving_store=serving_ds,\n",
- " warehouse_store=warehouse_ds)\n",
+ " timestamp_column='pickup_datetime')\n",
"\n",
"# Update feature and entity metadata. Ideally you want to update these manually\n",
"# so that they contain adequate information for the next user\n",
"importer.entity.description = 'nyc taxi dataset' \n",
"for feature_id in importer.features:\n",
- " importer.features[feature_id].description = 'nyc taxi dataset'\n",
- " \n",
+ " importer.features[feature_id].description = 'nyc taxi dataset'\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 7,
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Successfully applied entity with name: ride\n",
+ "---\n",
+ "name: ride\n",
+ "description: nyc taxi dataset\n",
+ "\n",
+ "Successfully applied feature with id: ride.log_trip_duration\n",
+ "---\n",
+ "id: ride.log_trip_duration\n",
+ "name: log_trip_duration\n",
+ "owner: user@website.com\n",
+ "description: nyc taxi dataset\n",
+ "valueType: DOUBLE\n",
+ "entity: ride\n",
+ "dataStores: {}\n",
+ "\n",
+ "Successfully applied feature with id: ride.distance_haversine\n",
+ "---\n",
+ "id: ride.distance_haversine\n",
+ "name: distance_haversine\n",
+ "owner: user@website.com\n",
+ "description: nyc taxi dataset\n",
+ "valueType: DOUBLE\n",
+ "entity: ride\n",
+ "dataStores: {}\n",
+ "\n",
+ "Successfully applied feature with id: ride.distance_dummy_manhattan\n",
+ "---\n",
+ "id: ride.distance_dummy_manhattan\n",
+ "name: distance_dummy_manhattan\n",
+ "owner: user@website.com\n",
+ "description: nyc taxi dataset\n",
+ "valueType: DOUBLE\n",
+ "entity: ride\n",
+ "dataStores: {}\n",
+ "\n",
+ "Successfully applied feature with id: ride.direction\n",
+ "---\n",
+ "id: ride.direction\n",
+ "name: direction\n",
+ "owner: user@website.com\n",
+ "description: nyc taxi dataset\n",
+ "valueType: DOUBLE\n",
+ "entity: ride\n",
+ "dataStores: {}\n",
+ "\n",
+ "Successfully applied feature with id: ride.month\n",
+ "---\n",
+ "id: ride.month\n",
+ "name: month\n",
+ "owner: user@website.com\n",
+ "description: nyc taxi dataset\n",
+ "valueType: INT64\n",
+ "entity: ride\n",
+ "dataStores: {}\n",
+ "\n",
+ "Successfully applied feature with id: ride.day_of_month\n",
+ "---\n",
+ "id: ride.day_of_month\n",
+ "name: day_of_month\n",
+ "owner: user@website.com\n",
+ "description: nyc taxi dataset\n",
+ "valueType: INT64\n",
+ "entity: ride\n",
+ "dataStores: {}\n",
+ "\n",
+ "Successfully applied feature with id: ride.hour\n",
+ "---\n",
+ "id: ride.hour\n",
+ "name: hour\n",
+ "owner: user@website.com\n",
+ "description: nyc taxi dataset\n",
+ "valueType: INT64\n",
+ "entity: ride\n",
+ "dataStores: {}\n",
+ "\n",
+ "Successfully applied feature with id: ride.day_of_week\n",
+ "---\n",
+ "id: ride.day_of_week\n",
+ "name: day_of_week\n",
+ "owner: user@website.com\n",
+ "description: nyc taxi dataset\n",
+ "valueType: INT64\n",
+ "entity: ride\n",
+ "dataStores: {}\n",
+ "\n",
+ "Successfully applied feature with id: ride.vi_1\n",
+ "---\n",
+ "id: ride.vi_1\n",
+ "name: vi_1\n",
+ "owner: user@website.com\n",
+ "description: nyc taxi dataset\n",
+ "valueType: INT32\n",
+ "entity: ride\n",
+ "dataStores: {}\n",
+ "\n",
+ "Successfully applied feature with id: ride.vi_2\n",
+ "---\n",
+ "id: ride.vi_2\n",
+ "name: vi_2\n",
+ "owner: user@website.com\n",
+ "description: nyc taxi dataset\n",
+ "valueType: INT32\n",
+ "entity: ride\n",
+ "dataStores: {}\n",
+ "\n",
+ "Successfully applied feature with id: ride.sf_n\n",
+ "---\n",
+ "id: ride.sf_n\n",
+ "name: sf_n\n",
+ "owner: user@website.com\n",
+ "description: nyc taxi dataset\n",
+ "valueType: INT32\n",
+ "entity: ride\n",
+ "dataStores: {}\n",
+ "\n",
+ "Successfully applied feature with id: ride.sf_y\n",
+ "---\n",
+ "id: ride.sf_y\n",
+ "name: sf_y\n",
+ "owner: user@website.com\n",
+ "description: nyc taxi dataset\n",
+ "valueType: INT32\n",
+ "entity: ride\n",
+ "dataStores: {}\n",
+ "\n",
+ "Staging file to remote path gs://feast-temp-bucket/staging/tmp_ride_1556438093320.csv\n"
+ ]
+ },
+ {
+ "name": "stderr",
+ "output_type": "stream",
+ "text": [
+ "/Users/aria/.pyenv/versions/3.6.1/lib/python3.6/site-packages/google/auth/_default.py:66: UserWarning: Your application has authenticated using end user credentials from Google Cloud SDK. We recommend that most server applications use service accounts instead. If your application continues to use end user credentials from Cloud SDK, you might receive a \"quota exceeded\" or \"API not enabled\" error. For more information about service accounts, see https://cloud.google.com/docs/authentication/\n",
+ " warnings.warn(_CLOUD_SDK_CREDENTIALS_WARNING)\n",
+ "/Users/aria/.pyenv/versions/3.6.1/lib/python3.6/site-packages/google/auth/_default.py:66: UserWarning: Your application has authenticated using end user credentials from Google Cloud SDK. We recommend that most server applications use service accounts instead. If your application continues to use end user credentials from Cloud SDK, you might receive a \"quota exceeded\" or \"API not enabled\" error. For more information about service accounts, see https://cloud.google.com/docs/authentication/\n",
+ " warnings.warn(_CLOUD_SDK_CREDENTIALS_WARNING)\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Submitting job with spec:\n",
+ " type: file.csv\n",
+ "sourceOptions:\n",
+ " path: gs://feast-temp-bucket/staging/tmp_ride_1556438093320.csv\n",
+ "entities:\n",
+ "- ride\n",
+ "schema:\n",
+ " entityIdColumn: ride\n",
+ " fields:\n",
+ " - name: ride\n",
+ " - name: pickup_datetime\n",
+ " - featureId: ride.log_trip_duration\n",
+ " name: log_trip_duration\n",
+ " - featureId: ride.distance_haversine\n",
+ " name: distance_haversine\n",
+ " - featureId: ride.distance_dummy_manhattan\n",
+ " name: distance_dummy_manhattan\n",
+ " - featureId: ride.direction\n",
+ " name: direction\n",
+ " - featureId: ride.month\n",
+ " name: month\n",
+ " - featureId: ride.day_of_month\n",
+ " name: day_of_month\n",
+ " - featureId: ride.hour\n",
+ " name: hour\n",
+ " - featureId: ride.day_of_week\n",
+ " name: day_of_week\n",
+ " - featureId: ride.vi_1\n",
+ " name: vi_1\n",
+ " - featureId: ride.vi_2\n",
+ " name: vi_2\n",
+ " - featureId: ride.sf_n\n",
+ " name: sf_n\n",
+ " - featureId: ride.sf_y\n",
+ " name: sf_y\n",
+ " timestampColumn: pickup_datetime\n",
+ "\n",
+ "Submitted job with id: feastimport1556438121763\n"
+ ]
+ },
+ {
+ "data": {
+ "text/plain": [
+ "'feastimport1556438121763'"
+ ]
+ },
+ "execution_count": 7,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
"# Ingest the feature data into the store\n",
"fs.run(importer, apply_features=True, apply_entity=True)"
]
@@ -159,27 +502,198 @@
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {
- "collapsed": true
- },
- "outputs": [],
+ "execution_count": 9,
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "creating training dataset for features: ['ride.log_trip_duration', 'ride.distance_haversine', 'ride.distance_dummy_manhattan', 'ride.direction', 'ride.month', 'ride.day_of_month', 'ride.hour', 'ride.day_of_week', 'ride.vi_1', 'ride.vi_2', 'ride.sf_n', 'ride.sf_y']\n",
+ "created dataset ride_1556438183331_20160601_20160801: the-big-data-staging-007.fs_ride.1556438183331_20160601_20160801\n"
+ ]
+ },
+ {
+ "name": "stderr",
+ "output_type": "stream",
+ "text": [
+ "/Users/aria/.pyenv/versions/3.6.1/lib/python3.6/site-packages/google/auth/_default.py:66: UserWarning: Your application has authenticated using end user credentials from Google Cloud SDK. We recommend that most server applications use service accounts instead. If your application continues to use end user credentials from Cloud SDK, you might receive a \"quota exceeded\" or \"API not enabled\" error. For more information about service accounts, see https://cloud.google.com/docs/authentication/\n",
+ " warnings.warn(_CLOUD_SDK_CREDENTIALS_WARNING)\n",
+ "/Users/aria/.pyenv/versions/3.6.1/lib/python3.6/site-packages/google/auth/_default.py:66: UserWarning: Your application has authenticated using end user credentials from Google Cloud SDK. We recommend that most server applications use service accounts instead. If your application continues to use end user credentials from Cloud SDK, you might receive a \"quota exceeded\" or \"API not enabled\" error. For more information about service accounts, see https://cloud.google.com/docs/authentication/\n",
+ " warnings.warn(_CLOUD_SDK_CREDENTIALS_WARNING)\n"
+ ]
+ },
+ {
+ "data": {
+ "text/html": [
+ "\n",
+ "\n",
+ "
\n",
+ " \n",
+ " \n",
+ " | \n",
+ " id | \n",
+ " event_timestamp | \n",
+ " log_trip_duration | \n",
+ " distance_haversine | \n",
+ " distance_dummy_manhattan | \n",
+ " direction | \n",
+ " month | \n",
+ " day_of_month | \n",
+ " hour | \n",
+ " day_of_week | \n",
+ " vi_1 | \n",
+ " vi_2 | \n",
+ " sf_n | \n",
+ " sf_y | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " 0 | \n",
+ " id2503542 | \n",
+ " 2016-06-01 20:17:36 UTC | \n",
+ " 6.811244 | \n",
+ " 3.891984 | \n",
+ " 5.231572 | \n",
+ " -153.084635 | \n",
+ " 6 | \n",
+ " 1 | \n",
+ " 20 | \n",
+ " 2 | \n",
+ " 1 | \n",
+ " 0 | \n",
+ " 1 | \n",
+ " 0 | \n",
+ "
\n",
+ " \n",
+ " 1 | \n",
+ " id2503542 | \n",
+ " 2016-06-01 20:17:36 UTC | \n",
+ " 6.811244 | \n",
+ " 3.891984 | \n",
+ " 5.231572 | \n",
+ " -153.084635 | \n",
+ " 6 | \n",
+ " 1 | \n",
+ " 20 | \n",
+ " 2 | \n",
+ " 1 | \n",
+ " 0 | \n",
+ " 1 | \n",
+ " 0 | \n",
+ "
\n",
+ " \n",
+ " 2 | \n",
+ " id2503542 | \n",
+ " 2016-06-01 20:17:36 UTC | \n",
+ " 6.811244 | \n",
+ " 3.891984 | \n",
+ " 5.231572 | \n",
+ " -153.084635 | \n",
+ " 6 | \n",
+ " 1 | \n",
+ " 20 | \n",
+ " 2 | \n",
+ " 1 | \n",
+ " 0 | \n",
+ " 1 | \n",
+ " 0 | \n",
+ "
\n",
+ " \n",
+ " 3 | \n",
+ " id3525804 | \n",
+ " 2016-06-01 18:56:46 UTC | \n",
+ " 6.903747 | \n",
+ " 3.187360 | \n",
+ " 4.487209 | \n",
+ " 39.494376 | \n",
+ " 6 | \n",
+ " 1 | \n",
+ " 18 | \n",
+ " 2 | \n",
+ " 0 | \n",
+ " 1 | \n",
+ " 1 | \n",
+ " 0 | \n",
+ "
\n",
+ " \n",
+ " 4 | \n",
+ " id3525804 | \n",
+ " 2016-06-01 18:56:46 UTC | \n",
+ " 6.903747 | \n",
+ " 3.187360 | \n",
+ " 4.487209 | \n",
+ " 39.494376 | \n",
+ " 6 | \n",
+ " 1 | \n",
+ " 18 | \n",
+ " 2 | \n",
+ " 0 | \n",
+ " 1 | \n",
+ " 1 | \n",
+ " 0 | \n",
+ "
\n",
+ " \n",
+ "
\n",
+ "
"
+ ],
+ "text/plain": [
+ " id event_timestamp log_trip_duration distance_haversine \\\n",
+ "0 id2503542 2016-06-01 20:17:36 UTC 6.811244 3.891984 \n",
+ "1 id2503542 2016-06-01 20:17:36 UTC 6.811244 3.891984 \n",
+ "2 id2503542 2016-06-01 20:17:36 UTC 6.811244 3.891984 \n",
+ "3 id3525804 2016-06-01 18:56:46 UTC 6.903747 3.187360 \n",
+ "4 id3525804 2016-06-01 18:56:46 UTC 6.903747 3.187360 \n",
+ "\n",
+ " distance_dummy_manhattan direction month day_of_month hour \\\n",
+ "0 5.231572 -153.084635 6 1 20 \n",
+ "1 5.231572 -153.084635 6 1 20 \n",
+ "2 5.231572 -153.084635 6 1 20 \n",
+ "3 4.487209 39.494376 6 1 18 \n",
+ "4 4.487209 39.494376 6 1 18 \n",
+ "\n",
+ " day_of_week vi_1 vi_2 sf_n sf_y \n",
+ "0 2 1 0 1 0 \n",
+ "1 2 1 0 1 0 \n",
+ "2 2 1 0 1 0 \n",
+ "3 2 0 1 1 0 \n",
+ "4 2 0 1 1 0 "
+ ]
+ },
+ "execution_count": 9,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
"source": [
"# Retrieving data: Training\n",
"\n",
"feature_set = FeatureSet(entity=\"ride\", \n",
- " features=[\"ride.none.log_trip_duration\", \n",
- " \"ride.none.distance_haversine\",\n",
- " \"ride.none.distance_dummy_manhattan\",\n",
- " \"ride.none.direction\",\n",
- " \"ride.none.month\",\n",
- " \"ride.none.day_of_month\",\n",
- " \"ride.none.hour\",\n",
- " \"ride.none.day_of_week\",\n",
- " \"ride.none.vi_1\",\n",
- " \"ride.none.vi_2\",\n",
- " \"ride.none.sf_n\",\n",
- " \"ride.none.sf_y\"])\n",
+ " features=[\"ride.log_trip_duration\", \n",
+ " \"ride.distance_haversine\",\n",
+ " \"ride.distance_dummy_manhattan\",\n",
+ " \"ride.direction\",\n",
+ " \"ride.month\",\n",
+ " \"ride.day_of_month\",\n",
+ " \"ride.hour\",\n",
+ " \"ride.day_of_week\",\n",
+ " \"ride.vi_1\",\n",
+ " \"ride.vi_2\",\n",
+ " \"ride.sf_n\",\n",
+ " \"ride.sf_y\"])\n",
"dataset_info = fs.create_dataset(feature_set, \"2016-06-01\", \"2016-08-01\")\n",
"dataset = fs.download_dataset_to_df(dataset_info, staging_location=STAGING_LOCATION)\n",
"\n",
@@ -198,10 +712,8 @@
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {
- "collapsed": true
- },
+ "execution_count": 12,
+ "metadata": {},
"outputs": [],
"source": [
"# Retrieving data: Serving\n",
@@ -210,24 +722,126 @@
"fs = Client(serving_url=FEAST_SERVING_URL, verbose=True)\n",
"\n",
"feature_set = FeatureSet(entity=\"ride\", \n",
- " features=[\"ride.none.log_trip_duration\", \n",
- " \"ride.none.distance_haversine\",\n",
- " \"ride.none.distance_dummy_manhattan\",\n",
- " \"ride.none.direction\",\n",
- " \"ride.none.month\",\n",
- " \"ride.none.day_of_month\",\n",
- " \"ride.none.hour\",\n",
- " \"ride.none.day_of_week\",\n",
- " \"ride.none.vi_1\",\n",
- " \"ride.none.vi_2\",\n",
- " \"ride.none.sf_n\",\n",
- " \"ride.none.sf_y\"])\n",
+ " features=[\"ride.log_trip_duration\", \n",
+ " \"ride.distance_haversine\",\n",
+ " \"ride.distance_dummy_manhattan\",\n",
+ " \"ride.direction\",\n",
+ " \"ride.month\",\n",
+ " \"ride.day_of_month\",\n",
+ " \"ride.hour\",\n",
+ " \"ride.day_of_week\",\n",
+ " \"ride.vi_1\",\n",
+ " \"ride.vi_2\",\n",
+ " \"ride.sf_n\",\n",
+ " \"ride.sf_y\"])\n",
"\n",
"# retrieve features\n",
- "feats = fs.get_serving_data(feature_set, entity_keys=[\"id2875421\",\"id1244481\"])\n",
- "\n",
- "# Feed data into model\n",
- "# ..."
+ "serving_data = fs.get_serving_data(feature_set, entity_keys=[\"id2875421\",\"id1244481\"])"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 13,
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/html": [
+ "\n",
+ "\n",
+ "
\n",
+ " \n",
+ " \n",
+ " | \n",
+ " ride | \n",
+ " ride.log_trip_duration | \n",
+ " ride.distance_haversine | \n",
+ " ride.distance_dummy_manhattan | \n",
+ " ride.direction | \n",
+ " ride.month | \n",
+ " ride.day_of_month | \n",
+ " ride.hour | \n",
+ " ride.day_of_week | \n",
+ " ride.vi_1 | \n",
+ " ride.vi_2 | \n",
+ " ride.sf_n | \n",
+ " ride.sf_y | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " 0 | \n",
+ " id1244481 | \n",
+ " 8.084254 | \n",
+ " 17.988218 | \n",
+ " 23.770274 | \n",
+ " 114.118984 | \n",
+ " 1 | \n",
+ " 15 | \n",
+ " 13 | \n",
+ " 4 | \n",
+ " 0 | \n",
+ " 1 | \n",
+ " 1 | \n",
+ " 0 | \n",
+ "
\n",
+ " \n",
+ " 1 | \n",
+ " id2875421 | \n",
+ " 6.122493 | \n",
+ " 1.498521 | \n",
+ " 1.735433 | \n",
+ " 99.970196 | \n",
+ " 3 | \n",
+ " 14 | \n",
+ " 17 | \n",
+ " 0 | \n",
+ " 0 | \n",
+ " 1 | \n",
+ " 1 | \n",
+ " 0 | \n",
+ "
\n",
+ " \n",
+ "
\n",
+ "
"
+ ],
+ "text/plain": [
+ " ride ride.log_trip_duration ride.distance_haversine \\\n",
+ "0 id1244481 8.084254 17.988218 \n",
+ "1 id2875421 6.122493 1.498521 \n",
+ "\n",
+ " ride.distance_dummy_manhattan ride.direction ride.month \\\n",
+ "0 23.770274 114.118984 1 \n",
+ "1 1.735433 99.970196 3 \n",
+ "\n",
+ " ride.day_of_month ride.hour ride.day_of_week ride.vi_1 ride.vi_2 \\\n",
+ "0 15 13 4 0 1 \n",
+ "1 14 17 0 0 1 \n",
+ "\n",
+ " ride.sf_n ride.sf_y \n",
+ "0 1 0 \n",
+ "1 1 0 "
+ ]
+ },
+ "execution_count": 13,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "serving_data.head()"
]
}
],