
Before you begin
- Labs create a Google Cloud project and resources for a fixed time
- Labs have a time limit and no pause feature. If you end the lab, you'll have to restart from the beginning.
- On the top left of your screen, click Start lab to begin
In this lab you learn the process of analyzing a dataset stored in BigQuery using Colab Enterprise to perform queries and present the data using various statistical plotting techniques. The analysis will help you discover patterns in the data.
Vertex AI is a unified platform for building, deploying, and managing machine learning (ML) applications.
Vertex AI Colab Enterprise is a powerful collaborative interactive tool created to explore, analyze, transform and visualize data and build machine learning models on Google Cloud. It offers the security and compliance features needed for enterprise organizations and integrates with other Google Cloud services like Vertex AI and BigQuery for an enhanced data science and machine learning workflow.
BigQuery is a powerful, fully managed, serverless data warehouse that allows you to analyze and manage large datasets with ease. BigQuery uses a familiar standard SQL dialect, making it easy for analysts and data scientists to use without needing to learn a new language.
Vertex AI offers two Notebook Solutions, Workbench and Colab Enterprise.
The Colab Enterprise worksspace consists of five major sections (as shown in the image below), (1) Notebook storage; (2) Notebook actions; (3) Runtimes and Runtimes templates, (4) Notebook editor and (4) Notebook code cells. Notebook storage is the location of the notebooks, notebook actions are actions that can be performed on a notebook, runtimes let you "run" the notebook, notebook editor is for making edits to the notebook, and code cells let's you enter code.
For each lab, you get a new Google Cloud project and set of resources for a fixed time at no cost.
Sign in to Qwiklabs using an incognito window.
Note the lab's access time (for example, 1:15:00
), and make sure you can finish within that time.
There is no pause feature. You can restart if needed, but you have to start at the beginning.
When ready, click Start lab.
Note your lab credentials (Username and Password). You will use them to sign in to the Google Cloud Console.
Click Open Google Console.
Click Use another account and copy/paste credentials for this lab into the prompts.
If you use other credentials, you'll receive errors or incur charges.
Accept the terms and skip the recovery resource page.
Navigate to the Vertex AI section of your Cloud Console and click ENABLE ALL RECOMMENDED APIS.
A "Welcome to Colab Enterprise" page then appears.
In the Region menu, select the region
Click + CREATE NOTEBOOK in Quick actions section.
A new notebook will opened.
In order to execute the cells you need to create a runtime. Recall that runtimes are instances derived from runtime templates that allow users to run Colab notebooks. To create a runtime, you need to first create a runtime template.
There are three steps. Step 2 and Step 3 are optional.
Step 1: Provide runtime basic information and select region as
Step 2: Configure Compute (Optional)
Step 3: Networking and Security (Optional)
Click Create.
In this example, the code cell below “Getting Started” uses numpy to generate some random data and uses matplotlib to visualize it.
Click Colab Enterprise then click on your created Notebook.
Copy the code below and click Run icon to run the cell.
As you execute the cell, a massage pops up indicating that the runtime is active and initiating a connection - as shown in the image below.
Click Open for Open OAuth popup then select your User Name then click Allow.
Now check the cell you executed, there should be a green check mark next to, this indicates that the cell executed properly.
One of the most important features of software development is the ability to track version history.
When revision history is selected, you see the changes side by side with a date stamp and color-coding to see the “old” in red and the “new” in green (as shown in bubble #2). There are three options to view revision history: the raw source, the inline differences, or the source output (as shown in bubble #3).
To add code or text to a Notebook, simply click on either code or text in the menu bar above the Notebook Editor.
Now, you will add several blocks of code to the notebook. After you copy a block of code, run the code to see the output. Note - Some cells will have not output (such as when you import the libraries). When you are done, share the notebook.
There should be no output shown.
Insert the following code as cells to import the necessary modules and initialize a BigQuery client. The BigQuery client will be used to send and receive messages from the BigQuery API.
No output shown.
In Google, %%bigquery is a magic command used within Jupyter notebooks and other interactive environments to interact with BigQuery. Therefore, %%bigquery essentially tells your environment to wwitch to BigQuery mode: It prepares the environment to accept and execute BigQuery queries. BigQuery will execute the query, retrieve the data, and present it to you within the notebook environment, often as a pandas DataFrame (e.g. the "df" as shown in the code)
Output shown:
Output shown:
Output shown:
Output shown:
Output shown:
Output shown:
Output shown:
Next, share your notebook.
Principals are users, groups, domains, or service accounts Roles are composed of sets of permissions and determine what the principal can do with this resource.
In this lab you learned how to:
When you have completed your lab, click End Lab. Qwiklabs removes the resources you’ve used and cleans the account for you.
You will be given an opportunity to rate the lab experience. Select the applicable number of stars, type a comment, and then click Submit.
The number of stars indicates the following:
You can close the dialog box if you don't want to provide feedback.
For feedback, suggestions, or corrections, please use the Support tab.
Manual Last Updated December 11, 2024
Lab Last Tested December 11, 2024
Copyright 2024 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.
This content is not currently available
We will notify you via email when it becomes available
Great!
We will contact you via email if it becomes available
One lab at a time
Confirm to end all existing labs and start this one