pipelines/samples/core/ai_platform
Chen Sun 26de102f82 chore(release): bumped version to 1.4.0-rc.1 2021-02-01 00:18:50 -08:00
..
images add ai_platform test (#2327) 2019-10-09 20:12:52 -07:00
local Minor updates to packages (#3428) 2020-04-22 02:51:51 -07:00
training add ai_platform test (#2327) 2019-10-09 20:12:52 -07:00
README.md add ai_platform test (#2327) 2019-10-09 20:12:52 -07:00
ai_platform.ipynb chore(release): bumped version to 1.4.0-rc.1 2021-02-01 00:18:50 -08:00

README.md

AI Platform Components Sample

This sample demonstrates how to create a simple Kubeflow pipeline using standard AI Platform components.

The model predicts the number of crime reports expected today, given the daily totals from the previous week. It can illustrate how to do automated model retraining if it is configured as a recurring run in Kubeflow pipelines.

To use the TPU in the AI Platform Training service, check out these samples

Pipeline

The pipeline has three steps:

  1. Query historical crime reports from BigQuery and save as a CSV into a Google Cloud Storage bucket.
  2. Train the model using the AI Platform Training service.
  3. Deploy the model to the AI Platform Prediction service.

Pipeline

Model

The model is a Long Short-Term Memory (LSTM) network consisting of 4 units with a dropout rate of 0.2. It is implemented with Tensorflow using the Keras LSTM class.

Predictions

Dataset

The Chicago Crime Data includes crime reports in Chicago from 2001 to the present, and is publicly available in BigQuery.

Assets

  • Notebooks
    • Chicago Crime Pipeline.ipynb Illustrates how to build a pipeline and deploy it to a Kubeflow instance.
    • ./local/Chicago Crime Research.ipynb Illustrates the process of building a model outside of production.
  • Model training code
    • ./training: includes the training code to build the model for use on AI Platform Training service.

Getting Started

  1. On a Kubeflow cluster, upload both notebooks to a running Notebook server.
  2. Explore the research notebook to understand the model. No deployment step is required.
  3. Create a Google Cloud Platform project if you don't already have one.
  4. Create a Google Cloud Storage bucket if you don't already have one, to store the model assets.
  5. From the pipeline notebook, update the required parameters in the Constants section to match your environment.
  6. Run each step in the notebook.
  7. Click the run link in the final step to view the pipeline in the Kubeflow Pipelines UI.