|
|
||
|---|---|---|
| .. | ||
| images | ||
| local | ||
| training | ||
| README.md | ||
| ai_platform.ipynb | ||
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:
- Query historical crime reports from BigQuery and save as a CSV into a Google Cloud Storage bucket.
- Train the model using the AI Platform Training service.
- Deploy the model to the AI Platform Prediction service.
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.
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
- On a Kubeflow cluster, upload both notebooks to a running Notebook server.
- Explore the research notebook to understand the model. No deployment step is required.
- Create a Google Cloud Platform project if you don't already have one.
- Create a Google Cloud Storage bucket if you don't already have one, to store the model assets.
- From the pipeline notebook, update the required parameters in the
Constantssection to match your environment. - Run each step in the notebook.
- Click the run link in the final step to view the pipeline in the Kubeflow Pipelines UI.

