100% found this document useful (1 vote)
193 views171 pages

Machine Learning in Retail

The document provides an agenda for a workshop on machine learning in retail. The day includes an introduction to machine learning theory, use cases of ML in retail, a case study, workshops on metadata enrichment and live recommendations, and an overview of ML tools and infrastructure on Google Cloud Platform.

Uploaded by

Tudor Popa
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
193 views171 pages

Machine Learning in Retail

The document provides an agenda for a workshop on machine learning in retail. The day includes an introduction to machine learning theory, use cases of ML in retail, a case study, workshops on metadata enrichment and live recommendations, and an overview of ML tools and infrastructure on Google Cloud Platform.

Uploaded by

Tudor Popa
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 171

Start: 0915

Machine Learning in Retail


goo.gl/zYWrm9
Welcome
We are

A team of machine learning, data engineering and


analytics experts on Google Cloud Platform

+ Google Cloud EMEA Services Partner of the


Year

“One of, if not the most professional 3rd


Parties I have worked with in a 25 yr career!”
Lush App Developer
Plan for the day
9.15
Introduction to Machine Learning Overview of ML theory and context

10.00
ML in Retail Overview of different ML use cases in the Retail sector

11.00
Datatonic Case study Detailed Retail case study
11.20
Workshop: Metadata enrichment Generate structured information from unstructured data
12.30–
13.30
Tools of the trade Explore libraries, frameworks, infrastructure and resources for practical ML

14.45
ML on GCP Introduce the GCP products for ML as well as other infrastructure required
15.15
Workshop: live recommendation Train and deploy a complete TensorFlow pipeline

16.45
Close Recap
Introduction to Machine Learning
Introduction to Machine Learning
- What is ML?
- Why does ML exist?
- How does ML work?
- What can ML do?
- When is ML useful?
Discussion: What is ML?
Mapping AI
ARTIFICIAL
INTELLIGENCE

MACHINE
LEARNING
DECISION
TREES
DEEP
LEARNING

PROBABILISTIC
LEARNING
Why does ML exist?
Learning vs Programming
Human Learning
Classical conditioning

+ Learning through association


+ Little Albert, Pavlov’s dogs

Operant conditioning

+ Learning through reward and punishment

Observational learning

+ Learning through examples


+ Attention, retention, reproduction, and motivation
Human Learning
Attention Capacity Motivation
Interpreting the example. ‘Retention’ and ‘Reproduction’. Desire to learn.

The human must direct their The human must be able to Humans have intrinsic motivation.
cognition and senses towards remember the pattern and This can be strengthened with an
understanding the information given subsequently to act upon it. implied reward (promised, observed
in the example. or associated).
History of ML
1950
Convergence of neurology and computer science.

“Every effectively calculable function


is a computable function.”

Church–Turing thesis
History of ML “In the summer of 1951 Dean Edmonds and I
went up to Harvard and built our machine. It had

1950 three hundred tubes and a lot of motors. It

Convergence of neurology and computer science.


needed some automatic electric clutches, which
we machined ourselves. The memory of the
machine was stored in the positions of its control
knobs—forty of them—and when the machine
was learning it used the clutches to adjust its
own knobs. We used a surplus gyropilot from a
B-24 bomber to move the clutches.”

Marvin Minsky, on ‘SNARC’


History of ML
1957
Perceptron algorithm formalizes neural network theory
History of ML
"[An electronic computer] will be able to walk,
talk, see, write, reproduce itself and be conscious
1969
of its existence."
Limitations of perceptron networks

+ Binary output New York Times, 1958


+ Separability
+ Computational power

"In from three to eight years we will have a


machine with the general intelligence of an
average human being."

Marvin Minsky, 1970


History of ML
1980s
Logic, symbolic reasoning, expert systems

IF (round) THEN
IF (orange AND coarse) THEN
“orange”
ELSE IF (green AND smooth) THEN
“apple”
ELSE IF …

ELSE IF …
“banana”
History of ML
1986 – return of neural networks
(Logistic regression 1958)
(Fuzzy logic in expert systems)

Backpropagation – Geoff Hinton


What happened next?
Much better than human
History of ML Structured data tasks

