Prepare and test your skills

Prepare and test your skills

Pattern discovery and unstructured data insights are two types of problems where machine learning (ML) (opens in a new tab) succeeds when fixed rules do not. Pattern discovery finds hidden structure in data without predefined labels, while unstructured data insights turn speech, text, images, video, and documents into usable information. Together they let a business group customers by natural behavior and extract meaning from sources that do not fit neatly in a database.
Clustering is a descriptive ML approach that finds natural groupings in unlabeled data without being told the correct answers in advance. Customer data flows into the clustering model, and the model returns groups of similar customers based on shared behavior or characteristics. This is different from classification, which assigns data to already-known types, and from predictive modeling, which forecasts a future outcome. For example, Customer Experience Insights detects and visualizes patterns in contact center data, helping a business discover themes in calls and chats that were not defined ahead of time.
Pre-trained models for speech and text turn spoken and written language into structured information without requiring custom model training. Audio flows from an application to Speech-to-Text, which returns recognized text for analysis, and text flows to Cloud Natural Language API, which returns categories, entities, and sentiment. Text can then flow to Cloud Translation for dynamic translation into another language or to Text-to-Speech to convert written text into natural-sounding speech for voice responses. Conversational tools build on these capabilities, including Dialogflow CX for complex virtual agents, Dialogflow ES for standard conversational interfaces, and Agent Assist to support human agents during live conversations.
| API | Input source | What it returns |
|---|---|---|
| Speech-to-Text | Spoken audio in applications | Recognized text for analysis |
| Cloud Natural Language API | Plain text or HTML documents | Categories, entities, and language understanding |
| Cloud Translation | Text needing translation | Translated text in another language |
| Text-to-Speech | Written text | Natural-sounding speech audio |
Exam tip: Use Speech-to-Text to turn voice into text for analysis, and use Text-to-Speech to turn text into voice for playback — the direction of the flow determines the choice.
Pre-trained models for vision process image and video streams at scale without custom model training. An image flows to Cloud Vision, which returns detections such as image labels and face detection, while a video file or live stream flows to Video Intelligence API, which returns contextual annotation describing what appears across frames. These outputs turn pixels that rules cannot easily describe into fields a business can search, count, and act on. Choose Cloud Vision when the question is what is in a single image, and choose Video Intelligence API when the question is what happens across video.
Document AI (opens in a new tab) is a document processing platform that transforms unstructured data from documents into structured data for a database. A document file flows to a Document AI processor, the processor applies an ML model, and the service returns one or more Document objects containing extracted fields and entities. Document AI can digitize documents with optical character recognition (OCR), extract text and normalized entities, identify key-value pairs such as Name: Jill Smith, classify document types, and split a file that contains multiple real documents. A processor sits between the document file and the ML model, and each Google Cloud project must create its own processor instances.
Processors fall into three categories: Digitize for OCR, Extract for custom extractors, Form Parser, layout parser, and pretrained parsers, and Classify for custom classifiers and custom splitters. All processors can extract text and layout information, and results can flow to Cloud Storage, BigQuery, and Agent Search to store, search, organize, govern, and analyze documents and metadata. Use Document AI in this order:
Classification problems are a type of traditional AI where the goal is to assign data to discrete categories. A traditional classification model learns from historical tabular data and images to recognize patterns and place new data into the correct category. This approach fits when rule-based programming is insufficient because the rules are too complex or change too often to write by hand.
Traditional classification is different from regression and from generative AI (opens in a new tab). Regression predicts a continuous number such as a house price, while generative AI creates new content such as text, images, or video. Classification instead answers which group something belongs to, such as spam or not spam.
A classification model learns from labeled historical examples and then applies what it learned to new, unseen data. Training data provides examples of each category, such as past emails already marked as spam or not spam, so the model learns the patterns that separate the categories. Once trained, the model can classify new emails, transactions, or images in real time without a person writing a rule for every case. The model depends on the quality and completeness of the historical data, and its output is a discrete label rather than newly generated content.
Binary classification assigns data to exactly two categories, while multi-class classification assigns data to three or more categories. Binary classification decides between two outcomes, such as fraudulent versus legitimate or defective versus good. Multi-class classification extends the same idea to more choices, such as assigning a product review to positive, neutral, or negative sentiment.
Common business scenarios for classification include:
In each scenario, data flows from the source record, document, or image to the trained model, and the model returns a category label to the business workflow. The workflow then depends on that label to act, such as blocking spam, flagging a transaction for review, or routing a defective product for inspection.
Classification and regression both learn from historical data, but they produce different types of outputs for different business questions. Classification returns a discrete category label, while regression returns a continuous numerical value. The choice depends on what the business needs to decide.
| Task type | Output type | Example |
|---|---|---|
| Classification | Discrete category label | Email is spam or not spam; product is good or defective |
| Regression | Continuous numerical value | Predicted house price based on house features and location |
Exam tip: Classification predicts a discrete category like spam or not spam, while regression predicts a continuous number like a house price.
Regression is a predictive modeling technique that estimates a continuous numerical outcome from historical data. It is useful when the relationship between inputs and a numerical result is too complex to capture with fixed rules. In Google Cloud, BigQuery ML (opens in a new tab) supports regression by allowing models to be trained, evaluated, and used for prediction with SQL or BigQuery DataFrames.
Regression solves business problems where the target is a continuous number rather than a category. Examples include forecasting retail inventory demand, estimating future revenue, and determining optimal real estate pricing based on historical trends. These problems require learning patterns between input data and a numerical result, then producing a predicted value that guides planning, budgeting, or pricing. Regression is predictive rather than descriptive because it estimates a future or unknown numerical outcome instead of only summarizing what already happened.
The BigQuery ML regression workflow moves from training to evaluation to prediction in a fixed order. Training learns historical patterns, evaluation checks accuracy on data, and prediction generates new numerical values for business decisions. The workflow follows this sequence:
bigframes.bigquery.ml.predict BigQuery DataFrames function to generate numerical values for new input data.Evaluation of regression checks how closely predicted values match actual values in BigQuery ML. The ML.EVALUATE function or the bigframes.bigquery.ml.evaluate BigQuery DataFrames function compares predictions against actual values using a dataset that matches the training schema. If ML.EVALUATE is run without input data, it retrieves metrics calculated during training using the automatically reserved evaluation dataset. For linear regression, evaluation results include these metrics:
mean_absolute_errormean_squared_errormean_squared_log_errormedian_absolute_errorr2_scoreexplained_varianceThe R² score is a key metric for linear regression quality. A value of 0 means the model explains none of the variability of the response data around the mean, while a value of 1 means it explains all of that variability. Higher R² generally indicates that the linear regression predictions approximate the actual data more closely.
Inference is the process of using a trained model to generate predictions for new data. A trained model can serve inference in two modes, but forecasting models support only one of them. The mode determines whether predictions return immediately or as a large set.
| Inference mode | How it works | Best for |
|---|---|---|
| Batch inference | Asynchronous; processes many requests at once and returns a CSV file or BigQuery table with inference values. | Large sets of predictions that do not need an immediate answer. |
| Online inference | Synchronous and real-time; deploys the model behind a REST API, accepts one request per API call, and returns a prediction quickly. | Applications where other parts of the system depend on a fast prediction. |
Exam tip: Online inference is not available for forecasting models, so forecasting use cases must rely on batch inference.
Regression is the right choice when the business requirement is to predict a continuous numerical outcome from historical data. It fits questions such as how many units will be demanded, how much revenue will be generated, or what price is optimal. To connect the model to business value, performance metrics should be aligned with business key performance indicators (KPIs) such as increasing revenue, reducing costs, or mitigating risk. This alignment helps show whether the numerical predictions actually support the organization's goals.
A decision tree that branches on the question being asked — grouping, categorizing, predicting a number, or processing unstructured data — to choose the matching ML approach such as clustering, classification, or regression.
Classification assigns new data to discrete categories such as spam or not spam, while regression estimates a continuous numerical outcome such as house price, demand, revenue, or optimal pricing. Both learn from historical data, and the choice depends on whether the business needs a category label or a numerical value.
Use Cloud Vision when the question is what is in a single image, and use Video Intelligence API when the question is what happens across video. An image flows to Cloud Vision, which returns detections such as image labels and face detection, while a video file or live stream flows to Video Intelligence API, which returns contextual annotation describing what appears across frames.
Speech-to-Text turns spoken audio in applications into recognized text for analysis, while Text-to-Speech converts written text into natural-sounding speech audio for voice responses. The direction of the flow determines the choice.
Document AI uses a processor between the document file and the machine learning model to return one or more Document objects containing extracted fields and entities. A document file flows to a Document AI processor, the processor applies a machine learning model, and results can flow to Cloud Storage, BigQuery, and Agent Search to store, search, organize, govern, and analyze documents and metadata.
A financial services company wants to use machine learning on historical labeled data for two projects:
Which option correctly matches each project to the type of machine learning problem it represents?
Project 1 is multi-class classification, and Project 2 is binary classification
Project 1 is regression, and Project 2 is multi-class classification
Project 1 is binary classification, and Project 2 is multi-class classification
Both projects are binary classification because they each assign a single label to each record
Last updated