YUFENG GUO: Google Cloud's AI Platform Training now
has built-in algorithms that you can
use to train models without writing a single line of code.
Let's dive in and find out how you can use it.
[MUSIC PLAYING]
[MECHANICAL SOUNDS]
[SWOOSH]
Welcome to "AI Adventures," where
we explore the art, science, and tools of machine learning.
My name is Yufeng Guo.
And on this episode, we're going to use AI Platform's
built-in algorithms to train and deploy
a machine-learning model without writing any training code.
The tool acts as a handy wrapper around AI Platform Training,
and it bridges the gap between AutoML and full custom training
jobs.
Now, as of this recording, this feature is still in beta.
But perhaps if you're watching this in the future,
it may already be generally available.
Now, before we can really get going on this,
we want to decide what it is we're
going to build a model for.
In this case, I've got here the US Census data
set, a classic binary classification
machine-learning problem.
This means that the goal will be to separate this data into one
of two groups.
In this case, our data comes from the 1994 US Census.
And the task will be to predict if a given household
income will be above or below $50,000 a year.
With this context in place, let's look
at how we can use AI Platform Training to train up this model
without writing any code.
To get started with AI Platform Training using
built-in algorithms, head on over
to the Jobs menu in the Cloud console
and click on New Training Job.
In that menu, you will see two options.
Click on Built-in Algorithm Training.
The first step is to select our algorithm.
Currently, there are a handful of options mostly
around structured data, though, there are a few about images
as well which we won't cover today.
The three structured data algorithms
that are currently available are XGBoost, a Linear Learner,
and the Wide and Deep Learner.
As the names suggest, XGBoost uses the popular implementation
of gradient-boosted trees, while the Linear Learner essentially
models something like linear regression.
And finally, the Wide and Deep Learner
uses the TensorFlow research model
Wide and Deep which tries to combine the memorization
benefits of a wide linear model with the strong generalization
capabilities of deep neural networks.
Once you've selected an algorithm,
we need to specify the training data.
This system takes as input the Google Cloud Storage URL path.
So your data will need to be uploaded onto Google Cloud
Storage beforehand.
And additionally, for structured data,
this system is expecting specifically a headerless CSV
file.
And furthermore, the prediction target column
must be the very first column of that CSV file.
So it may mean that you need to do
a bit of light preprocessing just
to move things around a bit.
And if your CSV file is small enough
to load into a spreadsheet software of your choice,
I would recommend just using that
and dragging your label column over into that first column
position.
Then just delete that header row, if there is one,
and export the file as a CSV file.
This is probably the most straightforward way
to generate that appropriate output format.
The system allows you to specify a validation data and test
data, either as separate files or as a percentage
of the training data.
So if your data is mixed in all together, using the percentages
is an easy and convenient way to ensure that you
have representative metrics.
If you have separate files for Training, Validation, and Test,
make sure that all three are representative
of the same reality.
Otherwise, your training results, oh, they
might surprise you.
So once you've specified all the different training data,
the next screen is all about specifying the algorithm
arguments.
This menu will differ depending on which algorithm you choose.
Each one has a somewhat long list of parameters
that you can specify.
Now, while many default values are provided,
there is also extensive documentation for each value
that you can set.
Additionally, a lot of these parameters
are available to be used for HyperTune,
which is Google Cloud Platform's hyperparameter tuning service.
To use it, check the HyperTune box,
and provide a lower and upper bound for the hyperparameter
that you want to have the system tune for you.
Be sure to check off Allow early stopping of HyperTune trials.
This will allow you to take advantage
of early stopping of any unpromising trials, which
will save compute and time.
Once your algorithm arguments are set, click Next,
and we just have a few final details
to provide about the training job.
Give it a job ID, region, and select the scale tier,
and then the training will commence.
While the model is training, you can make a coffee,
maybe read some web comics, or kick off another training
job in parallel.
Since it's pretty lightweight to start a training job,
you can try different models and different parameter ranges
pretty easily.
Once training is complete, you can
click on the job to view some of the details,
including resource utilization as well as links
to Stackdriver Logging.
You can also deploy your model directly from that screen.
There's a Deploy Model button at the top, which
will grab the exported model from Google Cloud
Storage for you and deploy it out so you
can have a REST API to call your models for predictions.
So there you have it, an easy way
to run model training and deployment
without needing to write a single line of code
while still having the controls that you
want for adjusting the details of a particular model.
This can save time while still enabling
you to get high-quality results customized for your use case
and data set.
For more details and examples, check out the links
included in the description below.
Thanks for watching this episode of "Cloud AI Adventures."
And if you enjoyed it, click that Like button,
and be sure to subscribe to get all the latest episodes right
when they come out.
For now, check out AI Platform Training
using built-in algorithms, and see what kind of results
you can produce.
[MUSIC PLAYING]