Samples

This page summarizes samples that demonstrate how to create applications with Cloud Machine Learning Engine.

Getting the samples

The latest Cloud ML Engine samples are available on GitHub.

If you followed the getting started guide, you downloaded the samples to your development environment, where you can run them and experiment with them. More samples will be added to the repo over time, so be sure to check GitHub regularly.

Understanding the samples

The provided samples give concrete examples of how Cloud ML Engine is used. In this section, you'll be introduced to each sample and given information about what they do and what parts of Cloud ML Engine they feature.

Each sample uses a public dataset for its learning model. The datasets are well- known to data scientists and readily available. Indeed, they are hosted for your use on Google Cloud Storage.

Wide and Deep Classification with TensorFlow and Keras

The following samples use a United States Census dataset to train a model and make binary classification about income levels. These classification samples provide an introduction to using Cloud ML Engine.

Both of the TensorFlow samples demonstrate an end-to-end machine learning solution with most of the features of Cloud ML Engine, including hyperparameter tuning, online prediction and batch prediction.

TensorFlow Estimator API Census Sample

The TensorFlow Estimator census sample is the introductory example for Cloud ML Engine. The API allows you to iterate quickly and adapt models to your own datasets without major code overhauls.

This sample is available on Github: Predicting Income with the Census Income Dataset

TensorFlow Core API Census Sample

The TensorFlow Core census sample can be used to run through all of the same steps demonstrated in the Estimator API sample. This sample uses the low level bindings to build a model, which makes it helpful for understanding the underlying workings of TensorFlow and best practices when using the Core API.

This sample is available on Github: Predicting Income with the Census Income Dataset

Keras Census Sample

The Keras census sample is the introductory example for using Keras on Cloud ML Engine to train a model and get predictions.

This sample is available on Github: Predicting Income with the Census Income Dataset using Keras

Personalized Recommendation

The Movielens sample demonstrates how to build personalized recommendation models to recommend movies to users based on movie ratings data from the movielens 20M dataset.

This sample is available on Github: MovieLens Sample

Advertisement - CTR Prediction

The Criteo sample demonstrates the capability of both linear and deep models on the criteo dataset. This sample involves working with a 1 TB dataset to create a model for predicting advertising click-through rates (CTR).

This sample is available on Github: Criteo Sample

Unstructured Text Data

The Reddit sample demonstrates the capability of both linear and deep models on a Reddit dataset. This sample includes a data pre-processing step that reads data from Google BigQuery and converts it to TFRecords format.

This sample is available on Github: Reddit Sample

Image Transfer Learning

The Flowers sample demonstrates how to create a customized image classification model using image-based transfer learning. This sample includes a data pre-processing step that extracts image features from a set of labeled images.

You can also read about this sample in the December 2016 blog post named How to classify images with TensorFlow using Google Cloud Machine Learning and Cloud Dataflow.

What's Next

Send feedback about...

Cloud Machine Learning Engine (Cloud ML Engine)