21st century
Human or superhuman
Image classification
Games (Go, DotA, Atari)
Medical diagnosis
Speech transcription (batch)

Almost human
Text translation
Object recognition
Text comprehension
The value of data
“The world is its own best model. It is
always exactly up to date. It always
has every detail there is to be known.
The trick is to sense it appropriately
and often enough.”
Making decisions based on data is not new. It is just
much easier now
Big Data

+ Process massive amounts of data

+ Rendering more information into structured data


+ Images
+ Text
+ Networks
+ …
Mapping data
Structured Semi-structured Unstructured

Rows and columns Tags and relationships Data without rigid form

Predictable and neat, though Organised into hierarchies and Unstructured data accounts for
often imperfect networks. More freeform than 90% of enterprise data.
structured data but still queryable
+ CSV + Images
+ SQL databases + JSON + Audio
+ XML + Free text
+ NoSQL databases
“ Mimicking functions of the human brain (DL) coupled with the
availability of low-cost massive computational hardware resources
(GPU) and huge data pools (Big Data) provides opportunities to
solve problems which so far have relied on human brain-power.*”

*https://hackernoon.com/what-is-the-difference-between-machine-learning-and-human-learning-53119c217194
How does ML work?
Human Learning
Attention Capacity Motivation
Interpreting the example. ‘Retention’ and ‘Reproduction’. Desire to learn.

The human must direct their The human must be able to Humans have intrinsic motivation.
cognition and senses towards remember the pattern and This can be strengthened with an
understanding the information given subsequently to act upon it. implied reward (promised, observed
in the example. or associated).
Machine Learning
Attention Capacity Motivation
Interpreting the example. ‘Retention’ and ‘Reproduction’. Desire to learn.

Information must be provided to the The machine must be able to Machines have no intrinsic
machine in a way it can learn from. remember the pattern and motivation. They must instead
subsequently to act upon it. optimize an objective function to
2.2 direct successful learning.
-0.1
14.7
9.5
-3.5
N.B. ‘attention’ is also an active field of study
in machine learning.
Machine Learning
Attention Capacity Motivation
Interpreting the example. ‘Retention’ and ‘Reproduction’. Desire to learn.

y = mx + c y = mx + c + ε
x y

1 3.1

2 5.0

3 6.9

4 9.2

y = 2x + 1
Data
ML in one slide INPUT

Model PARAMETERS f (x)

Knowledge
OUTPUT
Data
ML in one slide INPUT

Model PARAMETERS f (x)


UPDATE
Knowledge
Training ASSESS OUTPUT
What can ML do?
There are only 3 tasks in ML

Predict Self-describe Optimize


(Supervised learning) (Unsupervised learning) (Maximize / Minimize)

OUTPUT OUTPUT OUTPUT


OUTPUT
OUTPUT
OUTPUT
= = OUTPUT

TARGET
There are only 3 tasks in ML

Predict Self-describe Optimize


(Supervised learning) (Unsupervised learning) (Maximize / Minimize)

educated get meaning improve


guessing from variation performance metrics

e.g. classification, e.g. clustering, e.g. genetic algorithms,


regression compression reinforcement learning
Mapping ML MACHINE LEARNING

SUPERVISED LEARNING UNSUPERVISED LEARNING OPTIMIZATION

Learn to predict y from x Learn the structure behind x Minimize / maximize a score

FORECASTING EXPLORATION EXPLOITATION

Extending time series Try different things Go with the best

REINFORCEMENT
CLASSIFICATION REGRESSION CLUSTERING EMBEDDING METAHEURISTICS
LEARNING

Discrete y Continuous y Discrete patterns Continuous patterns Act and receive Mimic natural process
reward / punishment e.g. ant colony
Optimization
Find the global min / max of a function
Explore different values of x to find best y
Classification + Regression
Train a model to predict an output
Learn how y depends on x
Reinforcement Learning
Train an agent to take the best actions
Given a state, find the action that leads to most reward
Forecasting
Predict the future of a time series
Uncover trends and correlations across time
Summarizing data
Learn a concise representation
Clustering Embedding
Probabilistic Modelling
Distinguish signal from noise
Anomaly detection Filtering
When is ML useful?
When is Machine Learning useful?

