GCP-102 · Lesson 5 of 12 · 19 min
AI and machine learning for business
▶ Video coming soon A video version of this lesson is on the way.
By November, every department at Birchline wanted to talk about AI. Jules wanted a shopping assistant on the website that could answer questions such as "which sleeping bag is warm enough for a late-September trip in the mountains?" The customer service team wanted help sorting thousands of emails. The buying team wanted better demand forecasts so that stores stopped running out of popular tents in June and drowning in unsold snowshoes in March. Dana wanted to know what any of it would cost and how Birchline would know it was working. Farah asked Owen to sit in on the meetings and help turn the excitement into a short list of sensible projects. This lesson follows that work and covers what the Cloud Digital Leader exam expects about AI: the core ideas, the business problems AI can solve, the importance of data, responsible use, and how to choose between Google Cloud's AI offerings.
AI, machine learning, generative AI and agents
Artificial intelligence (AI) is the broad field of building computer systems that perform tasks normally associated with human intelligence, such as understanding language, recognizing images, making predictions and planning. Machine learning (ML) is the main approach used in modern AI: instead of a programmer writing every rule, a system learns patterns from examples. Shown thousands of past sales together with the weather, holidays and promotions at the time, an ML model can learn to predict next week's sales.
Generative AI is a kind of AI that creates new content, such as text, images, code or audio, in response to a prompt. It is powered by very large models trained on huge amounts of data, often called foundation models; Google's Gemini models are an example. Agentic AI goes a step further. An AI agent is a system that can pursue a goal by planning steps, using tools such as search, databases or other applications, and acting on the results, with some degree of autonomy. A chatbot that answers a question is generative AI; a system that reads a customer's return request, checks the order, applies the returns policy, issues a shipping label and updates the order record is agentic.
It is equally important to know what AI is not. Data analytics examines data to describe what happened and why, such as last month's sales by region. Business intelligence (BI) packages analytics into dashboards and reports for decision makers, as Looker does. Both describe and explain the past using rules and queries that people write. ML predicts or generates using patterns it has learned. A useful test is to ask whether the system follows rules someone wrote (analytics and BI) or learned its behaviour from examples (ML).
| Term | What it does | Birchline example |
|---|---|---|
| Data analytics | Describes and explains what happened | Tent sales by region last summer |
| Business intelligence | Presents analytics to decision makers | The regional managers' Looker dashboard |
| Machine learning | Learns patterns to predict or classify | Forecasting next week's demand per store |
| Generative AI | Creates new content from a prompt | Drafting product descriptions |
| Agentic AI | Plans and takes actions with tools towards a goal | Handling a return from request to refund |
Business problems ML can solve
ML is worth using when a problem involves patterns too complex or too numerous for people to write rules for, when there is enough good data to learn from, and when the answer can be checked. Common categories include forecasting (demand, staffing, cash flow), classification (is this email a complaint, a question or an order change?), recommendation (customers who bought this also bought), anomaly detection (this payment looks unlike the customer's normal behaviour), image and document understanding (read the supplier's invoice, check a photo of damaged goods) and personalization (show each shopper the products most relevant to them). Generative AI adds content creation, summarization, conversation and search over an organization's own documents.
The business value usually falls into a few buckets: saving time on repetitive work, making better predictions than people or simple rules can, scaling a service without scaling headcount at the same rate, and creating new experiences for customers. Farah's shortlist for Birchline had three items: demand forecasting for stores (better predictions), sorting and drafting replies to customer emails (saving time), and the shopping assistant (a new customer experience). For each, Dana asked for one measurable outcome: fewer stockouts, shorter email response times, and a higher share of website visitors who buy.
Data quality decides model quality
An ML model can only be as good as the data it learns from. Lesson 3's six quality dimensions matter even more here. Incomplete data leaves the model blind to some situations; duplicated records make some patterns look more common than they are; late data means predictions based on yesterday's world; invalid or inaccurate values teach the model wrong lessons; and inconsistent definitions across systems mean the model learns a muddle. A demand forecast trained on sales data that silently drops returns will consistently over-order products that customers send back.
Training data must also represent the situations the model will face. Birchline's sales history is dominated by its large urban stores, so a model trained on it may forecast poorly for small rural stores unless the team checks performance store by store. Data used for AI also raises privacy questions: customer emails used to train an email classifier contain personal information, and Canadian privacy law and Birchline's own privacy policy govern whether and how they may be used.
# Checking a demand model: invented forecast and actual weekly sales for four stores.
stores = {"Downtown": (420, 400), "Lakeside": (260, 275), "Highway mall": (310, 300), "Small town": (60, 95)}
for name, (forecast, actual) in stores.items():
error = abs(forecast - actual) / actual
print(f"{name:13} forecast {forecast:4} actual {actual:4} off by {round(error * 100):3} in 100")
overall = sum(abs(f - a) for f, a in stores.values()) / sum(a for f, a in stores.values())
print("Overall the forecast is off by about", round(overall * 100), "units in every 100 sold")Downtown forecast 420 actual 400 off by 5 in 100 Lakeside forecast 260 actual 275 off by 5 in 100 Highway mall forecast 310 actual 300 off by 3 in 100 Small town forecast 60 actual 95 off by 37 in 100 Overall the forecast is off by about 7 units in every 100 sold
What this code does
For each store, the gap between forecast and actual sales is divided by actual sales to show how far off the forecast was, out of every 100 units sold. The program then works out the overall error across all stores. The small-town store is off by 37 in 100, which points to where the demand model needs work.
The overall figure looks respectable, but the small-town store is badly under-forecast. Averages hide exactly the kind of uneven performance that responsible AI practice asks teams to look for.
Explainable and responsible AI
Explainable AI refers to methods that help people understand why a model produced a particular output, for example which factors most influenced a forecast or a loan decision. Explanations build trust, help teams find errors and are sometimes required by regulators or customers. Responsible AI is the broader practice of building and using AI so that it is fair, safe, private, secure, transparent and accountable. Google publishes its own AI principles, and the exam expects you to recognize the general themes: avoid creating or reinforcing unfair bias, test for safety, protect privacy, keep people accountable for decisions and be open about where AI is used.
For Birchline, responsible AI is practical rather than abstract. The shopping assistant must not invent product specifications, so it will answer only from Birchline's own catalogue and say when it does not know. Email drafts will be reviewed by an agent before they are sent. The forecast will be checked for every store, not just on average. And customers will be told when they are talking to an AI assistant. Generative models can produce fluent but wrong answers, often called hallucinations, and grounding them in an organization's own trusted data is one of the main ways to reduce that risk.
Choosing an approach: pre-trained, low-code or custom
Google Cloud offers AI at several levels, and the exam guide lists the factors that should drive the choice: speed of implementation, development effort, differentiation (does a custom model give a real competitive edge?), the expertise available in the team, and the choice and flexibility needed. At one end, ready-made models and APIs can be used in days with little ML skill but offer no special advantage, because competitors can use the same ones. At the other end, custom models take longer and need specialists but can be tuned to an organization's own data and problems.
| Approach | Effort and skill | Differentiation | Google Cloud examples |
|---|---|---|---|
| Pre-trained APIs and models | Lowest; call an API | Low; others can use the same | Vision API, Cloud Translation API, Speech-to-Text API, Gemini models |
| Low-code and AutoML | Moderate; bring labelled data | Medium; trained on your data | AutoML on the Agent Platform, BigQuery ML |
| Custom models and agents | Highest; ML and engineering skills | High; built for your problem | Agent Studio and custom training on the Agent Platform |
Pre-trained APIs solve common problems out of the box: the Vision API labels images and reads text in them, the Cloud Translation API translates between languages, the Speech-to-Text API transcribes audio, and Gemini models generate and understand text, images and more. BigQuery ML lets analysts build and run ML models using SQL inside BigQuery, which is ideal when the data is already there and the team knows SQL but not Python. AutoML trains a model on an organization's own labelled data without the team having to design the model itself.
Google brings these together in an all-in-one platform for building with models and agents. The current exam guide calls it the Gemini Enterprise Agent Platform; earlier Google materials and many existing courses refer to the same family of tools as Vertex AI. It provides access to Google's first-party models and partner models, tools such as Agent Studio for building agents and custom models, AutoML, and the services to deploy, monitor and govern them. Underneath sits the AI Hypercomputer, Google's integrated AI infrastructure of GPUs, Google-designed Tensor Processing Units (TPUs), software and flexible ways to pay for capacity. Most digital leaders never touch that layer directly, but it explains why Google emphasizes AI infrastructure as a strength.
Birchline's choices followed the ladder. Email sorting and draft replies use Gemini models through the platform, grounded in Birchline's policies, because the need is common and speed matters. Demand forecasting starts with BigQuery ML, because the sales history is already in BigQuery and Ravi's analysts know SQL. The shopping assistant is the one place Birchline wants differentiation, so it is built as an agent on the platform, connected to the product catalogue and stock levels, with Jules's team owning the experience.
Common mistakes
MistakeCalling a dashboard AI.
InsteadDashboards and reports are BI; AI learns from examples to predict, classify or generate.
MistakeStarting with a custom model for a common problem.
InsteadTry pre-trained APIs or models first; build custom only where it creates real differentiation.
MistakeJudging a model by its overall average.
InsteadCheck performance for important groups, such as each store or customer segment.
MistakeLetting a generative model answer from general knowledge alone.
InsteadGround it in the organization's own trusted data and have it say when it does not know.
Measuring whether AI is working
Dana's question about how Birchline would know an AI project was working deserves its own answer, because many AI projects stall after an impressive demonstration. Farah's rule is to agree three things before any build starts. First, a business measure: the outcome the project exists to change, such as fewer stockouts in the top hundred products or a shorter average reply time to customer emails. Second, a baseline: the value of that measure today, measured honestly over enough weeks to smooth out normal ups and downs. Third, a decision point: a date and a threshold at which the team will either expand the project, change it or stop it.
Technical measures, such as how often the email classifier picks the right category, matter too, but they are means rather than ends. A classifier that is right nine times in ten creates no value if staff do not trust it and re-sort every email by hand. That is why Birchline's pilots include the people who will use the results, gather their feedback weekly and track adoption alongside accuracy. Projects that cannot name a business measure go to the bottom of the list, however exciting the technology looks.
Worked problem
Choosing an AI approach
The customer service team receives about 3,000 emails a week and wants each one sorted into returns, order changes, product questions and complaints. The team has no ML specialists and wants results within a month. Which approach fits?
Show solution
- The problem, sorting text into a few categories, is common and well handled by existing models.
- Speed matters and the team lacks ML expertise, which rules out a fully custom model.
- Differentiation is low: sorting emails is not what makes Birchline special.
Answer: Use a pre-trained generative model such as Gemini through Google's agent platform, given clear category definitions and examples, with staff reviewing the results at first.
Summary and key terms
- AI is the broad field; machine learning learns patterns from examples; generative AI creates content; agentic AI plans and acts with tools.
- Analytics and BI describe the past with rules people write.
- ML suits forecasting, classification, recommendation, anomaly detection and personalization.
- Model quality depends on data quality and representative data.
- Responsible AI aims for fair, safe, private, transparent and accountable systems, and grounding reduces hallucinations.
- Choose between pre-trained APIs, low-code tools such as AutoML and BigQuery ML, and custom models and agents on the Gemini Enterprise Agent Platform by weighing speed, effort, differentiation, expertise and flexibility.
- Machine learning
- Building systems that learn patterns from examples instead of following hand-written rules.
- Generative AI
- AI that creates new content such as text, images or code.
- AI agent
- A system that plans steps and uses tools to pursue a goal.
- Explainable AI
- Methods that show why a model produced an output.
- Hallucination
- A fluent but incorrect output from a generative model.
- BigQuery ML
- Building and running ML models with SQL inside BigQuery.
- AutoML
- Training a model on your own labelled data without designing the model yourself.
- TPU
- Tensor Processing Unit, Google's custom chip for ML workloads.
Practice problems
Work each problem on paper first, then reveal the answer to check.
How does an AI agent differ from a chatbot that answers questions?
Show answer
An agent can plan steps and use tools, such as databases or other applications, to take actions towards a goal.
When does a custom model make more sense than a pre-trained API?
Show answer
When the problem is specific to the organization and a tailored model creates real competitive advantage, and the team has the expertise and time.
Why should a demand forecast be checked store by store?
Show answer
Because a good average can hide poor performance for some stores, especially those under-represented in the training data.
Lesson quiz · 5 questions
Score 60% or more to complete this lesson.
Create a free account to save your progress, take quizzes and earn a certificate.