This chapter covers the three core categories of AI workloads: prediction, classification, and generation. These are fundamental to understanding how Azure AI services are applied to real-world problems. On the AI-900 exam, roughly 20-25% of questions test your ability to distinguish between these use cases, identify appropriate Azure services for each, and recognize common scenarios. Mastering this chapter will give you a strong foundation for the rest of the exam.
Jump to a section
Imagine a chef's kitchen with three distinct stations. The prediction station is like a sous-chef who monitors ingredient levels and forecasts when supplies will run low. Using historical data (e.g., 50 kg of flour used per week), the sous-chef predicts it will run out in 3 days and orders more. This is regression: forecasting a numerical value. The classification station is like a line cook who sorts incoming ingredients into bins: 'fresh', 'ripe', or 'spoiled'. The cook uses features like color, firmness, and smell to categorize each item. This is classification: assigning a discrete label. The generation station is like a pastry chef who creates new dessert recipes. Given a list of available ingredients (e.g., chocolate, cream, sugar), the chef produces a novel recipe that has never existed before. This is generative AI: creating new content. The chef (the AI system) uses different tools (models) for each task. The key mechanistic detail: prediction uses past data to estimate a continuous value; classification uses decision boundaries to assign categories; generation uses probabilistic models to produce new data that resembles training examples. In Azure, these map to Anomaly Detector (regression), Custom Vision (classification), and OpenAI (generation).
What Are AI Use Cases?
Artificial Intelligence workloads can be broadly grouped into three categories: prediction, classification, and generation. Each corresponds to a different type of task an AI model performs. The AI-900 exam expects you to identify which category a given scenario falls into and which Azure service is best suited for it.
Prediction (Regression)
Prediction, also known as regression, involves forecasting a continuous numerical value based on input data. For example, predicting tomorrow's temperature, next month's sales, or the price of a house. The model learns relationships between features (e.g., square footage, number of bedrooms) and a target variable (e.g., price). It outputs a real number.
How it works: A regression model, such as linear regression or decision tree regression, is trained on historical data. The model minimizes error between predicted and actual values using loss functions like mean squared error (MSE). During inference, the model takes new input features and computes a predicted value.
Azure services: Azure Machine Learning (AutoML) can train regression models. Azure Anomaly Detector uses regression-like techniques to detect unusual values in time series data.
Exam tip: Look for keywords like 'forecast', 'estimate', 'predict a number', 'continuous value'. The exam may ask you to differentiate regression from classification.
Classification
Classification assigns input data to one or more predefined categories or classes. For example, classifying emails as 'spam' or 'not spam', or identifying objects in an image as 'cat', 'dog', or 'bird'. The output is a discrete label, not a number.
How it works: A classification model learns decision boundaries between classes. Common algorithms include logistic regression, support vector machines (SVM), and neural networks. For multi-class problems, the model outputs a probability distribution over classes and picks the one with highest probability.
Types: Binary classification (two classes), multi-class classification (more than two classes), multi-label classification (multiple labels per instance).
Azure services: Azure Custom Vision, Azure Form Recognizer (document classification), Azure Cognitive Services for text classification (e.g., Content Moderator). Azure Machine Learning also supports classification models.
Exam tip: Classification answers questions like 'Is this A or B?' or 'What category does this belong to?' The exam may test multi-class vs. multi-label.
Generation
Generation involves creating new content that is similar to but not identical to the training data. This is the realm of generative AI, including text generation, image generation, code generation, and more. Models like GPT (Generative Pre-trained Transformer) and DALL-E are examples.
How it works: Generative models learn the underlying distribution of the training data. For text, a language model predicts the next word given previous words, generating coherent sentences. For images, diffusion models gradually denoise random noise to produce an image matching a prompt.
Azure services: Azure OpenAI Service (GPT-4, GPT-3.5, DALL-E, Embeddings), Azure Cognitive Services for speech synthesis (Text-to-Speech).
Exam tip: Generation is about creating new content, not analyzing or predicting. The exam may ask you to distinguish generation from classification or prediction. Look for words like 'create', 'generate', 'write', 'draw', 'compose'.
Comparing the Three
Prediction: Output is a number. Use case: forecasting demand.
Classification: Output is a label. Use case: detecting fraud (fraud/not fraud).
Generation: Output is new content. Use case: writing a product description.
Key Components and Values
Regression metrics: R-squared, Mean Absolute Error (MAE), Root Mean Squared Error (RMSE). In Azure AutoML, you can set the primary metric.
Classification metrics: Accuracy, Precision, Recall, F1 Score, AUC-ROC. For imbalanced data, use precision/recall.
Generation metrics: Perplexity (for language models), Inception Score (for images), BLEU score (for translation). However, these are less commonly tested on AI-900.
Defaults: In Azure Cognitive Services, many APIs have default confidence thresholds (e.g., 0.5 for binary classification). You can adjust these.
Configuration and Verification
- Azure Machine Learning: To create a regression model, use az ml job create --file regression.yaml. Example YAML:
$schema: https://azuremlschemas.azureedge.net/latest/commandJob.schema.json
command: python train.py --data ${{inputs.training_data}}
inputs:
training_data:
type: uri_folder
path: azureml:my_data:1
environment: azureml:AzureML-sklearn-0.24-ubuntu18.04-py37-cpu:1
compute: azureml:my-compute-clusterCustom Vision: Train a classifier with a few lines of code using the SDK. project.create_classification_project(name="MyProject", domain="General").
Azure OpenAI: Deploy a model via az cognitiveservices account deployment create --name MyDeployment --model-name gpt-35-turbo --model-version 0613.
How They Interact
In a complex system, these workloads can combine. For example, a chatbot may use classification to understand intent, prediction to estimate user satisfaction, and generation to craft a response. The exam tests your ability to pick the right service for each subtask.
Trap Patterns
Confusing regression with classification: If the output is a continuous number, it's prediction; if it's a category, it's classification.
Thinking generation is only for text: It includes images, audio, code, etc.
Assuming Azure OpenAI is only for generation: It can also do classification (e.g., sentiment analysis via prompt engineering), but the exam typically treats it as generative.
Mixing up Azure Anomaly Detector (prediction of anomalies) with Azure Cognitive Services for anomaly detection in images (classification).
Detailed Step-by-Step Mechanism
Let's walk through a prediction use case: forecasting sales using Azure Machine Learning AutoML.
Data Preparation: Collect historical sales data with features like date, price, promotions, etc. Split into training and test sets. Azure ML expects data in tabular format (CSV, Parquet).
Training: AutoML tries multiple regression algorithms (Linear Regression, Random Forest, LightGBM, XGBoost) with hyperparameter tuning. It uses cross-validation (default 5 folds) to evaluate performance.
Model Selection: The best model based on the primary metric (e.g., normalized RMSE) is selected. You can view the leaderboard.
Deployment: The model is deployed as a real-time endpoint on Azure Container Instances or Kubernetes. The endpoint URL can be called via REST API.
Inference: Send new data (e.g., next month's features) to the endpoint. The response includes the predicted sales number and optionally the confidence interval.
For classification, the steps are similar but the output is a label and probabilities. For generation, the process differs: you use a pre-trained model (e.g., GPT-4) and provide a prompt; the model generates text autoregressively.
Exam-Relevant Details
Azure Cognitive Services includes pre-built models for classification (e.g., Computer Vision for image classification, Text Analytics for sentiment). These are easy to use without training.
Azure Custom Vision allows you to train custom image classifiers with your own data.
Azure Form Recognizer can classify documents into types (invoice, receipt, etc.).
Azure OpenAI Service provides generative models: GPT-3.5, GPT-4, DALL-E, Embeddings. You pay per token.
Azure Bot Service can use classification (LUIS) and generation (QnA Maker) together.
Common Exam Scenarios
A company wants to predict equipment failure: Use prediction (regression) with Azure Machine Learning or Anomaly Detector.
A bank wants to classify transactions as fraudulent: Use classification with Azure Machine Learning or Cognitive Services.
A marketing team wants to generate product descriptions: Use generation with Azure OpenAI.
Edge Cases
Time series forecasting is a special case of prediction where time is a feature. Azure Anomaly Detector can detect anomalies in real-time streaming data.
Multi-label classification: An image can contain both 'cat' and 'dog'. Azure Custom Vision supports multi-label.
Few-shot generation: GPT-3.5 can generate text with only a few examples in the prompt.
Verification Commands
List models in Azure ML: az ml model list
Get deployment logs: az ml endpoint show --name my-endpoint --query logs
Test a deployment: curl -X POST -H "Content-Type: application/json" -d @input.json https://my-endpoint.azurecontainer.io/score
Identify the AI Task Type
First, read the scenario carefully to determine if the output is a number (prediction), a category (classification), or new content (generation). Look for keywords: 'forecast', 'estimate' for prediction; 'classify', 'categorize', 'detect' for classification; 'create', 'generate', 'write' for generation. This step is critical because the wrong choice of Azure service often follows from misidentifying the task type.
Match to Azure Service
Once the task type is known, select the appropriate Azure service. For prediction, use Azure Machine Learning or Anomaly Detector. For classification, use Azure Cognitive Services (e.g., Computer Vision, Text Analytics) or Custom Vision. For generation, use Azure OpenAI Service. The exam often asks 'Which Azure service should you use?' Be aware of overlaps: Azure Machine Learning can also do classification, but the exam prefers the specialized service.
Consider Data Requirements
Prediction and classification typically require labeled training data. Generation may use pre-trained models that need no labeled data (e.g., GPT-4). For prediction, you need historical data with target values. For classification, you need examples of each class. For generation, you may provide a prompt or few examples. The exam may test whether a scenario requires custom training or can use a pre-built model.
Evaluate Output Format
Prediction outputs a continuous number (e.g., 42.5). Classification outputs a discrete label (e.g., 'spam') and sometimes confidence scores. Generation outputs text, image, or other content. The exam may ask what the response looks like. For example, 'What does the Predict API return?' Answer: A numerical value.
Check for Pre-built vs Custom
Azure offers pre-built AI models (Cognitive Services) that require no training, and custom models (Azure Machine Learning, Custom Vision) that you train with your own data. The exam tests whether a given scenario can be solved with a pre-built model or needs custom training. For example, classifying common objects like cats and dogs can use pre-built Computer Vision; classifying proprietary defects requires Custom Vision.
Enterprise Scenario 1: Retail Demand Forecasting
A large retail chain with 500 stores wants to predict daily sales for each store to optimize inventory. They use Azure Machine Learning AutoML with time series data (sales, promotions, holidays, weather). The model is deployed as a batch endpoint that runs nightly. The output is a forecast for each SKU-store combination. Key considerations: data volume is 10 TB, so they use Azure Data Lake and ParallelRunStep. Misconfiguration: forgetting to set the time column leads to poor accuracy. The team uses AutoML's 'time_series_id_column_names' parameter. The exam may ask: 'Which Azure service for forecasting?' Answer: Azure Machine Learning with AutoML.
Enterprise Scenario 2: Document Classification for Insurance
An insurance company receives thousands of documents daily (claims, policies, forms). They use Azure Form Recognizer to classify documents into types (e.g., 'claim form', 'policy document'). The custom model is trained on 500 labeled documents. It uses layout analysis and text extraction. The output is a document type and confidence score. Production considerations: throughput of 100 docs/min, latency under 5 seconds. They use a dedicated endpoint. Common issue: low confidence on similar documents (e.g., two claim form versions). Solution: retrain with more examples. Exam relevance: Document classification is a classification task; Form Recognizer is the service.
Enterprise Scenario 3: Automated Content Generation for Marketing
A marketing agency uses Azure OpenAI GPT-4 to generate social media posts, email drafts, and ad copy. They provide a prompt with brand guidelines and tone. The model generates multiple variants. They use content filtering to avoid inappropriate content. Scale: 10,000 requests/day. Cost: pay per token (input + output). Misconfiguration: not setting max_tokens leads to truncated responses. They set max_tokens=500. The exam may test that Azure OpenAI is the generative service. Also, they use embeddings for semantic search of past content.
Exactly What AI-900 Tests
Objective 1.1: Identify common AI workloads. The exam asks you to distinguish between prediction, classification, and generation. Specific sub-objectives include:
Identify prediction (regression) workloads: forecasting, estimating continuous values.
Identify classification workloads: categorizing, labeling, detecting.
Identify generation workloads: creating text, images, code.
The exam does NOT test deep algorithm details; it tests scenario-to-service mapping.
Common Wrong Answers
Confusing regression with classification: A question like 'Predict whether a customer will churn' is classification (binary: churn/not churn), not regression. Candidates choose regression because 'predict' is used, but the output is a category.
Choosing Azure Machine Learning for everything: While Azure ML can do all three, the exam expects you to choose the most specific service. For generation, Azure OpenAI is correct, not Azure ML.
Thinking generation is only for text: Candidates may miss that DALL-E generates images. The exam includes image generation.
Mixing up Anomaly Detector (prediction) with classification: Anomaly Detector predicts a value and flags if it's anomalous; it's a regression-based approach, not classification.
Specific Numbers and Terms
Confidence threshold: Default 0.5 for many Cognitive Services classifiers.
AutoML primary metrics: normalized_root_mean_squared_error for regression, accuracy for classification.
Azure OpenAI models: GPT-3.5 (text-davinci-003), GPT-4, DALL-E 2, text-embedding-ada-002.
Custom Vision domains: General, Food, Landmarks, Retail.
Edge Cases and Exceptions
Multi-label classification: An image can have multiple labels; Azure Custom Vision supports it.
Time series forecasting: Requires 'time' column; AutoML has special settings.
Few-shot generation: GPT-3.5 can generate with few examples; exam may ask if training is needed (no, it's in-context learning).
How to Eliminate Wrong Answers
If the output is a number, eliminate classification and generation.
If the output is a label, eliminate prediction and generation.
If the output is new content, eliminate prediction and classification.
If the scenario mentions 'create', 'write', 'draw', choose generation.
If the scenario says 'forecast', 'estimate', choose prediction.
If the scenario says 'categorize', 'detect', 'classify', choose classification.
Prediction (regression) outputs a continuous number; classification outputs a discrete label; generation outputs new content.
For prediction on the exam, look for 'forecast', 'estimate', 'predict a value'; use Azure Machine Learning or Anomaly Detector.
For classification, look for 'categorize', 'detect', 'classify'; use Azure Cognitive Services or Custom Vision.
For generation, look for 'create', 'generate', 'write'; use Azure OpenAI Service.
Azure Anomaly Detector is a prediction service for time series data; it detects anomalies by forecasting expected values.
Azure Custom Vision trains custom image classifiers; it supports multi-class and multi-label classification.
Azure OpenAI includes GPT-4 (text generation) and DALL-E (image generation); it is pre-trained and can be used without custom training.
The exam may present hybrid scenarios; identify the primary task type to choose the correct service.
Multi-label classification allows an instance to have multiple labels; Azure Custom Vision supports it.
Time series forecasting is a special prediction task that requires a time column; Azure AutoML handles it automatically.
These come up on the exam all the time. Here's how to tell them apart.
Prediction (Regression)
Output is a continuous numerical value (e.g., 42.5).
Used for forecasting, estimation, anomaly detection.
Azure services: Azure Machine Learning, Anomaly Detector.
Metrics: RMSE, MAE, R-squared.
Example: Predict tomorrow's temperature.
Classification
Output is a discrete label (e.g., 'spam').
Used for categorization, detection, diagnosis.
Azure services: Custom Vision, Cognitive Services, Azure ML.
Metrics: Accuracy, Precision, Recall, F1.
Example: Classify email as spam or not.
Classification
Output is a label from a fixed set.
Requires labeled training data.
Azure services: Custom Vision, Form Recognizer.
Common use: Image classification, sentiment analysis.
Model outputs probabilities for each class.
Generation
Output is new content (text, image, etc.).
Can use pre-trained models without labeled data.
Azure services: Azure OpenAI.
Common use: Text generation, image creation.
Model outputs tokens or pixels.
Mistake
Prediction and classification are the same thing.
Correct
Prediction outputs a continuous number (regression), while classification outputs a discrete label. For example, predicting a house price (number) vs. classifying a house as 'expensive' or 'cheap' (label). The exam tests this distinction.
Mistake
Azure Machine Learning is the only service for prediction.
Correct
Azure Anomaly Detector is also a prediction service, specifically for detecting anomalies in time series data. It uses regression models internally.
Mistake
Generation always requires training a custom model.
Correct
Azure OpenAI provides pre-trained generative models that can be used without training. You just provide a prompt. Custom training is optional for fine-tuning.
Mistake
Classification can only have two classes.
Correct
Classification includes binary, multi-class, and multi-label. For example, classifying images into 1000 categories is multi-class. The exam may present multi-class scenarios.
Mistake
Azure Cognitive Services only do classification.
Correct
Cognitive Services include pre-built models for prediction (Anomaly Detector) and generation (Text Analytics for key phrases is not generation, but Speech Service for text-to-speech is generation). However, most Cognitive Services are classification-oriented.
Reveal each answer, then mark whether you got it right. Score 60%+ to unlock the next chapter.
Prediction (regression) outputs a continuous number, like forecasting sales for next month. Classification outputs a discrete label, like classifying an email as spam or not spam. The key difference is the type of output: numerical vs. categorical. On the exam, if the scenario asks for a number, it's prediction; if it asks for a category, it's classification.
For image generation, use Azure OpenAI Service with DALL-E. DALL-E can create images from text descriptions. Alternatively, you can use Azure Cognitive Services for image analysis (classification), but not generation. The exam specifically tests Azure OpenAI for generative tasks.
Yes, Azure Machine Learning supports classification models (e.g., logistic regression, decision trees). However, the exam often expects you to choose a more specialized service like Azure Custom Vision for image classification or Azure Cognitive Services for text classification. Use Azure ML when you need custom training with your own data and algorithms.
A common example is predicting equipment failure using sensor data. You can use Azure Anomaly Detector to detect anomalies in the time series data, which is a prediction task. Another example is forecasting demand using Azure Machine Learning AutoML. The output is a continuous value (e.g., number of units).
No, Azure OpenAI provides pre-trained models that can be used directly via API calls. You can provide a prompt and the model generates a response. Custom training (fine-tuning) is optional and available for some models, but the exam typically treats Azure OpenAI as a pre-built generative service.
Multi-label classification assigns multiple labels to a single instance. For example, an image can be labeled as both 'beach' and 'sunset'. Azure Custom Vision supports multi-label classification. In contrast, multi-class classification assigns exactly one label from many classes. The exam may test this distinction.
Azure Anomaly Detector uses regression models to predict expected values in time series data. It then compares actual values to the predicted range. If the actual value deviates significantly (based on a sensitivity setting), it flags an anomaly. It is a prediction (regression) workload, not classification.
You've just covered AI Use Cases: Prediction, Classification, Generation — now see how well it sticks with free AI-900 practice questions. Full explanations included, no account needed.
Done with this chapter?