In this lab you train, evaluate, and deploy a machine learning model to predict a baby's weight. You then send requests to the model to make online predictions. This lab is part of a series of labs on processing scientific data.
To complete this lab, you need:
In this lab, you:
To launch Cloud Datalab:
Open Cloud Shell. The cloud shell icon is at the top right of the GCP web console:
In Cloud Shell, type:
gcloud compute zones list
Pick a zone in a geographically closeby region.
In Cloud Shell, type:
datalab create babyweight --zone <ZONE>
Datalab will take about 5 minutes to start. Move on to the next step.
You would normally choose the variables to use as predictors after careful analysis. You might do some transformations on the input data as well. See this notebook for the analysis and the Dataflow code to export the necessary data from BigQuery to CSV. To save time, we will start off by copying the already preprocessed dataset.
Navigate to the Storage section from the top-left-corner ("hamburger") menu. If necessary, create a bucket that is regional.
Use the + button on the top-left ribbon on Cloud Shell to get another tab of Cloud Shell.
In the new Cloud Shell tab, type:
gsutil cp gs://cloud-training-demos/babyweight/preproc/* gs://<BUCKET>/babyweight/preproc/
This copies the necessary data over to your bucket.
Switch back to the first Cloud Shell tab.
If necessary, wait for Datalab to finish launching. Datalab is ready when you see a message prompting you to do a "Web Preview".
Click on the Web Preview icon on the top-right corner of the Cloud Shell ribbon.
In Datalab, click on the icon for "Open ungit" in the top-right ribbon.
In the Ungit window, select the text that reads /content/datalab/notebooks and remove the notebooks so that it reads /content/datalab, then hit enter.
In the panel that comes up, type the following as the GitHub repository to Clone from:
Then, click on Clone repository.
Switch back to the browser window where you have Cloud Datalab open and navigate to training-data-analyst/blogs/babyweight/babyweight.ipynb
Change the PROJECT and BUCKET settings in the notebook. Click on Run.
Then, read the narrative and click Shift + Enter (or Run) on each cell in the notebook.
Click on the person icon in the top-right corner of your Datalab window and click on the link to manage the VM.
In the web console, select the Datalab VM and click DELETE.
In this lab you learned how to train, evaluate, and deploy a TensorFlow machine learning model. You then send requests to the model to make online predictions.
©Google, Inc. or its affiliates. All rights reserved. Do not distribute.