There is something to learn There is sufficient data to learn it

If there is no underlying truth to uncover, ML A balance of complexity, noise, distribution and


cannot find it. Don’t assume all data form a number. This is why “ML is just glorified statistics”.
pattern.

It is currently unknown... … or it can’t be programmed easily

If someone knows it, they should just program it If you really need an AI to do it for you, then ML
conventionally! may be a good solution.
Ask yourself...

+ Can your use case be solved without ML?

+ Is your ML model actually better than your heuristics?

+ Which type of ML problem is it?


predict

optimize

self-describe
ML effort allocation - expectation vs. reality


Where should you focus your effort?

ML is a data strategy first Define your metrics

+ Big data and analytics are prerequisites for + Tailor KPIs to each use case
building any ML pipeline + Define the baseline(s) you want to beat
+ Understand your data

Divide and conquer Use the wisdom of the crowd

+ Design multiple models for a business problem + Exploit pre-trained ML models on your data
+ Account for different user behaviours before exploring new ones
Introduction to Machine Learning (Recap)
Why does ML exist?
Introduction to Machine Learning (Recap)
How does ML work?

2.2
-0.1
14.7
9.5
-3.5
Introduction to Machine Learning (Recap)
What can ML do?
Introduction to Machine Learning (Recap)
When is ML useful?

There is some
thing to learn
There is suffici
ent data to lea
rn it
It is currently u
nknown...
… or it can’t be
programmed e
asily
Machine Learning in Retail
How can ML add value to Retail?
Machine Learning converts examples into knowledge
Mapping the value of ML across the retail chain

Process efficiency Revenue management Customer experience Targeted Marketing

How can we optimise How can we maximise How can we enhance How can we target the
resource harnessing? revenue? customer experience? relevant customers?

Data-driven business growth strategies


Automation and Augmentation of the retail process
Mapping the value of ML across the retail chain

Process efficiency Revenue management Customer experience Targeted Marketing

How can we optimise


resource harnessing?
Predictive Maintenance
The use case: maintain the production machinery in the most
efficient way
+ Keeping a regular maintenance
+ Reducing downtimes (by predicting them ahead)
+ Avoiding under-maintaining or over-maintaining assets

How can this be solved without ML?


+ Planned Preventive Maintenance (PPM)
+ Analysis of failure history

What can ML improve?


+ Process big amounts of sensor data
+ Leverage IoT for manufacturing
+ Build models for real-time quantification of the risk of failure
(alerts system)
+ Find the right moment for maintenance
Inventory management
The use case: stock optimisation
+ Design optimal allocation and replenishment strategies
+ Demand forecasting

How can this be solved without ML?


+ Manually scheduled replenishments
+ Evaluate conversion rate of SKUs based on business rules
+ Model demand using dictated stochastic mathematical distribution
(e.g. “Newsvendor model”)

What can ML improve?


+ State of the art time-series prediction algorithms
+ Use a combination of classical statistical and ML approaches
+ Improve demand forecasting and lead-time forecasting accuracy
+ Forecast extreme events (e.g. peak demand)
Mapping the value of ML across the retail chain

Process efficiency Revenue management Customer experience Targeted Marketing

How can we maximise


revenue?
Price optimisation
The use case: setting the optimal product price
+ Understand how customers react to different prices
+ Maximising profitability (increase sale amount)
+ Maximising market access (acquire more customers)

How can this be solved without ML?


+ Hard-wired rules
+ Aggressive general markdowns

What can ML improve?


+ Predict likely outcomes to different pricing strategies
+ Fastly detecting emerging trends
+ Developing more complex strategies to achieve KPIs
+ Scalable and flexible solution
Optimal shop location
The use case: assess if a store will be profitable without
building it
+ Evaluate the potential of the market in an area

How can this be solved without ML?


+ Street surveys
+ Nearest shops analysis

What can ML improve?


+ Data-driven approach to store openings
+ Predict the revenue of a potential shop before it even
exists
+ Combine geoinformation, sales and demographics data
+ Network analysis
+ Preventing sale drop at another store
Mapping the value of ML across the retail chain

