{"id":20408723,"url":"https://github.com/feast-dev/feast-gcp-driver-ranking-tutorial","last_synced_at":"2025-04-12T15:35:35.723Z","repository":{"id":46522030,"uuid":"360361107","full_name":"feast-dev/feast-gcp-driver-ranking-tutorial","owner":"feast-dev","description":"Feast GCP tutorial using BigQuery / Datastore to train / serve a driver ranking model","archived":false,"fork":false,"pushed_at":"2022-07-05T16:14:02.000Z","size":40,"stargazers_count":10,"open_issues_count":4,"forks_count":18,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-26T10:05:28.371Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/feast-dev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-04-22T01:53:27.000Z","updated_at":"2023-05-23T16:46:42.000Z","dependencies_parsed_at":"2022-08-26T03:31:17.741Z","dependency_job_id":null,"html_url":"https://github.com/feast-dev/feast-gcp-driver-ranking-tutorial","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/feast-dev%2Ffeast-gcp-driver-ranking-tutorial","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/feast-dev%2Ffeast-gcp-driver-ranking-tutorial/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/feast-dev%2Ffeast-gcp-driver-ranking-tutorial/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/feast-dev%2Ffeast-gcp-driver-ranking-tutorial/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/feast-dev","download_url":"https://codeload.github.com/feast-dev/feast-gcp-driver-ranking-tutorial/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248590143,"owners_count":21129755,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-15T05:35:52.572Z","updated_at":"2025-04-12T15:35:35.689Z","avatar_url":"https://github.com/feast-dev.png","language":"Jupyter Notebook","readme":"# Feast Driver Ranking Example\n\n### Overview\n\nMaking a prediction using a linear regression model is a common use case in ML. In this guide tutorial, we build the model that predicts if a driver will complete a trip based on a number of features ingested into Feast.\n\nThe basic local mode gives you ability to quickly try Feast, while the advanced mode shows how you can use Feast in a production setting, in particular for the Google Cloud Platform (GCP) cloud. \n\nThis tutorial uses Feast with [Scikit Learn](https://scikit-learn.org/stable/) to\n1. Train a model locally using data from [BigQuery](https://cloud.google.com/bigquery/)\n2. Test the model for online inference using [SQLite](https://www.sqlite.org/index.html) (for fast iteration)\n3. Test the model for online inference using [Firestore](https://firebase.google.com/products/firestore) (to represent production)\n\n\n### Prerequisites \nTo successfully run this tutorial, it requires that you have an account on GCP and have access to read and write permissions to BigQuery. Also, you need to install [Google Cloud CLI](https://cloud.google.com/sdk/gcloud) for your localhost platform.\n\n### Tutorial\n\n1. Install Feast and scikit-learn\n```\npip install feast scikit-learn 'feast[gcp]'\n```\n\n(This tutorial has been tested with Feast==0.11.0)\n\n2. Set up a local feature store (on your laptop).\n```\ncd driver_ranking/\nfeast apply\ncd ..\n```\n\n3. Train a model\n```\npython train.py\n```\n\n4. Load data into your local sqlite online store\n```\ncd driver_ranking/\nfeast materialize-incremental 2022-01-01T00:00:00\ncd ..\n```\n\n\n5. Test your model with your local sqlite online store\n\n```\npython predict.py\n```\n\n6. Set up your production feature store with GCP (uses Google Firestore)\n\nEnsure that Google cloud has been configured\n```\ngcloud config set project SET_YOUR_GCP_PROJECT_HERE\ngcloud auth application-default login\n```\n\nChange the `provider` field in  `driver_ranking/feature_store.yaml` from `local` to `gcp`\n\nThen apply and materialize data to Firestore\n```\ncd driver_ranking/\nfeast apply\nfeast materialize-incremental 2022-01-01T00:00:00\ncd ..\n```\n\n7.  Test your model with your remote Firestore online store\n\n```\npython predict.py\n```\n\n### Advanced\n\nFor production use its preferred to use a Google Cloud Storage based registry instead of a local repository. This allows \nmultiple production systems to share the same source of truth for feature definitions.\n\nChange `feature_store.yaml` to\n```\nproject: driver_ranking\nregistry: gs://my-feature-store-bucket/registry.db\nprovider: gcp\n```\n\nChange `predict.py` and `train.py` to\n```\nself.fs = feast.FeatureStore(\n    config=RepoConfig(\n        project=\"driver_ranking\",\n        provider=\"gcp\",\n        registry=\"gs://my-feature-store-bucket/registry.db\",\n    )\n)\n```","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffeast-dev%2Ffeast-gcp-driver-ranking-tutorial","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffeast-dev%2Ffeast-gcp-driver-ranking-tutorial","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffeast-dev%2Ffeast-gcp-driver-ranking-tutorial/lists"}