—/100
Checkpoints
Create Storage Bucket
/ 20
Create the AI Platform notebook instance
/ 25
Download lab notebook
/ 25
Train and deploy the Model for Predictions
/ 30
Predict Housing Prices with Tensorflow and AI Platform
GSP418
Overview
In this lab, you will build an end to end machine learning solution using Tensorflow 1.x and AI Platform and leverage the cloud for distributed training and online prediction.
tf.estimator — a high-level TensorFlow API that greatly simplifies machine learning programming. Estimators encapsulate the following actions:
- training
- evaluation
- prediction
- export for serving
This lab is focused on interacting with Jupyter and AI Platform. Non-relevant concepts and code blocks are glossed over and are provided for you to execute in your Jupyter notebook.
Set up
Before you click the Start Lab button
Read these instructions. Labs are timed and you cannot pause them. The timer, which starts when you click Start Lab, shows how long Google Cloud resources will be made available to you.
This Qwiklabs hands-on lab lets you do the lab activities yourself in a real cloud environment, not in a simulation or demo environment. It does so by giving you new, temporary credentials that you use to sign in and access Google Cloud for the duration of the lab.
What you need
To complete this lab, you need:
- Access to a standard internet browser (Chrome browser recommended).
- Time to complete the lab.
Note: If you already have your own personal Google Cloud account or project, do not use it for this lab.
Note: If you are using a Pixelbook, open an Incognito window to run this lab.
How to start your lab and sign in to the Google Cloud Console
-
Click the Start Lab button. If you need to pay for the lab, a pop-up opens for you to select your payment method. On the left is a panel populated with the temporary credentials that you must use for this lab.
-
Copy the username, and then click Open Google Console. The lab spins up resources, and then opens another tab that shows the Sign in page.
Tip: Open the tabs in separate windows, side-by-side.
-
In the Sign in page, paste the username that you copied from the Connection Details panel. Then copy and paste the password.
Important: You must use the credentials from the Connection Details panel. Do not use your Qwiklabs credentials. If you have your own Google Cloud account, do not use it for this lab (avoids incurring charges).
-
Click through the subsequent pages:
- Accept the terms and conditions.
- Do not add recovery options or two-factor authentication (because this is a temporary account).
- Do not sign up for free trials.
After a few moments, the Cloud Console opens in this tab.
Create Storage Bucket
Create a bucket using the Cloud Console:
-
Click on the Navigation menu, and select Storage.
-
Click on Create bucket.
-
Set a unique name (use your project ID because it is unique) and then choose a regional bucket, setting the region to
us-central1
. Then, click Create.
Click Check my progress to verify your performed task. If you have completed the task successfully you will be granted with an assessment score.
Launch AI Platform Notebooks
To launch AI Platform Notebooks:
Step 1
Click on the Navigation Menu. Navigate to AI Platform, then to Notebooks.
Step 2
On the Notebook instances page, click . Select a
1.XX
version of TensorFlow (not 2.0) without GPUs. In the following example, you would select Tensorflow Enterprise 1.15 > Without GPUs:
Tensorflow 1.XX versions change semi-frequently, so the version you pick may be different.
In the pop-up, confirm the name of the deep learning VM and click Create.
The new VM will take 2-3 minutes to start.
Step 3
Click Open JupyterLab. A JupyterLab window will open in a new tab.
Click Check my progress to verify your performed task. If you have completed the task successfully you will be granted with an assessment score.
Download lab notebook
To clone the training-data-analyst
notebook in your JupyterLab instance:
- In JupyterLab, click the Terminal icon to open a new terminal.
-
At the command-line prompt, type in the following command and press Enter.
git clone https://github.com/GoogleCloudPlatform/training-data-analyst
- Confirm that you have cloned the repository by double clicking on the
training-data-analyst
directory and ensuring that you can see its contents. The files for all the Jupyter notebook-based labs throughout this course are available in this directory.
Click Check my progress to verify your performed task. If you have completed the task successfully you will be granted with an assessment score.
Open and execute the housing prices notebook
From within the Jupyter console, select training-data-analyst > blogs > housing_prices > cloud-ml-housing-prices.ipynb to begin the lab. Now you're ready to start!
In the top ribbon, click Edit > Clear All Outputs.
From the top right corner, select Python 2 and change it to Python 3.
From here, read the instructions in the notebook to complete the lab.
Execute the cells one by one and observe the results. A convenient way to progress through the cells is by clicking in a cell, then click Shift + Enter
, waiting for each cell to complete before progressing.
Read the instructions and the comments in the code blocks carefully. You will be asked to edit some of the code blocks before running them. For example, you will be setting environment variables in the notebook, so add your bucket name and project ID before running the cell.
Click Check my progress to verify your performed task. If you have completed the task successfully you will be granted with an assessment score.
Congratulations!
You have used Tensorflow's high level Estimator API to deploy Tensorflow 1.x code for distributed training in the cloud and evaluated the results, then deployed the model to the cloud for online prediction.
Finish Your Quest
This self-paced lab is part of the Qwiklabs Data Engineering and Intermediate ML: TensorFlow on Google Cloud Quests. A Quest is a series of related labs that form a learning path. Completing a Quest earns you a badge to recognize your achievement. You can make your badge (or badges) public and link to them in your online resume or social media account. Enroll in one of the above Quests and get immediate completion credit if you've taken this lab. See other available Qwiklabs Quests.
Take Your Next Lab
Continue your Quest with Cloud Composer: Copy BigQuery Tables Across Different Locations, or check out these suggestions:
Next steps / learn more
Check out official documentation on:
- If you're interested more in-depth training, try the Cloud ML coursera labs.
- Jupyter Notebook Basics (Datalab is based on Jupyter)
- tf.estimator
Check out this talk from Google Cloud Next '17 on advanced data science on Google Cloud (43:15).
Google Cloud Training & Certification
...helps you make the most of Google Cloud technologies. Our classes include technical skills and best practices to help you get up to speed quickly and continue your learning journey. We offer fundamental to advanced level training, with on-demand, live, and virtual options to suit your busy schedule. Certifications help you validate and prove your skill and expertise in Google Cloud technologies.
Manual Last Updated March 17, 2021
Lab Last Tested March 17, 2021
Copyright 2021 Google LLC All rights reserved. Google and the Google logo are trademarks of Google LLC. All other company and product names may be trademarks of the respective companies with which they are associated.