Process efficiency Revenue management Customer experience Targeted Marketing

How can we enhance


customer experience?
Recommender systems
The use case: staying relevant across a broad base
+ Recommending the appropriate products
+ Improving interactions with customers
+ Optimising marketing campaigns

How can this be solved without ML?


+ Personas/Segments
+ Trendsetting (create the appeal)
+ Recommend based on heuristics (e.g. recency or
popularity)

What can ML improve?


+ Identify finer patterns of behaviour, even down to
individuals (cookies?)
+ Knowing the customer without having to ask
+ Dynamic personalised recommendations
Product recognition
The use case: automatically classify products
+ Automatically assign product descriptions and price

How can this be solved without ML?


Gala apple
+ Manual labelling of products (plastic packages) £0.62
+ Manual (and limited) classification of products according to visual
features
+ Invest in store staff

What can ML improve?


+ AI-powered image recognition (DNNs for multi-class
classification)
+ Scalable solution (handle millions of requests)
+ Updated and more detailed descriptions served upon request
Customer sentiment analysis
The use case: maximising customer loyalty
+ Understanding how services impact customers
+ Reacting to public opinion on social media
+ Loyalty is a sentiment

How can this be solved without ML?


+ Customer polls
+ Michigan Consumer Sentiment Index (1946)
+ Manual review analysis

What can ML improve?


+ Natural Language Processing models
+ Faster, automatic and generalizable language processing
techniques to extract positive/negative sentiment “ People will forget what you said,
people will forget what you did,
but people will never forget how you made them feel ”
Mapping the value of ML across the retail chain

Process efficiency Revenue management Customer experience Targeted Marketing

How can we target the


relevant customers?
Customer segmentation
The use case: identify audiences
+ Divide your customer base into groups based on similar characteristics
relevant to your marketing team (spending habits, demographics, ….)
+ Optimise marketing efforts by targeting specific, smaller groups

How can this be solved without ML?


+ Customer personas
+ Segmentation based on data analysis

What can ML improve?


+ Powerful clustering algorithms
+ Microsegmentation
+ Updated segments based on the most recent data
+ Incorporation of multiple data sources into a unique model
Propensity modelling
The use case: identify audiences
+ Identify which customers are the most likely to purchase a given
brand in a given future time range
+ Target this audience in your marketing campaigns

How can this be solved without ML?


+ Analytics on historical transaction data
+ Heuristics to try and simulate this propensity

What can ML improve?


+ Combine many data sources (demographics, transactions,
browsing, product, ...)
+ Learning complex patterns from aggregated features
+ Scalability to a lot of brands and customers
Customer lifetime value
The use case: identify the most valuable customers

+ Predict the future value for existing customers who have a known
transaction history
+ Pareto principle: “20% of your customers account for 80% of your
sales”

How can this be solved without ML?


+ RFM values (Recency - Frequency - Monetary)
+ Probabilistic models: fit a probability distribution to RFM values
+ Pareto / NBD model
+ Timing patterns analysis

What can ML improve?


+ Improve accuracy by incorporating more features than RFM
+ Pattern analysis with Recurrent Neural Network to predict
future events
Recap - ML use cases in Retail

Process efficiency Revenue management Customer experience Targeted Marketing

● Predictive maintenance ● Price optimisation ● Recommender systems ● Customer segmentation


● Inventory management ● Store location ● Product recognition ● Propensity modelling
● Sentiment analysis ● Customer LTV
Discussion

+ What role does ML have in store front and enhancing the user experience of shopping?

+ How can ML improve the online shopping experience?

+ How to continue to do cutting edge ML in the face of changing attitude to privacy?


Helping retailers and e-commerce players
scale and innovate in machine learning,
e.g. around personalisation and pricing
Datatonic Case Study
Propensity modelling for a large retailer
Large UK Retailer
How can we leverage our
demographic and
transaction data to offer
customers a more
personalised shopping
experience?
Machine Learning enabled them to predict when a
customer would shop, and what they would buy...

TIMED & PERSONALISED


1 BRAND 1 MODEL
RECOMMENDATIONS

