This notebook is an exercise in the Introduction to Machine Learning course. You can reference the tutorial at this link.


Introduction

In this notebook, you'll use Google Cloud AutoML Tables to generate a submission for a Kaggle competition.

You'll work with the House Prices: Advanced Regression Techniques competition. The competition is simple: we want you to use 79 different explanatory variables (such as the type of roof, number of bedrooms, and number of bathrooms) to predict home prices.

Note

Before we begin, an important note!

Note: Google Cloud AutoML Tables is a paid service. At the time of publishing, it charges \$19.32 per hour of compute during training and \$1.16 per hour of compute for batch prediction. You can find more details here.

Furthermore, this notebook is optional and does not have to be completed to get full credit for the Intro to Machine Learning course.

Set up the notebook

To begin, we'll need to make sure that your notebook is set up to run the code. Begin by looking at the "Settings" menu to the right of your notebook. Your menu will look like one of the following:


If your "Internet" setting appears as a "Requires phone verification" link, click on this link. This will bring you to a new window; then, follow the instructions to verify your account. After following this step, your "Internet" setting will appear "Off", as in the example to the right.

Once your "Internet" setting appears as "Off", click to turn it on. You'll see a pop-up window that you'll need to "Accept" in order to complete the process and have the setting switched to "On".


Once you have followed the steps above, you're ready to proceed!

Set up Google Cloud

Next, create a Google Cloud account by following the instructions here. You'll also learn how to claim $300 of free credits!

Then, connect your Google Cloud account to this notebook by selecting Add-ons > Google Cloud Services.

In the pop-up window, select Cloud Storage and AutoML (beta). Then click on Link Account.

You'll see another pop-up that tells you about Google AutoML pricing. Once you have reviewed this information, click on ENABLE. Then, sign in with the e-mail address that is linked to your Google Cloud account.

Once your account is attached to the notebook, you can close the pop-up.

Get started with AutoML

We have supplied values for the following variables for you:

You'll need to fill in values for:

Once you've done that, run the code cell.

Once you get a Ready to train model. result, you're ready to move on!

The next step is to commit your notebook.

Note: You should not run the next code cell before committing your notebook. These lines will be run for you when you commit your notebook.

To commit your notebook (and submit predictions to the competition),

  1. Begin by clicking on the Save Version button in the top right corner of the window. This will generate a pop-up window.
  2. Ensure that the Save and Run All option is selected, and then click on the Save button.
  3. This generates a window in the bottom left corner of the notebook. After it has finished running, click on the number to the right of the Save Version button. This pulls up a list of versions on the right of the screen. Click on the ellipsis (...) to the right of the most recent version, and select Open in Viewer. This brings you into view mode of the same page. You will need to scroll down to get back to these instructions.
  4. Click on the Output tab on the right of the screen. Then, click on the file you would like to submit, and click on the blue Submit button to submit your results to the leaderboard.

You have now successfully submitted to the competition!

If you want to keep working to improve your performance, select the Edit button in the top right of the screen. Then you can change your code and repeat the process. There's a lot of room to improve, and you will climb up the leaderboard as you work.

What's next?

In this notebook, you used automated machine learning to generate a submission to a Kaggle competition. All of the steps up to generating predictions were completed for you!

If you're interested in learning more, you can read about Google Cloud AutoML Tables here.

To use the code presented here to train models on other datasets, you may need to make some changes to the wrapper, which you can find here. (Currently, the code works only for regression tasks, but everything you need to know to amend it for a classification task can be found here.)


Have questions or comments? Visit the Learn Discussion forum to chat with other Learners.