Prepare and test your skills
Prepare and test your skills
Supervised learning is a machine learning approach that trains a model on labeled data to map specific inputs to desired outputs. Each labeled example pairs an input with its correct answer, such as a class label for classification or a numeric value for regression. The quality, quantity, and consistency of those labels determine how well the model predicts new inputs.
Labeled data is the foundation of supervised learning because it shows the model the correct outputs to imitate. During training, the model compares its own prediction with the label and adjusts to reduce the difference. For classification or detection models, labels define the classes the model must recognize, such as “door” versus “door_with_knob.” Machines cannot understand label names on their own, so the examples must clearly show the visual or feature differences between similar labels. This input-to-output mapping supports predictive analytics and later fine-tuning for a specific task.
Training a supervised model creates a model whose quality is checked with evaluation metrics such as precision and recall. Precision and recall help debug a model that does not meet expectations after training on AutoML (opens in a new tab) data. Low precision and recall often mean the model needs more training data or has inconsistent labels. Perfect precision and recall can mean the test data is too easy and the results may not generalize to new data. After changing the training data, a new model can be trained and its metrics compared with the existing model.
Exam tip: Low precision and recall often point to insufficient or inconsistent labeled data, while perfect precision and recall can mean the test set is too easy to generalize from.
Data splits for supervised training commonly separate data into training, validation, and test sets. The training set teaches the model, the validation set checks progress during development, and the test set measures final performance on unseen data. For AutoML models, Agent Platform randomly assigns items to each set by default, so near-duplicate examples can end up in both training and validation. That overlap can cause overfitting, where the model performs well on training data but poorly on new data. To prevent this, teams can specify their own data split, and they can use a confusion matrix to see if the model confuses two labels or predicts one label far more often than its true frequency.
Improving labeled data for classification and detection models often improves the model itself because the model learns directly from those examples. Data flows from the labeled dataset into the training algorithm, and the algorithm returns a model whose predictions depend on the range and correctness of the examples. Reviewing labeled examples for correctness helps fix confusion revealed by evaluation:
Monitoring and deploying a trained model is the final stage after the training pipeline finishes. The trained model appears in the Agent Platform section of the Google Cloud console on the Models page. Training progress can be tracked in order:
Only after the model is ready, the model can be deployed to an endpoint for predictions, and hyperparameter tuning jobs can be created to improve training.
Unsupervised learning is a machine learning approach that finds inherent structure and patterns in unlabeled data. Unlabeled data has no correct answers provided in advance, so the model learns only from features and relationships inside the data. Data flows from a raw dataset into the learning algorithm, and the algorithm returns groups, themes, or rules that describe how the data is organized.
Unsupervised learning with unlabeled data discovers similarity, difference, and co-occurrence without human-provided categories. The algorithm compares examples to each other, measures how alike or different they are, and forms its own organization of the dataset. Because there is no labeled target to check against, success is judged by whether the discovered patterns are meaningful, stable, and useful for later work. Choose unsupervised learning when labels are missing, too costly to create, or when the first goal is to explore what is in the data before making predictions.
Clustering is an unsupervised technique that groups similar examples together into clusters based on shared characteristics. Data flows from the unlabeled dataset to the clustering algorithm, and the algorithm assigns each example to a cluster where members are more similar to each other than to members of other clusters. The boundary between clusters is learned from the data, not defined in advance, so the number and shape of groups depend on patterns in the features. Common uses include customer segmentation, grouping similar documents or images, and detecting unusual behavior that does not fit any large group.
Exploration with clustering often supports practical next steps:
These groups give teams a starting map of the data that can guide labeling, feature design, or further modeling.
Association is an unsupervised technique that finds rules about items or events that tend to occur together. Data flows from collections of transactions or records into the association method, and the method returns patterns such as if a shopper buys bread, the shopper often also buys butter. The relationship links the antecedent on one side to the consequent on the other side, with strength based on how often they co-occur. Because the patterns come from observed combinations, they describe correlation in past data rather than proven cause and effect. Choose association when the question is what goes with what, such as products bought together, symptoms seen together, or pages visited in the same session.
The role of unsupervised learning in data exploration and foundation models is to learn general structure from large amounts of unlabeled data. In exploration, clustering and association summarize raw data, reveal hidden themes, and help teams decide what to label or which problems are worth solving with supervised learning. In foundation models, a similar idea scales up: the model trains on vast unlabeled collections of text, images, or other data and learns general representations of language, structure, and context for generative AI applications (opens in a new tab). That learned representation then becomes the foundation that later tuning and supervised methods depend on for specific tasks.
The two main pattern-discovery methods differ by the kind of structure they return:
| Method | What it finds | Use when |
|---|---|---|
| Clustering | Groups of similar examples | The need is to segment data into natural categories |
| Association | Rules linking items that co-occur | The need is to find combinations that appear together |
Exam tip: Clustering answers which examples belong together, while association answers which items appear together in the same transaction or record.
Reinforcement learning (opens in a new tab) is a machine learning framework in which an agent learns by interacting with an environment to maximize cumulative reward. The agent takes actions in the environment, the environment returns feedback in the form of rewards or penalties, and the agent adjusts its behavior to earn more reward over time. This feedback loop of action, feedback, and adjustment is what drives learning, rather than imitating labeled examples.
Agents, environments, and cumulative rewards are the three core parts of the reinforcement learning framework. The agent is the learner that chooses actions, the environment is the system the agent acts upon, and the reward signal tells the agent how good each outcome was. The agent’s goal is not just the next reward but the total cumulative reward over many steps, so it must balance short-term gains against long-term outcomes. The environment depends on the agent’s actions for its next state, and the agent depends on the environment’s rewards to improve its policy.
Feedback loops and human feedback extend reinforcement learning to optimize model performance and safety. In a basic loop, behavior flows from the agent to the environment, and reward feedback flows from the environment back to the agent to shape future behavior. Reinforcement Learning from Human Feedback (RLHF) adds human judgment to that loop, so human preferences guide the reward signal toward helpful, accurate, and safe outputs. Choose this approach when model behavior must be aligned with human values and safety requirements, not just raw task performance.
Supervised, unsupervised, and reinforcement learning differ by what guides learning: correct answers, inherent structure, or reward feedback. Supervised learning depends on labeled data to map inputs to classification labels or regression values. Unsupervised learning depends on unlabeled data to return clusters of similar examples or association rules for co-occurring items. Reinforcement learning depends on an agent-environment loop where rewards, including human feedback, shape behavior toward higher cumulative reward and safer performance.
Supervised learning trains a model on labeled data to map inputs to classification labels or regression values, unsupervised learning finds inherent structure in unlabeled data as clusters of similar examples or association rules for co-occurring items, and reinforcement learning trains an agent through interaction with an environment to maximize cumulative reward. Supervised learning is guided by correct answers, unsupervised learning by inherent structure, and reinforcement learning by reward feedback.
Clustering is for segmenting data into natural categories of similar examples, while association is for finding rules linking items that co-occur in the same transaction or record. Clustering answers which examples belong together, such as customer segments or grouped documents, while association answers which items appear together, such as products bought together.
Low precision and recall often point to insufficient or inconsistent labeled data, while perfect precision and recall can mean the test data is too easy to generalize from. Low results may mean the model needs more training data, and perfect results may not generalize to new data.
Reinforcement Learning from Human Feedback (RLHF) adds human judgment to the reinforcement learning feedback loop so human preferences guide the reward signal toward helpful, accurate, and safe outputs. Use it when model behavior must be aligned with human values and safety requirements, not just raw task performance.
A retail company has gathered a massive collection of customer feedback, purchase histories, and support inquiries that lack explicit categories or labels. The data science team wants to explore natural groupings within the data to segment customers and discover underlying themes before using the raw text to pre-train a foundation model.
Which machine learning approach is designed to discover inherent patterns and structures in unlabeled data?
Reinforcement learning
Supervised learning
Reinforcement Learning from Human Feedback (RLHF)
Unsupervised learning
Last updated