...but scalability was an issue.


The retailer needs to deliver faster
and more personal recommendations
across thousands of brands.
One campaign at a time

The Modelling team is spending valuable time


manually crafting and updating models, and
most time is spent in the data pre-processing
phase.

The Marketing team wants to deliver more


personalised communication (e.g. newsletters
with individually recommended brands) and
media activation.

Weeks of lead time


The Opportunity
We supported the retailer in personalising their campaigns through
advanced propensity modelling

Historical data Prediction Activation

Brand Brand
X? Y? Brand
Transactional Z?

Browsing

Demographics
+ How likely is each + Personalised content
customer to buy each + Better targeting
brand?
Through automation, machine
learning, and cloud scale we built
a full end-to-end pipeline
capable of generating billions of
propensity scores.
The single automated Brand Propensity Scoring
solution can scale to more than thousands of
brands.

Title Text

+3% 100x 1000x


Better Faster More
PREDICTION ACCURACY PIPELINE SPEED SCALABLE
A/B testing through a personalised email campaign showed
positive uplift in click-through-rate.

From: "Retailer" <[email protected]>


Date: 23 Apr 2018 14:50
Subject: New arrivals from Brand X
To: <[email protected]>
Brand X

Retailer
Retailer membership number: 12345678

NEW BRAND X FRAGRANCE


Workshop: Metadata enrichment
Section Overview
- Google Cloud AI 15 mins
- Colab: Review comprehension 30 mins
Cloud AI building blocks
Speech-to-text - convert speech to text automatically

Vision - derive insights from images

Video - precise video analysis down to the frame

Speech and Vision APIs

Translation - dynamically translate between languages

Natural Language - reveal the structure and meaning of text

Text-to-speech - convert text to human-like speech


Cloud Vision API (live demo)

Try it yourself!

https://cloud.google.com/vision/
cloud.google.com/products/ai
Workshop: Metadata generation for music reviews using
Google’s Natural Language API

This workshop will introduce you to accessing Google Cloud resources


through the command line and python client libraries.

+ Load in some Pitchfork review data from a Cloud Storage bucket and explore
what it looks like

+ Connect to the Cloud Language AI through the python client library and see
how each API responds

+ Apply the API to the reviews, and examine the added value of the results
you get

+ Extension: explore the DIY alternative (spaCy), or do data science on the


results to understand the value added

pitchfork.com
goo.gl/zYWrm9
Colab: Metadata enrichment
Workshop: Metadata enrichment.ipynb
goo.gl/zYWrm9
Colab: Metadata enrichment
goo.gl/zYWrm9
Colab: Metadata enrichment
Workshop: Metadata enrichment.ipynb
goo.gl/zYWrm9
Colab: Metadata enrichment
Copy of Workshop: Metadata enrichment.ipynb
Colab: Metadata
Enrichment
Metadata Enrichment Workshop (Recap)

In this workshop we have used the Cloud Natural Language API to extract structured data from
text reviews, including:

+ Content classification

+ Syntactic analysis

+ Sentiment analysis

+ Entity analysis
Lunch Break
Plan for the day
9.15
Introduction to Machine Learning Overview of ML theory and context

10.00
ML in Retail Overview of different ML use cases in the Retail sector

11.00
Datatonic Case study Detailed Retail case study
11.20
Workshop: Metadata enrichment Generate structured information from unstructured data
12.30–
13.30
Tools of the trade Explore libraries, frameworks, infrastructure and resources for practical ML

14.45
ML on GCP Introduce the GCP products for ML as well as other infrastructure required
15.15
Workshop: live recommendation Train and deploy a complete TensorFlow pipeline

16.45
Close Recap
Tools of the Trade
ML in practise
What does a typical Machine Learning pipeline look like?

Model Final
Raw Data Design Training Model
What does a typical Machine Learning pipeline look like?

Feature
selection

Data Feature Model Optimization Final


Raw Data cleaning transforms Design Training & Validation Model

Feature
engineering
What does a typical Machine Learning pipeline look like?

Which and how much data do you Which type of ML problem What are you trying to predict?
have access to?
Feature is it?
selection

Data Feature Model Optimization Final


Raw Data cleaning transforms Design Training & Validation Model

Process your data to make it Feature Design and refine your ML Make your model
usable and informative engineering model production-ready
What does a typical Machine Learning pipeline look like?

Discover Deploy

Explore Test
Invent Integrate
Define Monitor
Discover Model Build Deploy

1 2 3 4 5

Define ML use cases Data exploration Select algorithm Data pipeline & Build ML model
Choose the right ML
feature engineering Develop the first iteration
Define specific ML use cases for Perform exploratory
Create the right of the ML model
the project analysis to understand the algorithm for the task
data features from raw data
for the ML task
Start
a new ML project

10 9 8 7 6
Monitor model Operationalize model Plan for deployment Present results Iterate ML model
Monitor deployed ML model Deploy and operationalize Prepare for deployment in Present results of the model in Refine the ML model to
and retrain or rebuild when ML model in production production a way that demonstrates its improve performance and
performance degrades value to stakeholders efficacy
Libraries & Frameworks
Try it out
1. Find Estimators
TensorFlow Estimators

tf.estimator tf.contrib

BaselineRegressor tf.contrib.estimator.RNNClassifier
LinearRegressor
BoostedTreesRegressor tf.contrib.factorization.GMM
DNNRegressor tf.contrib.factorization.KMeansClustering
DNNLinearCombinedRegressor tf.contrib.factorization.WALSMatrixFactorization

tf.contrib.gan.estimator.GANEstimator
tf.contrib.gan.estimator.StarGANEstimator

...or build your own tf.contrib.kernel_methods.KernelLinearClassifier


tf.estimator.Estimator
tf.contrib.timeseries.TimeSeriesRegressor
tf.contrib.timeseries.ARRegressor
tf.contrib.timeseries.StructuralEnsembleRegressor
2. Colab
Workshop: Introduction to Scikit-learn & Tensorflow

This workshop will introduce you to the scipy ecosystem to preprocess data, then scikit-learn and
TensorFlow's canned estimators to do machine learning.

+ Load the data with numpy and pandas

+ Unsupervised ML: Spectral Clustering with scipy and sklearn

+ Supervised ML: Recurrent Neural Network with tf.estimator


Workshop: Introduction to Scikit-learn & Tensorflow
phonemes
The data: spectrograms of phonemes

ord
rec
dio
Au
Spectrograms of phonemes

“Fujitsu” Frequencies
contained by
the signal
Workshop: Introduction to Scikit-learn & Tensorflow

The data: spectrograms of phonemes

+ The frequency domain is then discretized into 11


frequency bands

+ Our data corresponds to the amplitude of a particular


frequency band at a particular time (indicated by the color
intensity in the plot)

+ There are 85 examples for each of the 39 phonemes

frequency
+ We'll attempt to cluster the phonemes based on the
11
similarity of their time series, and also classify them
correctly. time

217
goo.gl/zYWrm9
Colab: Tools of the Trade
Tools of the Trade.ipynb
phoneme_train.csv
phoneme_test.csv
Colab: Tools of the Trade
goo.gl/zYWrm9
Colab: Tools of the Trade
Tools of the Trade.ipynb
goo.gl/zYWrm9
Colab: Tools of the Trade
Copy of Tools of the Trade.ipynb
Colab
Colab: Tools of the Trade (Recap)

+ Unsupervised learning approach: We have defined a correlation score


between phonemes, and used spectral clustering in sklearn to find groups of
phonemes that correlate well together.

+ Supervised learning approach: We have used the full spectrogram to predict


the phoneme as a categorical label (“vowel”, “voiceless”, “voiced”) with a
recurrent neural network model in Tensorflow
ML on GCP
Google Cloud Platform + Machine Learning
Google Cloud Platform + Machine Learning

Compute Engine

Kubernetes Engine

App Engine

ML Engine
Google Cloud Platform + Machine Learning

TPU / GPU

Compute Engine

Kubernetes Engine

App Engine

ML Engine
Google Cloud Platform + Machine Learning

Data Studio

Dataprep

Dataflow

Dataproc
Google Cloud Platform + Machine Learning

Data Studio

Dataprep

Dataflow

Dataproc

Composer
Google Cloud Platform + Machine Learning

Colab Source Repositories

Datalab
Google Cloud Platform + Machine Learning

Storage BigTable

Datastore Spanner

SQL BigQuery
Google Cloud Platform + Machine Learning

+ Linear regression
+ Logistic regression (binary and
multi-class)
+ K-means

In Alpha
+ Matrix Factorization
+ XGboost
+ Custom TF models

BigQuery ML
Google Cloud Platform + Machine Learning

AutoML
Speech and Vision APIs
Dialogflow
Google Cloud Platform + Machine Learning

AutoML Tables
Google Cloud Platform + Machine Learning
Workshop: live recommendation
Section Overview
- Prepare training data

BigQuery, Cloud Storage

- Train on a deep learning VM

Compute Engine, Cloud Source Repositories

- Serve model for online prediction

ML Engine
What you’ll build
Database Cloud Storage

Source code Serving API

VM

Call the API


Database Cloud Storage

DIY

Source code Serving API

VM

Call the API


Google Cloud Console
(demo)
Database Cloud Storage

Source code Serving API

VM

Call the API


What permissions does the VM need?
SELECT PROJECT NAVIGATION

CREATE A VM
YOUR VM
Database Cloud Storage

Where is the model written?

Source code Serving API

VM

Call the API


Need a special saved model format for serving
CTRL + C to interrupt training
Discover Model Build Deploy

1 2 3 4 5

Define ML use cases Data exploration Select algorithm Data pipeline & Build ML model
Choose the right ML
feature engineering Develop the first iteration
Define specific ML use cases for Perform exploratory
Create the right of the ML model
the project analysis to understand the algorithm for the task
data features from raw data
for the ML task
Start
a new ML project

10 9 8 7 6
Monitor model Operationalize model Plan for deployment Present results Iterate ML model
Monitor deployed ML model Deploy and operationalize Prepare for deployment in Present results of the model in Refine the ML model to
and retrain or rebuild when ML model in production production a way that demonstrates its improve performance and
performance degrades value to stakeholders efficacy
Recap
Recap - What can ML do?
Recap - There are only 3 tasks in ML

Predict Self-describe Optimize


(Supervised learning) (Unsupervised learning) (Maximize / Minimize)

OUTPUT OUTPUT OUTPUT


OUTPUT
OUTPUT
OUTPUT
= = OUTPUT

TARGET
Recap - When is Machine Learning useful?

There is something to learn There is sufficient data to learn it

If there is no underlying truth to uncover, ML A balance of complexity, noise, distribution and


cannot find it. Don’t assume all data form a number. This is why “ML is just glorified statistics”.
pattern.

It is currently unknown... … or it can’t be programmed easily

If someone knows it, they should just program it If you really need an AI to do it for you, then ML
conventionally! may be a good solution.
Recap - ML in Retail

Process efficiency Revenue management Customer experience Targeted Marketing

How can we optimise How can we maximise How can we enhance How can we target the
resource harnessing? revenue? customer experience? relevant customers?
Recap - Metadata enrichment workshop
Recap - ML in practice

Discover Deploy

Explore Test
Invent Integrate
Define Monitor
Recap - Tools of the trade
Recap - Tools of the trade workshop
Recap - Google Cloud Platform + ML
Recap - Live recommendation workshop

Database Cloud Storage

Source code Serving API

VM

Call the API


Don’t forget the materials

https://drive.google.com/drive/folders/163FogjEa9ZKGmI9BIBO
p-6p5lD7e1D3K
Discussion
What’s next?

GCP tools workshop Discover Machine Learning Use Case Deep-dive

Understand how to leverage Identify & prioritise the most Flesh out a specific use case &
Objective tools available on GCP to build impactful use case(s) for your define a plan for realising it
successful models business

+ Technical focus: + Structured brainstorm: + Technical focus:


Agenda + Big Query + Your challenges + Review available
+ Dataflow + How ML can support data
+ Map out the right
+ Datafusion + Data requirements
approach for building
+ Prioritisation of use & implementing your
cases model
Thanks!

You might also like