Free MLS-C01 Practice Questions & Study Guide (2026)

Official Exam Details: (MLS-C01)

Exam Code:
MLS-C01
Passing Score:
70%
Total Question Bank:
390 Verified Questions
Exam Duration:
120 Minutes

Exam Format & Question Types

This certification exam features multiple-choice questions (single and multi-select), interactive Hotspots, Hot Areas, and Drag-and-Drop scenario configurations designed to test real-world technical competency.

AWS Certified Machine Learning – Specialty (MLS-C01) Study Guide & Architectural Master Blueprint

This comprehensive study guide and architectural blueprint is meticulously crafted for aspiring AWS Certified Machine Learning – Specialty professionals targeting the MLS-C01 exam. As an expert cloud architect and certification exam author, this document focuses exclusively on the MLS-C01 curriculum, treating it as the active certification target.

Exam Overview & Profile

The AWS Certified Machine Learning – Specialty (MLS-C01) exam is designed for individuals in a Development or Data Science role with 2+ years of hands-on experience designing, implementing, deploying, and maintaining Machine Learning (ML) solutions on AWS. Candidates should possess a deep understanding of common ML frameworks, data preprocessing techniques, model training methodologies, evaluation metrics, deployment strategies, and operationalization practices. The exam typically consists of approximately 65 multiple-choice and multiple-response questions, with a time limit of 170 minutes. A passing score context is generally 750 out of 1000.

Deep-Dive Domain Breakdown

Domain 1: Data Engineering (20%)

This domain tests your ability to design and implement scalable, secure, and cost-effective data solutions for ML. Key architectural concepts include data ingestion (batch vs. streaming), transformation (ETL), and storage strategies. You must understand how to prepare data for training, including feature engineering and handling diverse data types. Core technologies include Amazon S3 (for data lakes, data versioning), AWS Glue (ETL, Data Catalog), Amazon Kinesis (real-time data streams, Firehose, Analytics), AWS Lake Formation for data governance, and Amazon Athena for ad-hoc querying. Focus on choosing appropriate storage classes, optimizing data formats like Parquet and ORC, and securing data with IAM and encryption.

Domain 2: Exploratory Data Analysis (EDA) (24%)

This domain requires expertise in performing data exploration and visualization to identify patterns, anomalies, and derive insights. Architectural skills revolve around setting up environments for efficient analysis of large datasets. Services include Amazon SageMaker Data Wrangler for data aggregation and preparation, Jupyter notebooks within SageMaker Studio, and SageMaker Processing jobs for large-scale data transformations using frameworks like Spark. You should be proficient with libraries such as Pandas, NumPy, Matplotlib, and Seaborn. Emphasize detecting and handling missing values, outliers, data imbalances, and potential biases in the dataset.

Domain 3: Modeling (36%)

The largest domain, focusing on selecting, training, evaluating, and tuning ML models. This covers supervised, unsupervised, and reinforcement learning paradigms. You need to know algorithm selection based on problem type (e.g., classification, regression, clustering), understanding the bias/variance trade-off, and techniques like regularization to prevent overfitting. Services include Amazon SageMaker‘s built-in algorithms (XGBoost, Linear Learner, Factorization Machines), custom containers for proprietary algorithms, SageMaker Training Jobs, and SageMaker Automatic Model Tuning (Hyperparameter Tuning). Evaluation metrics (accuracy, precision, recall, F1-score, AUC, RMSE, MAE) and their appropriate use cases are critical, especially for imbalanced datasets.

Domain 4: Machine Learning Implementation & Operations (MLOps) (20%)

This domain covers deploying ML models into production, monitoring their performance, and managing the ML lifecycle. Architectural considerations include choosing between real-time inference (SageMaker Endpoints), batch inference (SageMaker Batch Transform), or serverless inference (Lambda, API Gateway). Key concepts include A/B testing models, continuous model monitoring for data drift and concept drift using SageMaker Model Monitor, automated retraining strategies, and implementing CI/CD pipelines for ML with AWS CodePipeline. Focus on securing inference endpoints, ensuring high availability and scalability, and integrating ML models into business applications.

High-Yield Exam Tips & Scenario Traps

  • Managed Services First: Always default to fully managed AWS services (e.g., SageMaker, Glue) over self-managed solutions for reduced operational overhead, scalability, and security, unless specific customization is explicitly required.
  • Cost Optimization: Many scenarios involve minimizing cost. Look for solutions using serverless options (Lambda, Fargate), spot instances for non-critical training, or appropriate SageMaker instance types and automatic scaling.
  • Security is Paramount: Prioritize least privilege IAM roles, encryption at rest and in transit (KMS), VPC isolation for private endpoints, and security groups. Never expose sensitive ML endpoints publicly without strong justification.
  • Performance vs. Latency: Understand the trade-offs. For low-latency, real-time inference, SageMaker Endpoints are ideal. For high-throughput, asynchronous processing, consider SageMaker Asynchronous Inference or Batch Transform.
  • RAG vs. Fine-tuning Analogy: While MLS-C01 predates LLM-specific terminology, the underlying concept is vital. If a model needs to incorporate new, external, or frequently updated factual knowledge without altering its core learned behaviors, think of a mechanism to provide that external context at inference time (e.g., a lookup store). If the model needs to adapt its internal weights and biases to learn new patterns or domains, then retraining or fine-tuning is necessary.
  • Overfitting/Underfitting: Know the remedies: for overfitting, consider more data, regularization (L1/L2), simpler models, or feature selection; for underfitting, try more complex models, more features, or longer training.
  • Evaluation Metrics: Precisely match the evaluation metric to the problem and data characteristics. For imbalanced datasets, F1-score or AUC are often more informative than accuracy.

Frequently Asked Questions (FAQ)

Q1: How should I structure my study time for MLS-C01 given the domain weightings?

A1: Prioritize deep dives into the Modeling (36%) and Exploratory Data Analysis (24%) domains, as they collectively account for over half the exam. While studying, ensure hands-on practice with Amazon SageMaker for training, tuning, and evaluation. Dedicate substantial time to Data Engineering (20%) and MLOps (20%), practicing with services like AWS Glue, Kinesis, and SageMaker’s deployment/monitoring features. Create a study plan that cycles through these domains, reinforcing concepts with practical labs and practice questions.

Q2: What is the most effective way to gain practical, hands-on experience for this certification?

A2: The most effective approach is to leverage the AWS Free Tier and create small, end-to-end ML projects. Start with data ingestion into S3, perform ETL with AWS Glue, conduct EDA in SageMaker Studio, train and tune a model using SageMaker’s built-in algorithms or custom containers, and then deploy it to a SageMaker endpoint. Experiment with both batch and real-time inference. Practice monitoring model performance using SageMaker Model Monitor and CloudWatch. This full lifecycle experience reinforces architectural decisions and service integrations.

Q3: Which AWS documentation and whitepapers are crucial for MLS-C01 preparation?

A3: Focus intensely on the Amazon SageMaker Developer Guide, covering its entire spectrum from Studio and Notebook Instances to Training Jobs, Hyperparameter Tuning, Endpoints, Batch Transform, Model Monitor, Feature Store, and Clarify. Additionally, review the AWS Well-Architected Framework: Machine Learning Lens for best practices in designing robust, secure, and efficient ML workloads. Familiarize yourself with documentation for AWS Glue, Amazon Kinesis, Amazon S3, and IAM in the context of ML security and data governance.

Q4: How should I approach complex scenario-based questions in the exam?

A4: For scenario questions, first identify the core problem statement and critical constraints (e.g., “low latency,” “cost-effective,” “high throughput,” “secure P.I.I. data”). Then, break down the scenario into its components (data ingestion, processing, modeling, deployment). Systematically eliminate options that violate the stated constraints, introduce unnecessary complexity, or contradict AWS best practices. Look for keywords that point to specific AWS services or architectural patterns. Often, the best solution involves leveraging integrated, managed AWS services over manually configured alternatives.

Free MLS-C01 Sample Practice Questions

Test your knowledge with these sample scenario questions complete with verified explanations:

General Practice Questions

QUESTION 1

A large mobile network operating company is building a machine learning model to predict customers who are likely to unsubscribe from the service. The company plans to offer an incentive for these customers as the cost of churn is far greater than the cost of the incentive.

The model produces the following confusion matrix after evaluating on a test dataset of 100 customers:

Based on the model evaluation results, why is this a viable model for production?

  • A. The model is 86% accurate and the cost incurred by the company as a result of false negatives is less than the false positives.
  • B. The precision of the model is 86%, which is less than the accuracy of the model.
  • C. The model is 86% accurate and the cost incurred by the company as a result of false positives is less than the false negatives.
  • D. The precision of the model is 86%, which is greater than the accuracy of the model.
Click to View Verified Solution & Explanation

Correct Option: C

Explanation: ✅ The model is 86% accurate and the cost incurred by the company as a result of false positives is less than the false negatives.

Description: This choice accurately reflects the calculated accuracy from the confusion matrix and makes a common and crucial business assumption about the relative costs of different error types in a churn prediction scenario.

Why this fits:

  1. Accuracy Calculation:
    From the confusion matrix:

    • True Positives (TP) = 10 (Actual Churn Yes, Predicted Churn Yes)
    • True Negatives (TN) = 76 (Actual No, Predicted Churn No)
    • False Positives (FP) = 10 (Actual No, Predicted Churn Yes)
    • False Negatives (FN) = 4 (Actual Churn Yes, Predicted Churn No)
    • Total samples = 100

    Accuracy = (TP + TN) / Total Samples = (10 + 76) / 100 = 86 / 100 = 0.86 or 86%.
    This confirms the first part of the statement.

  2. Cost of False Positives vs. False Negatives in Churn Prediction:

    • False Positive (FP): The model predicts a customer will churn, but they would have stayed anyway. The business might unnecessarily offer a discount or special incentive to retain them. The cost is the value of this unnecessary intervention.
    • False Negative (FN): The model predicts a customer will not churn, but they actually do. The business misses the opportunity to intervene and loses a customer, along with their potential future revenue and lifetime value. This cost is typically much higher than an unnecessary incentive.

    Therefore, in most real-world churn prediction scenarios, the financial impact of a false negative (lost customer) is significantly greater than that of a false positive (unnecessary retention effort). Thus, stating "the cost incurred by the company as a result of false positives is less than the false negatives" is a sound business conclusion.

    Example: Consider a telecom company. A False Positive might mean giving a $50 credit to a customer who wasn’t going to churn. A False Negative means losing a customer whose average lifetime value is $1000. Even with more False Positives (10) than False Negatives (4) in count, the total cost of 4 lost customers ($4000) is likely much higher than the total cost of 10 unnecessary credits ($500), making false negative errors more costly in aggregate.

QUESTION 2

A Machine Learning Specialist is designing a system for improving sales for a company. The objective is to use the large amount of information the company has on users’ behavior and product preferences to predict which products users would like based on the users’ similarity to other users.

What should the Specialist do to meet this objective?

  • A. Build a content-based filtering recommendation engine with Apache Spark ML on Amazon EMR
  • B. Build a collaborative filtering recommendation engine with Apache Spark ML on Amazon EMR.
  • C. Build a model-based filtering recommendation engine with Apache Spark ML on Amazon EMR
  • D. Build a combinative filtering recommendation engine with Apache Spark ML on Amazon EMR
Click to View Verified Solution & Explanation

Correct Option: B

Explanation: ✅ Build a collaborative filtering recommendation engine with Apache Spark ML on Amazon EMR.

Description: Collaborative filtering is a widely used technique in recommendation systems that predicts a user’s interest in items based on the preferences of other users. It operates on the principle that if users have agreed on preferences in the past, they are likely to agree in the future. This approach analyzes user-item interaction data (e.g., ratings, purchases, views) to identify similar users or similar items, subsequently recommending items based on these similarities.

Why this fits: Apache Spark MLlib provides scalable machine learning algorithms, with the Alternating Least Squares (ALS) algorithm being a prominent choice for implementing collaborative filtering. Amazon EMR is a managed cluster platform that enables easy deployment and scaling of big data frameworks like Apache Spark. Utilizing Spark ML on Amazon EMR offers a robust, distributed, and scalable solution for processing large volumes of user-item interaction data, which is essential for training and deploying collaborative filtering models effectively for recommendation engines.

Example: A streaming service wants to recommend movies to its users. By analyzing historical viewing patterns and ratings from millions of users, a collaborative filtering model built with Spark ML on EMR can identify users with similar tastes. If User A watched and liked several movies that User B also liked, the system would recommend a new movie that User B enjoyed but User A hasn’t seen yet.

QUESTION 3

A Mobile Network Operator is building an analytics platform to analyze and optimize a company’s operations using Amazon Athena and Amazon S3.

The source systems send data in .CSV format in real time. The Data Engineering team wants to transform the data to the Apache Parquet format before storing it on Amazon S3.

Which solution takes the LEAST effort to implement?

  • A. Ingest .CSV data using Apache Kafka Streams on Amazon EC2 instances and use Kafka Connect S3 to serialize data as Parquet
  • B. Ingest .CSV data from Amazon Kinesis Data Streams and use Amazon Glue to convert data into Parquet.
  • C. Ingest .CSV data using Apache Spark Structured Streaming in an Amazon EMR cluster and use Apache Spark to convert data into Parquet.
  • D. Ingest .CSV data from Amazon Kinesis Data Streams and use Amazon Kinesis Data Firehose to convert data into Parquet.
Click to View Verified Solution & Explanation

Correct Option: B

Explanation: ✅ Ingest .CSV data from Amazon Kinesis Data Streams and use Amazon Glue to convert data into Parquet.

Description: Amazon Kinesis Data Streams is a fully managed, real-time data streaming service capable of ingesting high-throughput data. Amazon Glue is a serverless extract, transform, and load (ETL) service that makes it easy to prepare and process data for analytics and machine learning. Glue can connect to Kinesis Data Streams, read the incoming .CSV data, apply necessary transformations including schema inference and format conversion, and then write the processed data in Apache Parquet format to Amazon S3.

Why this fits: This approach leverages fully managed AWS services for both scalable real-time data ingestion (Kinesis Data Streams) and robust, serverless ETL processing (Amazon Glue). Kinesis Data Streams efficiently captures the streaming .CSV data. Amazon Glue is then ideal for performing the data conversion to Apache Parquet, a highly efficient columnar storage format commonly used in analytics and machine learning workloads due to its compression and query performance benefits. Furthermore, Glue integrates seamlessly with the AWS Glue Data Catalog, providing a centralized metadata repository that is crucial for managing and discovering data schemas in ML pipelines, thereby enhancing data governance and usability for subsequent ML tasks. While Kinesis Data Firehose (Choice D) can also perform format conversion, Amazon Glue provides a more comprehensive ETL environment with greater flexibility for complex data transformations and integrated schema management, making it a more robust choice for data preparation in a machine learning context.

Example: An e-commerce platform collects customer clickstream data in .CSV format through its web application. This data is continuously streamed into Amazon Kinesis Data Streams. An Amazon Glue streaming ETL job is configured to read from this Kinesis stream, parse the .CSV records, and convert them into Parquet files, which are then stored in an S3 data lake. The Glue Data Catalog automatically updates with the schema of the new Parquet files, making this data immediately available for feature engineering with Amazon SageMaker or for querying with Amazon Athena.

QUESTION 4

A city wants to monitor its air quality to address the consequences of air pollution. A Machine Learning Specialist needs to forecast the air quality in parts per million of contaminates for the next 2 days in the city. As this is a prototype, only daily data from the last year is available.

Which model is MOST likely to provide the best results in Amazon SageMaker?

  • A. Use the Amazon SageMaker k-Nearest-Neighbors (kNN) algorithm on the single time series consisting of the full year of data with a predictor_type of regressor.
  • B. Use Amazon SageMaker Random Cut Forest (RCF) on the single time series consisting of the full year of data.
  • C. Use the Amazon SageMaker Linear Learner algorithm on the single time series consisting of the full year of data with a predictor_type of regressor.
  • D. Use the Amazon SageMaker Linear Learner algorithm on the single time series consisting of the full year of data with a predictor_type of classifier.
Click to View Verified Solution & Explanation

Correct Option: C

Explanation: ✅ Use the Amazon SageMaker Linear Learner algorithm on the single time series consisting of the full year of data with a predictor_type of regressor.

Description: The Amazon SageMaker Linear Learner algorithm is a supervised learning algorithm that can solve both classification and regression problems. For regression tasks, it models the relationship between a dependent variable and one or more independent variables by fitting a linear equation to the observed data. When dealing with time series data for forecasting, the goal is typically to predict a continuous numerical value (e.g., future sales, temperature, resource usage), which falls under the category of regression.

Why this fits: This choice is correct because it identifies an appropriate algorithm and configuration for a common time series forecasting scenario.

  1. Amazon SageMaker Linear Learner: While more complex models exist for time series, Linear Learner is an effective, efficient, and robust algorithm for establishing a baseline or even a sufficient model when the underlying trends or relationships are largely linear. It can handle numerical features common in time series data.
  2. predictor_type of regressor: Time series forecasting, which involves predicting future numerical values, is fundamentally a regression problem. Setting predictor_type to regressor configures the algorithm to output a continuous value rather than a discrete class label.
  3. Single time series consisting of the full year of data: This indicates that the data is structured as a time series, suitable for training a model to learn temporal patterns for prediction.
  • Contrast with other options:
    • Choice A (kNN with regressor): While kNN can be used for regression, it often struggles with time series data unless significant feature engineering (e.g., lag features) is performed to capture temporal dependencies. Linear Learner often provides a more straightforward baseline.
    • Choice B (Random Cut Forest): RCF is primarily an unsupervised algorithm designed for anomaly detection, not for forecasting future values in a time series.
    • Choice D (Linear Learner with classifier): Forecasting continuous values is a regression task, not a classification task, which predicts discrete categories.

      Example: Imagine predicting the daily energy consumption for the next month based on a year of historical consumption data. This is a time series forecasting problem where the output is a continuous numerical value (energy consumption in kWh). Using SageMaker Linear Learner with predictor_type='regressor' would be a suitable approach to model the linear trends and patterns in the historical data to make these predictions.

QUESTION 5

A Data Engineer needs to build a model using a dataset containing customer credit card information

How can the Data Engineer ensure the data remains encrypted and the credit card information is secure?

  • A. Use a custom encryption algorithm to encrypt the data and store the data on an Amazon SageMaker instance in a VPC. Use the SageMaker DeepAR algorithm to randomize the credit card numbers.
  • B. Use an IAM policy to encrypt the data on the Amazon S3 bucket and Amazon Kinesis to automatically discard credit card numbers and insert fake credit card numbers.
  • C. Use an Amazon SageMaker launch configuration to encrypt the data once it is copied to the SageMaker instance in a VPC. Use the SageMaker principal component analysis (PCA) algorithm to reduce the length of the credit card numbers.
  • D. Use AWS KMS to encrypt the data on Amazon S3 and Amazon SageMaker, and redact the credit card numbers from the customer data with AWS Glue.
Click to View Verified Solution & Explanation

Correct Option: D

Explanation: ✅ Use AWS KMS to encrypt the data on Amazon S3 and Amazon SageMaker, and redact the credit card numbers from the customer data with AWS Glue.

Description: This choice outlines a robust and compliant approach for handling sensitive customer data (credit card numbers) in an AWS machine learning workflow. It leverages AWS Key Management Service (KMS) for data encryption at rest and in transit across Amazon S3 (for data storage) and Amazon SageMaker (for ML development and training environments). Additionally, it uses AWS Glue, a fully managed ETL (extract, transform, and load) service, to identify and redact sensitive personally identifiable information (PII) such as credit card numbers before the data is used for machine learning.

Why this fits: This approach aligns with AWS best practices for data security and privacy.

  1. AWS KMS for Encryption: AWS KMS provides managed encryption keys and integrates seamlessly with many AWS services, including Amazon S3 (for server-side encryption with KMS keys – SSE-KMS) and Amazon SageMaker (for encrypting storage volumes, model artifacts, and training outputs). Using KMS ensures that sensitive data is encrypted at rest and provides a robust key management solution, crucial for compliance and security.
  2. AWS Glue for Redaction/Transformation: AWS Glue is highly suitable for data preparation tasks. Its ETL capabilities, including Glue Data Catalog and Glue Studio, can be used to scan, discover, and transform data. It allows for defining custom transformations or using built-in functions to identify and redact (mask, tokenize, or remove) sensitive information like credit card numbers from datasets before they are ingested into SageMaker for model training. This step is critical for data privacy, compliance (e.g., PCI DSS), and preventing sensitive data exposure during the ML lifecycle.
    The combination of strong encryption (KMS) and PII redaction (Glue) provides a comprehensive solution for securely handling and preparing sensitive customer data for machine learning.

    Example: An e-commerce company wants to build a recommendation engine using customer transaction data stored in Amazon S3. This data includes credit card numbers. Before training an Amazon SageMaker model, the company uses AWS Glue to run an ETL job. This job reads the data from S3, identifies all credit card number fields using pattern matching or classification, and replaces them with a masked version (e.g., ‘XXXX-XXXX-XXXX-1234’) or a token. The transformed, redacted data is then stored back in an S3 bucket, which is configured for encryption using AWS KMS. Finally, SageMaker accesses this encrypted, redacted data for model training, with its own internal storage also encrypted by KMS.

QUESTION 6

A Machine Learning Specialist is using an Amazon SageMaker notebook instance in a private subnet of a corporate VPC. The ML Specialist has important data stored on the Amazon SageMaker notebook instance’s Amazon EBS volume, and needs to take a snapshot of that EBS volume. However, the ML Specialist cannot find the Amazon SageMaker notebook instance’s EBS volume or Amazon EC2 instance within the VPC.

Why is the ML Specialist not seeing the instance visible in the VPC?

  • A. Amazon SageMaker notebook instances are based on the EC2 instances within the customer account, but they run outside of VPCs.
  • B. Amazon SageMaker notebook instances are based on the Amazon ECS service within customer accounts.
  • C. Amazon SageMaker notebook instances are based on EC2 instances running within AWS service accounts.
  • D. Amazon SageMaker notebook instances are based on AWS ECS instances running within AWS service accounts.
Click to View Verified Solution & Explanation

Correct Option: C

Explanation: ✅ Amazon SageMaker notebook instances are based on EC2 instances running within AWS service accounts.

Description: Amazon SageMaker notebook instances provide a fully managed, Jupyter-based environment for data exploration, preprocessing, model development, and experimentation. While they offer a serverless-like experience to the user, the underlying compute resources are provisioned and managed by AWS.

Why this fits: SageMaker notebook instances are fundamentally built upon Amazon EC2 instances. However, these EC2 instances are not launched into or visible within the customer’s AWS account. Instead, they run within a dedicated AWS service account, meaning AWS manages the underlying infrastructure, operating system, security patching, and scaling. This abstraction frees the user from managing EC2 instances, VPCs, and network configurations directly, allowing them to focus solely on their data science workflows.

Example: When you select an instance type like ml.t3.medium for your SageMaker notebook, you are essentially specifying the characteristics of the underlying EC2 instance that AWS will provision in its service account to host your Jupyter environment. You interact with the notebook endpoint, but you don’t directly see or manage the EC2 instance in your EC2 console or VPC.

QUESTION 7

A Machine Learning Specialist is building a model that will perform time series forecasting using Amazon SageMaker. The Specialist has finished training the model and is now planning to perform load testing on the endpoint so they can configure Auto Scaling for the model variant.

Which approach will allow the Specialist to review the latency, memory utilization, and CPU utilization during the load test?

  • A. Review SageMaker logs that have been written to Amazon S3 by leveraging Amazon Athena and Amazon QuickSight to visualize logs as they are being produced.
  • B. Generate an Amazon CloudWatch dashboard to create a single view for the latency, memory utilization, and CPU utilization metrics that are outputted by Amazon SageMaker.
  • C. Build custom Amazon CloudWatch Logs and then leverage Amazon ES and Kibana to query and visualize the log data as it is generated by Amazon SageMaker.
  • D. Send Amazon CloudWatch Logs that were generated by Amazon SageMaker to Amazon ES and use Kibana to query and visualize the log data.
Click to View Verified Solution & Explanation

Correct Option: B

Explanation: ✅ Generate an Amazon CloudWatch dashboard to create a single view for the latency, memory utilization, and CPU utilization metrics that are outputted by Amazon SageMaker.

Description: Amazon CloudWatch is the native monitoring and observability service for AWS resources and applications. It collects monitoring and operational data in the form of logs, metrics, and events, and provides a unified view of AWS resources, applications, and services that run on AWS and on-premises servers. CloudWatch Dashboards allow users to create customized views of the metrics and alarms for their AWS resources and applications in a single pane of glass. Amazon SageMaker automatically publishes key operational metrics, such as CPU utilization, memory utilization, network utilization, and latency, to CloudWatch.

Why this fits: The goal is to create a "single view for the latency, memory utilization, and CPU utilization metrics" outputted by Amazon SageMaker. Amazon CloudWatch Dashboards are specifically designed for this purpose. They aggregate various metrics from different services, including SageMaker, into a consolidated and customizable visual interface, providing real-time operational insights. This directly addresses the requirement for a unified, easily consumable view of critical performance metrics.

Example: An ML engineer has deployed a SageMaker endpoint for real-time inference. To continuously monitor its performance, they can navigate to the CloudWatch console, create a new dashboard, and add widgets displaying the CPUUtilization, MemoryUtilization, and Invocations (which can be used to derive latency) metrics for their specific SageMaker endpoint. This dashboard provides an immediate overview of the endpoint’s health and performance.

QUESTION 8

A manufacturing company has structured and unstructured data stored in an Amazon S3 bucket. A Machine Learning Specialist wants to use SQL to run queries on this data.

Which solution requires the LEAST effort to be able to query this data?

  • A. Use AWS Data Pipeline to transform the data and Amazon RDS to run queries.
  • B. Use AWS Glue to catalogue the data and Amazon Athena to run queries.
  • C. Use AWS Batch to run ETL on the data and Amazon Aurora to run the queries.
  • D. Use AWS Lambda to transform the data and Amazon Kinesis Data Analytics to run queries.
Click to View Verified Solution & Explanation

Correct Option: B

Explanation: ✅ Use AWS Glue to catalogue the data and Amazon Athena to run queries.

Description: AWS Glue is a fully managed extract, transform, and load (ETL) service that also includes a Data Catalog, a central metadata repository for all your data assets. It automatically discovers and catalogues data stored in Amazon S3, creating schemas and table definitions. Amazon Athena is an interactive query service that enables you to analyze data directly in Amazon S3 using standard SQL. Athena is serverless, meaning there’s no infrastructure to manage, and it integrates seamlessly with the AWS Glue Data Catalog to understand the schema of your S3 data.

Why this fits: This solution provides a highly scalable, serverless, and cost-effective approach for cataloging and querying large datasets stored in Amazon S3, which is a common pattern for data lakes supporting machine learning workloads. AWS Glue Data Catalog centralizes metadata, allowing Athena to efficiently run ad-hoc SQL queries without requiring data movement or provisioning any compute resources. This combination is ideal for data exploration, feature engineering, and preparing data for ML model training directly from raw or processed data in S3.

Example: An ML team needs to analyze petabytes of log data stored in S3 for fraud detection. They can use AWS Glue Crawlers to automatically discover the schema of the log files and populate the AWS Glue Data Catalog. Then, data scientists can use Amazon Athena to run SQL queries against this cataloged data in S3 to extract specific features, filter relevant records, or aggregate data for model training, all without managing servers.

QUESTION 9

A Machine Learning Specialist is developing a custom video recommendation model for an application. The dataset used to train this model is very large with millions of data points and is hosted in an Amazon S3 bucket. The Specialist wants to avoid loading all of this data onto an Amazon SageMaker notebook instance because it would take hours to move and will exceed the attached 5 GB Amazon EBS volume on the notebook instance.

Which approach allows the Specialist to use all the data to train the model?

  • A. Load a smaller subset of the data into the SageMaker notebook and train locally. Confirm that the training code is executing and the model parameters seem reasonable. Initiate a SageMaker training job using the full dataset from the S3 bucket using Pipe input mode.
  • B. Launch an Amazon EC2 instance with an AWS Deep Learning AMI and attach the S3 bucket to the instance. Train on a small amount of the data to verify the training code and hyperparameters. Go back to Amazon SageMaker and train using the full dataset
  • C. Use AWS Glue to train a model using a small subset of the data to confirm that the data will be compatible with Amazon SageMaker. Initiate a SageMaker training job using the full dataset from the S3 bucket using Pipe input mode.
  • D. Load a smaller subset of the data into the SageMaker notebook and train locally. Confirm that the training code is executing and the model parameters seem reasonable. Launch an Amazon EC2 instance with an AWS Deep Learning AMI and attach the S3 bucket to train the full dataset.
Click to View Verified Solution & Explanation

Correct Option: A

Explanation: ✅ Choice A: Load a smaller subset of the data into the SageMaker notebook and train locally. Confirm that the training code is executing and the model parameters seem reasonable. Initiate a SageMaker training job using the full dataset from the S3 bucket using Pipe input mode.

Description: This approach outlines a standard and highly recommended development workflow for machine learning models on Amazon SageMaker. It combines iterative local development and debugging with scalable, managed training.

Why this fits:

  1. Local Development and Debugging: Training with a small subset of data locally within a SageMaker notebook instance allows for rapid iteration, debugging of code, and verification of model logic without incurring the cost and time overhead of full-scale managed training jobs. This helps catch syntax errors, data loading issues, and basic model misconfigurations early.
  2. Efficient Scaling with SageMaker Training Jobs: Once the basic code is validated, initiating a SageMaker training job leverages the platform’s managed services for scalable and efficient training. SageMaker handles infrastructure provisioning, setup, and monitoring.
  3. Pipe Input Mode: For large datasets stored in S3, Pipe input mode is generally more efficient than File mode. In Pipe mode, data is streamed directly from S3 to the training instances as it’s needed, reducing startup times and potentially lowering storage costs on the training instances, especially when dealing with extremely large datasets that might not fit entirely on the instance’s local storage. This minimizes the time spent on data downloading and can improve training throughput.

    Example: A data scientist is developing a new deep learning model for image classification. They start by loading a few hundred images into their SageMaker notebook instance and train the model for a few epochs to ensure the data loaders work, the model architecture is correctly defined, and loss decreases. After confirming the code’s basic functionality, they launch a SageMaker training job configured to use Pipe input mode to stream the full dataset of millions of images directly from an S3 bucket to a cluster of GPU instances, significantly accelerating the training process.

QUESTION 10

A Machine Learning Specialist has completed a proof of concept for a company using a small data sample, and now the Specialist is ready to implement an end-to-end solution in AWS using Amazon SageMaker. The

historical training data is stored in Amazon RDS.

Which approach should the Specialist use for training a model using that data?

  • A. Write a direct connection to the SQL database within the notebook and pull data in
  • B. Push the data from Microsoft SQL Server to Amazon S3 using an AWS Data Pipeline and provide the S3 location within the notebook.
  • C. Move the data to Amazon DynamoDB and set up a connection to DynamoDB within the notebook to pull data in.
  • D. Move the data to Amazon ElastiCache using AWS DMS and set up a connection within the notebook to pull data in for fast access.
Click to View Verified Solution & Explanation

Correct Option: B

Explanation: ✅ Push the data from Microsoft SQL Server to Amazon S3 using an AWS Data Pipeline and provide the S3 location within the notebook.

Description: AWS Data Pipeline is a web service designed to reliably process and move data between different AWS compute and storage services, as well as on-premises data sources, at specified intervals. It enables the creation of complex data processing workloads, including ETL (Extract, Transform, Load) operations. Amazon S3 (Simple Storage Service) is a highly scalable, durable, and secure object storage service widely used as the primary data lake for machine learning workloads on AWS.

Why this fits: For machine learning workflows in Amazon SageMaker, Amazon S3 is the recommended and most cost-effective storage solution for training data. SageMaker notebooks and training jobs are optimized to efficiently read data from S3 buckets. Using AWS Data Pipeline allows for the automated and scheduled extraction of data from an on-premises source like Microsoft SQL Server, transformation if necessary, and loading into S3. This approach ensures data freshness, decouples the on-premises database from the ML environment, improves scalability, and streamlines access for SageMaker, adhering to best practices for production-ready ML pipelines.

Example: A company stores its customer transaction data in an on-premises Microsoft SQL Server. To train a fraud detection model using Amazon SageMaker, an AWS Data Pipeline is configured to run daily. This pipeline connects to the SQL Server, extracts new transaction records, converts them into a Parquet format, and uploads them to a specific S3 bucket (e.g., s3://ml-training-data/transactions/). Within the SageMaker notebook, the data scientist can then simply specify this S3 path to load the latest data for feature engineering and model training.

QUESTION 11

A Machine Learning Specialist is working with a large company to leverage machine learning within its products. The company wants to group its customers into categories based on which customers will and will not churn within the next 6 months. The company has labeled the data available to the Specialist.

Which machine learning model type should the Specialist use to accomplish this task?

  • A. Linear regression
  • B. Classification
  • C. Clustering
  • D. Reinforcement learning
Click to View Verified Solution & Explanation

Correct Option: B

Explanation: ✅ Classification

Description: Classification is a supervised machine learning task that involves predicting a categorical label or class for given input data. The output is a discrete value, representing one of several predefined categories (e.g., spam/not spam, benign/malignant, cat/dog).

Why this fits: This machine learning task is appropriate when the goal is to assign items to one of a fixed number of categories or classes. For instance, if a problem asks to predict whether an email is "spam" or "not spam," the model is classifying the email into one of two distinct categories. Similarly, identifying if an image contains a "cat" or "dog" is a classification task. This differs from regression, which predicts continuous values, or clustering, which groups unlabeled data.

Example: A company wants to develop a model to predict whether a customer will churn (cancel their subscription) based on their usage patterns and demographics. This is a binary classification problem, where the model outputs either "churn" or "no churn." Other examples include sentiment analysis (positive, negative, neutral) or image recognition (identifying objects in an image).

QUESTION 12

The displayed graph is from a forecasting model for testing a time series.

Considering the graph only, which conclusion should a Machine Learning Specialist make about the behavior of the model?

  • A. The model predicts both the trend and the seasonality well
  • B. The model predicts the trend well, but not the seasonality.
  • C. The model predicts the seasonality well, but not the trend.
  • D. The model does not predict the trend or the seasonality well.
Click to View Verified Solution & Explanation

Correct Option: A

Explanation: ✅ The model predicts both the trend and the seasonality well

Description: In time series forecasting, the trend refers to the long-term increase or decrease in the data over time, representing the general direction of the series. Seasonality refers to repetitive, predictable patterns or cycles in the data that occur over a fixed period (e.g., daily, weekly, monthly, yearly), often driven by calendar events or recurring factors.

Why this fits: Observing the "Daily Sales – Actuals Vs Forecast" chart, the Actuals line (blue) demonstrates a clear upward trajectory over the entire period, indicating a positive trend. The Forecast line (green) also follows this general upward slope, successfully capturing the overall increasing trend. Furthermore, the Actuals line exhibits distinct, recurring peaks and troughs at regular intervals, which signifies seasonality. The Forecast line mirrors these periodic fluctuations, showing similar rises and falls in alignment with the Actuals, albeit at a lower magnitude. This indicates that the model has learned and predicted the seasonal patterns effectively. Although the forecast values are lower than the actuals, the shape and direction of both the long-term trend and the short-term seasonal cycles are well-matched.

Example: An accurate forecasting model for a retail business would not only predict increasing sales over several years (trend) but also anticipate higher sales during holiday seasons and specific days of the week (seasonality), even if the exact sales volume isn’t perfectly matched. This chart shows the model correctly identifying both the upward growth and the recurring up-and-down movements.

QUESTION 13

A company wants to classify user behavior as either fraudulent or normal. Based on internal research, a Machine Learning Specialist would like to build a binary classifier based on two features: age of account and transaction month. The class distribution for these features is illustrated in the figure provided.

Based on this information, which model would have the HIGHEST accuracy?

  • A. Long short-term memory (LSTM) model with scaled exponential linear unit (SELU)
  • B. Logistic regression
  • C. Support vector machine (SVM) with non-linear kernel
  • D. Single perceptron with tanh activation function
Click to View Verified Solution & Explanation

Correct Option: C

Explanation: ✅ Support vector machine (SVM) with non-linear kernel

Description: Support Vector Machines (SVMs) are powerful supervised learning algorithms used for classification. When data points belonging to different classes are not separable by a straight line or hyperplane in their original feature space (i.e., they are non-linearly separable), SVMs can employ the "kernel trick." A non-linear kernel function (e.g., Radial Basis Function (RBF), polynomial) implicitly maps the data into a higher-dimensional feature space where it can be linearly separated. This allows the SVM to learn complex, non-linear decision boundaries in the original feature space.

Why this fits: The provided "Data Visualization Plot" displays "Normal" and "Fraudulent" data points. The "Fraudulent" data points form a distinct, circular cluster in the center, completely surrounded by "Normal" data points. This configuration is a classic example of non-linearly separable data. A linear model would be unable to draw a single straight line to separate the inner circular cluster from the outer points. An SVM with a non-linear kernel is perfectly suited for this scenario because it can learn and define a non-linear boundary (e.g., a circle or ellipse) to effectively separate the concentric classes by projecting the data into a higher dimension.

Example: In anomaly detection for financial transactions, if fraudulent activities often cluster in a specific, non-linear pattern based on features like transaction amount and time of day (e.g., a "ring" of suspicious activity), an SVM with an RBF kernel could be used to identify and classify these patterns, drawing a complex boundary to isolate the anomalous transactions, similar to how it would separate the "Fraudulent" transactions in this plot.

QUESTION 14

A Machine Learning Specialist at a company sensitive to security is preparing a dataset for model training. The dataset is stored in Amazon S3 and contains Personally Identifiable Information (PII).

The dataset:

Must be accessible from a VPC only. Must not traverse the public internet.

How can these requirements be satisfied?

  • A. Create a VPC endpoint and apply a bucket access policy that restricts access to the given VPC endpoint
  • B. Create a VPC endpoint and apply a bucket access policy that allows access from the given VPC endpoint and an Amazon EC2 instance.
  • C. Create a VPC endpoint and use Network Access Control Lists (NACLs) to allow traffic between only the given VPC endpoint and an Amazon EC2 instance.
  • D. Create a VPC endpoint and use security groups to restrict access to the given VPC endpoint and an Amazon EC2 instance
Click to View Verified Solution & Explanation

Correct Option: A

Explanation: ✅ Create a VPC endpoint and apply a bucket access policy that restricts access to the given VPC endpoint

Description: A VPC endpoint allows resources within your Amazon Virtual Private Cloud (VPC) to privately connect to AWS services, such as Amazon S3, without traversing the public internet. For S3, this typically involves a Gateway VPC Endpoint. An S3 bucket access policy is a resource-based policy attached directly to an S3 bucket that uses JSON to specify who has access to the bucket and its objects, and what actions they can perform.

Why this fits: This approach combines network-level private connectivity with resource-level access control. By creating a Gateway VPC Endpoint for S3, you ensure that traffic from your VPC to S3 stays within the AWS network. Crucially, by applying a bucket policy that explicitly includes a condition to restrict access only to requests originating from that specific VPC endpoint (e.g., using aws:SourceVpce or aws:SourceVpc condition keys), you enforce that all access to the S3 bucket must pass through your private endpoint. This enhances security by preventing access from outside the private VPC path, even if the request is otherwise authenticated.

Example: An organization stores sensitive training datasets and model artifacts in an S3 bucket. To ensure that only machine learning workflows running on EC2 instances within a specific private VPC can access this data, a Gateway VPC endpoint for S3 is configured in that VPC. The S3 bucket policy is then updated to explicitly deny all s3:* actions unless the request includes the aws:SourceVpce condition matching the ID of the created VPC endpoint. This prevents any access attempts from outside the designated private network path.

QUESTION 15

During mini-batch training of a neural network for a classification problem, a Data Scientist notices that training accuracy oscillates.

What is the MOST likely cause of this issue?

  • A. The class distribution in the dataset is imbalanced.
  • B. Dataset shuffling is disabled.
  • C. The batch size is too big.
  • D. The learning rate is very high.
Click to View Verified Solution & Explanation

Correct Option: D

Explanation: ✅ The learning rate is very high.

Description: The learning rate is a critical hyperparameter that controls the step size at which a model’s parameters (weights) are updated during training in response to the estimated error each time the model’s weights are updated. It determines how quickly or slowly the model "learns" from the training data.

Why this fits: When the learning rate is set excessively high, the model’s weight updates can become too aggressive. This causes the optimizer to overshoot the minimum of the loss function, leading to oscillations around the minimum, divergence, or even numerical instability where the loss can increase exponentially or become undefined (e.g., NaN). Consequently, the training loss will fail to decrease, or it will actively increase, indicating that the model is unable to converge to an optimal solution. This is a classic symptom of an unstable training process.

Example: Imagine using gradient descent to find the lowest point in a bowl. If your step size (learning rate) is too large, you might repeatedly jump over the bottom, landing on the opposite side, and then jump back again, never settling at the lowest point. In a neural network, this translates to the model’s performance worsening rather than improving with each epoch.

QUESTION 16

An employee found a video clip with audio on a company’s social media feed. The language used in the video is Spanish. English is the employee’s first language, and they do not understand Spanish. The employee wants to do a sentiment analysis.

What combination of services is the MOST efficient to accomplish the task?

  • A. Amazon Transcribe, Amazon Translate, and Amazon Comprehend
  • B. Amazon Transcribe, Amazon Comprehend, and Amazon SageMaker seq2seq
  • C. Amazon Transcribe, Amazon Translate, and Amazon SageMaker Neural Topic Model (NTM)
  • D. Amazon Transcribe, Amazon Translate and Amazon SageMaker BlazingText
Click to View Verified Solution & Explanation

Correct Option: A

Explanation: ✅ Amazon Transcribe, Amazon Translate, and Amazon Comprehend

Description: This combination represents a robust workflow for processing spoken language, translating it if necessary, and then extracting valuable insights using natural language processing (NLP).

  • Amazon Transcribe is an automatic speech recognition (ASR) service that converts audio into accurate and readable text. It supports multiple languages and can handle various audio formats.
  • Amazon Translate is a neural machine translation service that delivers fast, high-quality, and affordable language translation. It can translate text between a wide range of supported languages.
  • Amazon Comprehend is a natural language processing (NLP) service that uses machine learning to find insights and relationships in text. It can identify entities, key phrases, language, sentiment, and more, as well as perform topic modeling and custom classification.

    Why this fits: This set of services provides an end-to-end solution for a common machine learning challenge: taking audio input (e.g., customer service calls, media content), converting it to text (Transcribe), making it accessible across language barriers (Translate), and then analyzing the content for actionable intelligence (Comprehend). Each service is a fully managed, purpose-built AI service that integrates easily with the others, minimizing the need for custom model development and deployment. This approach aligns with best practices for leveraging AWS’s AI services for specialized machine learning tasks.

    Example: A global customer service center records calls in various languages. Amazon Transcribe converts the audio to text. If a call is in Spanish, Amazon Translate can translate the transcript to English. Finally, Amazon Comprehend analyzes the translated text to identify product issues, customer sentiment, or key entities mentioned during the call, enabling proactive responses or trend analysis.

QUESTION 17

A Machine Learning Specialist is packaging a custom ResNet model into a Docker container so the company can leverage Amazon SageMaker for training. The Specialist is using Amazon EC2 P3 instances to train the model and needs to properly configure the Docker container to leverage the NVIDIA GPUs.

What does the Specialist need to do?

  • A. Bundle the NVIDIA drivers with the Docker image.
  • B. Build the Docker container to be NVIDIA-Docker compatible.
  • C. Organize the Docker container's file structure to execute on GPU instances.
  • D. Set the GPU flag in the Amazon SageMaker CreateTrainingJob request body.
Click to View Verified Solution & Explanation

Correct Option: B

Explanation: ✅ Build the Docker container to be NVIDIA-Docker compatible.

Description: NVIDIA-Docker is an extension that allows Docker containers to leverage host NVIDIA GPUs by mounting the necessary drivers and CUDA libraries from the host system into the container. Building a container to be "NVIDIA-Docker compatible" (or more generally, compatible with the Docker engine’s --gpus all flag) means creating a Docker image that includes the required CUDA toolkit, cuDNN libraries, and deep learning frameworks, so it can correctly interface with the GPU resources made available by the host.

Why this fits: Amazon SageMaker runs your custom Docker containers on EC2 instances. For a container to utilize the GPUs on a SageMaker GPU instance, it must be specifically built to access those GPU resources. The host instance has NVIDIA drivers installed, but the container itself needs the CUDA runtime and potentially cuDNN libraries to interact with those drivers. Building the container with NVIDIA-Docker compatibility (e.g., by using an NVIDIA CUDA base image like nvidia/cuda:x.x-cudnnx-runtime) ensures that when SageMaker launches your container on a GPU instance, the container can successfully detect and use the available GPUs for accelerated computation. Without this compatibility, even if the underlying SageMaker instance has GPUs, the container will not be able to utilize them.

Example: To create a custom TensorFlow GPU training image for SageMaker, you would typically start your Dockerfile with a base image like FROM nvidia/cuda:11.8.0-cudnn8-runtime-ubuntu22.04. This base image already contains the necessary CUDA toolkit and cuDNN libraries. You would then install TensorFlow with GPU support within this image. When SageMaker provisions an ml.p3 or ml.g5 instance for your training job, it runs your container, which can then use the GPUs because it was built with the required compatibility.

QUESTION 18

A Machine Learning Specialist is building a logistic regression model that will predict whether or not a person will order a pizza. The Specialist is trying to build the optimal model with an ideal classification threshold.

What model evaluation technique should the Specialist use to understand how different classification thresholds will impact the model’s performance?

  • A. Receiver operating characteristic (ROC) curve
  • B. Misclassification rate
  • C. Root Mean Square Error (RMSE)
  • D. L1 norm
Click to View Verified Solution & Explanation

Correct Option: A

Explanation: ✅ Receiver operating characteristic (ROC) curve

Description: A Receiver Operating Characteristic (ROC) curve is a graphical plot that illustrates the diagnostic ability of a binary classifier system as its discrimination threshold is varied. It plots the True Positive Rate (TPR, also known as sensitivity or recall) against the False Positive Rate (FPR, also known as 1-specificity) at various threshold settings. The Area Under the Curve (AUC) is a common metric derived from the ROC curve, summarizing its performance across all possible classification thresholds.

Why this fits: ROC curves are particularly useful for evaluating binary classification models, especially when there is an imbalanced dataset or when the costs of false positives versus false negatives are different. By visualizing the trade-off between TPR and FPR, data scientists can choose an optimal classification threshold that best suits the problem’s business requirements. A higher AUC-ROC value generally indicates a better performing model. For the MLS-C01 exam, understanding these evaluation metrics is crucial for model selection and optimization.

Example: When building a fraud detection model using Amazon SageMaker, a data scientist might use an ROC curve to evaluate the model’s performance. The curve would show how well the model identifies fraudulent transactions (True Positives) versus incorrectly flagging legitimate transactions as fraudulent (False Positives) across different probability thresholds. This allows them to select a threshold that minimizes false alarms while still catching a high percentage of actual fraud.

QUESTION 19

An interactive online dictionary wants to add a widget that displays words used in similar contexts. A Machine Learning Specialist is asked to provide word features for the downstream nearest neighbor model powering the widget.

What should the Specialist do to meet these requirements?

  • A. Create one-hot word encoding vectors.
  • B. Produce a set of synonyms for every word using Amazon Mechanical Turk.
  • C. Create word embedding vectors that store edit distance with every other word.
  • D. Download word embeddings pre-trained on a large corpus.
Click to View Verified Solution & Explanation

Correct Option: D

Explanation: ✅ Download word embeddings pre-trained on a large corpus.

Description: Pre-trained word embeddings are vector representations of words that have been learned from massive text corpora (e.g., Wikipedia, Common Crawl, Google News). These embeddings, such as Word2Vec, GloVe, or fastText, capture semantic relationships and syntactic regularities between words based on their co-occurrence patterns in the training data. Each word is mapped to a vector in a continuous vector space, where words with similar meanings are located closer together.

Why this fits: For most machine learning tasks involving natural language processing (NLP), especially when starting a new project or working with limited domain-specific data, downloading pre-trained word embeddings is the most efficient and effective approach. Training custom word embeddings from scratch requires a very large amount of text data and significant computational resources, which is often not feasible. Pre-trained embeddings provide a strong baseline, generalize well across many tasks, and save considerable time and effort. Options A and C describe methods for creating embeddings but are generally less efficient than leveraging pre-trained models, while Option B is related to generating synonyms, not directly creating word embeddings for semantic representation.

Example: An NLP engineer is building a sentiment analysis model for customer reviews. Instead of training word embeddings from scratch on their relatively small dataset of reviews, they can download pre-trained GloVe embeddings. They then use these pre-trained embeddings as the initial layer in their neural network, fine-tuning them slightly during the training process with their review data to adapt them to the specific domain.

QUESTION 20 (Multi-Select)

A Machine Learning Specialist is configuring Amazon SageMaker so multiple Data Scientists can access notebooks, train models, and deploy endpoints. To ensure the best operational performance, the Specialist needs to be able to track how often the Scientists are deploying models, GPU and CPU utilization on the deployed SageMaker endpoints, and all errors that are generated when an endpoint is invoked.

Which services are integrated with Amazon SageMaker to track this information? (Choose two.)

  • A. AWS CloudTrail
  • B. AWS Health
  • C. AWS Trusted Advisor
  • D. Amazon CloudWatch
  • E. AWS Config
Click to View Verified Solution & Explanation

Correct Option: A,D

Explanation: ✅ AWS CloudTrail

Description: AWS CloudTrail is a service that enables governance, compliance, operational auditing, and risk auditing of your AWS account. It records actions taken by a user, role, or an AWS service as events. These events include actions performed through the AWS Management Console, AWS SDKs, command line tools, and other AWS services.

Why this fits: For monitoring AWS Machine Learning workloads, CloudTrail is critical for auditing API calls made to ML services like Amazon SageMaker, Amazon Rekognition, or Amazon Comprehend. This allows organizations to track administrative and data plane activities, such as who initiated a training job, who modified a model endpoint configuration, or who accessed data in an S3 bucket used by an ML pipeline. This provides a comprehensive security and operational audit trail.

Example: A data scientist updates the configuration of an existing SageMaker endpoint. CloudTrail records the UpdateEndpoint API call, capturing details like the user identity, the exact timestamp, the source IP address, and the specific parameters of the update. This record is invaluable for security auditing and compliance.


✅ Amazon CloudWatch

Description: Amazon CloudWatch is a monitoring and observability service that provides data and actionable insights to monitor applications, respond to system-wide performance changes, optimize resource utilization, and get a unified view of operational health. It collects monitoring and operational data in the form of logs, metrics, and events.

Why this fits: CloudWatch is essential for real-time performance and health monitoring of ML workloads. It collects various metrics from ML services (e.g., SageMaker training job CPU/GPU utilization, memory usage, endpoint invocation latency, error rates). It allows for the creation of custom dashboards to visualize these metrics, and the configuration of alarms to proactively notify stakeholders of potential issues, performance degradation, or operational failures. It also centralizes logs from ML applications and services, aiding in troubleshooting.

Example: During a SageMaker model training job, CloudWatch monitors resource utilization metrics like CPUUtilization, GPUUtilization, and MemoryUtilization. An alarm can be configured to trigger if CPUUtilization drops below a certain threshold for an extended period, potentially indicating an inefficient training job or a stalled process, prompting investigation.

QUESTION 21

A retail chain has been ingesting purchasing records from its network of 20,000 stores to Amazon S3 using Amazon Kinesis Data Firehose. To support training an improved machine learning model, training records will require new but simple transformations, and some attributes will be combined. The model needs to be retrained daily.

Given the large number of stores and the legacy data ingestion, which change will require the LEAST amount of development effort?

  • A. Require that the stores to switch to capturing their data locally on AWS Storage Gateway for loading into Amazon S3, then use AWS Glue to do the transformation.
  • B. Deploy an Amazon EMR cluster running Apache Spark with the transformation logic, and have the cluster run each day on the accumulating records in Amazon S3, outputting new/transformed records to Amazon S3.
  • C. Spin up a fleet of Amazon EC2 instances with the transformation logic, have them transform the data records accumulating on Amazon S3, and output the transformed records to Amazon S3.
  • D. Insert an Amazon Kinesis Data Analytics stream downstream of the Kinesis Data Firehose stream that transforms raw record attributes into simple transformed values using SQL.
Click to View Verified Solution & Explanation

Correct Option: D

Explanation: ✅ Insert an Amazon Kinesis Data Analytics stream downstream of the Kinesis Data Firehose stream that transforms raw record attributes into simple transformed values using SQL.

Description: Amazon Kinesis Data Analytics (KDA) is a fully managed service designed to process and analyze streaming data in real time. It allows users to write SQL queries against incoming data streams to perform transformations, aggregations, and enrichments without needing to manage servers or infrastructure. It integrates seamlessly with Kinesis Data Firehose as both an input and output source.

Why this fits: This solution directly addresses the requirement for transforming raw record attributes into simple transformed values using SQL, specifically within a streaming context that leverages Kinesis Data Firehose. Kinesis Data Analytics for SQL applications provides a serverless and scalable way to perform these transformations in real time, making it ideal for processing data immediately after ingestion via Kinesis Data Firehose. It eliminates the operational overhead associated with managing compute instances (like EC2 or EMR) while offering robust real-time processing capabilities through a familiar SQL interface.

Example: A retail company streams raw customer clickstream data from its website via Kinesis Data Firehose. Before archiving this data to Amazon S3, they need to extract the product ID and categorize the event type (e.g., ‘view’, ‘add_to_cart’) from a complex JSON payload and calculate a simplified session duration. An Amazon Kinesis Data Analytics SQL application can be inserted downstream of the Firehose. It reads the raw JSON, applies SQL queries like SELECT JSON_VALUE(raw_data, '$.product.id') AS productId, CASE WHEN JSON_VALUE(raw_data, '$.event') LIKE '%view%' THEN 'view' ELSE 'other' END AS eventCategory FROM SOURCE_SQL_STREAM_001 to perform the necessary transformations, and then outputs the clean, transformed data to another Kinesis Data Firehose stream for delivery to S3.

QUESTION 22

A Machine Learning Specialist is building a convolutional neural network (CNN) that will classify 10 types of animals. The Specialist has built a series of layers in a neural network that will take an input image of an animal, pass it through a series of convolutional and pooling layers, and then finally pass it through a dense and fully connected layer with 10 nodes. The Specialist would like to get an output from the neural network that is a probability distribution of how likely it is that the input image belongs to each of the 10 classes.

Which function will produce the desired output?

  • A. Dropout
  • B. Smooth L1 loss
  • C. Softmax
  • D. Rectified linear units (ReLU)
Click to View Verified Solution & Explanation

Correct Option: C

Explanation: ✅ Softmax

Description: Softmax is an activation function used in the output layer of a neural network primarily for multi-class classification problems. It takes a vector of arbitrary real-valued scores (logits) and squashes them into a probability distribution over multiple classes. Each element of the output vector is a probability between 0 and 1, and the sum of all elements in the output vector is 1.

Why this fits: For multi-class classification, where an input belongs to exactly one of several possible classes, Softmax is the appropriate choice for the output layer’s activation function. It ensures that the model’s output can be interpreted as the probability of the input belonging to each class, which is crucial for decision-making and often paired with a cross-entropy loss function during training.

Example: In an image classification task aiming to identify whether an image contains a "cat," "dog," or "bird," the output layer of the neural network would typically have three neurons, one for each class. Applying the Softmax function to the outputs of these three neurons would yield a probability distribution, for instance, [0.1, 0.85, 0.05], indicating an 85% probability that the image is a "dog."

QUESTION 23

A Machine Learning Specialist trained a regression model, but the first iteration needs optimizing. The Specialist needs to understand whether the model is more frequently overestimating or underestimating the target.

What option can the Specialist use to determine whether it is overestimating or underestimating the target value?

  • A. Root Mean Square Error (RMSE)
  • B. Residual plots
  • C. Area under the curve
  • D. Confusion matrix
Click to View Verified Solution & Explanation

Correct Option: B

Explanation: ✅ Residual plots

Description: Residual plots are graphical tools used in regression analysis to visualize the difference between the observed and predicted values (residuals) from a model. These plots typically display the residuals on the y-axis against the predicted values, an independent variable, or the order of observations on the x-axis.

Why this fits: Residual plots are an essential diagnostic tool for regression models. They allow data scientists to visually inspect key assumptions of a regression model, such as linearity, homoscedasticity (constant variance of errors), and independence of errors. By identifying systematic patterns (e.g., a curve, a funnel shape, or unusual clusters), outliers, or trends in the residuals, these plots help in diagnosing model inadequacies, identifying whether a different model form (e.g., non-linear) is needed, or confirming the robustness of the model’s assumptions. Unlike numerical metrics like RMSE, residual plots provide qualitative insights into the model’s error distribution.

Example: After training a linear regression model to predict housing prices using Amazon SageMaker, a data scientist might generate a residual plot. If the plot shows residuals randomly scattered around zero with no clear pattern, it suggests that the linear model is a good fit and its assumptions are largely met. However, if the plot reveals a distinct "U" shape, it indicates that the linear model might be underfitting and that a non-linear relationship (e.g., quadratic term for a feature) may exist, requiring model refinement.

QUESTION 24

A company wants to classify user behavior as either fraudulent or normal. Based on internal research, a Machine Learning Specialist would like to build a binary classifier based on two features: age of account and transaction month. The class distribution for these features is illustrated in the figure provided.

Based on this information, which model would have the HIGHEST recall with respect to the fraudulent class?

  • A. Decision tree
  • B. Linear support vector machine (SVM)
  • C. Naive Bayesian classifier
  • D. Single Perceptron with sigmoidal activation function
Click to View Verified Solution & Explanation

Correct Option: C

Explanation: ✅ Naive Bayesian classifier

Description: A Naive Bayesian classifier is a probabilistic machine learning model used for classification tasks. It operates on Bayes’ theorem with the "naive" assumption of conditional independence between features given the class label. Despite this simplifying assumption, Naive Bayes classifiers are known for their efficiency and often perform surprisingly well on complex real-world problems. When using Gaussian distributions for continuous features (Gaussian Naive Bayes), it can define non-linear decision boundaries by comparing the likelihoods derived from the class-conditional probability density functions, which can have different means and covariance matrices for each class.

Why this fits: The provided data visualization plot shows a distinct cluster of "Fraudulent" transactions (orange dots) forming a roughly circular region, which is surrounded by "Normal" transactions (black dots). This pattern represents data that is not linearly separable, meaning no single straight line (or hyperplane in higher dimensions) can effectively separate the two classes. Linear classifiers like a Linear Support Vector Machine (SVM) or a Single Perceptron would perform poorly on such data. A Naive Bayesian classifier, especially a Gaussian Naive Bayes, can learn to separate such concentric data patterns. By modeling the probability distributions for each class, if the "Fraudulent" data forms a compact Gaussian distribution and the "Normal" data forms a different, wider Gaussian distribution around it, the decision boundary (where the posterior probabilities for both classes are equal) can naturally be non-linear, such as an ellipse or a circle, effectively distinguishing the inner cluster from the outer points.

Example: Consider a scenario in credit card fraud detection where fraudulent transactions typically occur within a specific range of "Transaction Month" and "Age of Account," forming a compact cluster, while normal transactions are more widely distributed. A Gaussian Naive Bayes classifier could learn the parameters (mean and variance) for the "Fraudulent" class’s distinct, localized distribution and the "Normal" class’s broader distribution. Based on these learned distributions, it could identify new transactions as fraudulent if they fall within the high-probability region of the "Fraudulent" class’s distribution, thereby creating a non-linear, possibly circular, decision boundary similar to what is required to separate the data in the plot.

QUESTION 25

A Machine Learning Specialist kicks off a hyperparameter tuning job for a tree-based ensemble model using Amazon SageMaker with Area Under the ROC Curve (AUC) as the objective metric. This workflow will eventually be deployed in a pipeline that retrains and tunes hyperparameters each night to model click-through on data that goes stale every 24 hours.

With the goal of decreasing the amount of time it takes to train these models, and ultimately to decrease costs, the Specialist wants to reconfigure the input hyperparameter range(s).

Which visualization will accomplish this?

  • A. A histogram showing whether the most important input feature is Gaussian.
  • B. A scatter plot with points colored by target variable that uses t-Distributed Stochastic Neighbor Embedding (t-SNE) to visualize the large number of input variables in an easier-to-read dimension.
  • C. A scatter plot showing the performance of the objective metric over each training iteration.
  • D. A scatter plot showing the correlation between maximum tree depth and the objective metric.
Click to View Verified Solution & Explanation

Correct Option: D

Explanation: ✅ A scatter plot showing the correlation between maximum tree depth and the objective metric.

Description: Maximum tree depth is a crucial hyperparameter in tree-based machine learning models (e.g., decision trees, random forests, gradient boosting machines like XGBoost). It controls how many splits each tree can make, directly influencing the model’s complexity and its capacity to learn intricate patterns in the data. The "objective metric" refers to the specific evaluation criterion (e.g., accuracy, F1-score, RMSE, AUC) that the model is optimized for or evaluated against. A scatter plot visualizing the relationship between these two provides insights into how changes in tree depth affect model performance.

Why this fits: In the context of machine learning model development, especially during hyperparameter tuning, understanding the impact of key hyperparameters on model performance is paramount. A scatter plot showing the objective metric against varying maximum tree depths allows data scientists to identify potential optimal values, observe trade-offs between model complexity and performance, detect overfitting (where deeper trees perform well on training but poorly on validation) or underfitting (where shallow trees cannot capture enough complexity), and guide the tuning process. This is a standard and highly effective visualization for diagnosing and improving model performance.

Example: When using Amazon SageMaker’s built-in XGBoost algorithm for a classification task, a data scientist might conduct a hyperparameter tuning job, exploring different values for max_depth (e.g., from 3 to 15). After the tuning job completes, they would plot the validation F1-score (their objective metric) obtained from each run against the max_depth used in that run. This scatter plot would help pinpoint the max_depth value that yields the highest F1-score on the validation set, indicating the best balance between bias and variance for their model.

QUESTION 26 (Multi-Select)

A Machine Learning Specialist is creating a new natural language processing application that processes a dataset comprised of 1 million sentences. The aim is to then run Word2Vec to generate embeddings of the sentences and enable different types of predictions.

Here is an example from the dataset:

"The quck BROWN FOX jumps over the lazy dog.”

Which of the following are the operations the Specialist needs to perform to correctly sanitize and prepare the data in a repeatable manner? (Choose three.)

  • A. Perform part-of-speech tagging and keep the action verb and the nouns only.
  • B. Normalize all words by making the sentence lowercase.
  • C. Remove stop words using an English stopword dictionary.
  • D. Correct the typography on "quck" to "quick.”
  • E. One-hot encode all words in the sentence.
  • F. Tokenize the sentence into words.
Click to View Verified Solution & Explanation

Correct Option: B,C,F

Explanation: ✅ Normalize all words by making the sentence lowercase.

Description: Normalization is a preprocessing step that transforms text into a canonical or standard form. Lowercasing is a specific normalization technique where all uppercase letters in the text are converted to lowercase.

Why this fits: In natural language processing (NLP), lowercasing helps to treat words like "Apple" and "apple" as the same token, thereby reducing the vocabulary size and ensuring consistency in feature representation. This is crucial for machine learning models to prevent them from learning separate representations for semantically identical words, which can improve model efficiency and accuracy. AWS services such as Amazon Comprehend or SageMaker-based NLP solutions commonly incorporate or benefit from such normalization.

Example: The phrase "AWS Machine Learning is EXCITING!" becomes "aws machine learning is exciting!" after lowercasing.


✅ Remove stop words using an English stopword dictionary.

Description: Stop words are common words in a language (e.g., "the", "is", "a", "an", "in", "for") that typically carry little unique semantic meaning and are often filtered out during text preprocessing.

Why this fits: Removing stop words helps to reduce noise and dimensionality in the text data, allowing machine learning models to focus on more significant terms. This process is particularly beneficial for tasks such as text classification, sentiment analysis, or topic modeling, where these frequent words might not contribute substantially to the predictive power of the model. Many AWS Machine Learning services and algorithms, especially those for text analysis (e.g., Amazon SageMaker’s BlazingText or custom models built with NLP libraries), can be configured to perform or implicitly benefit from stop word removal.

Example: From the sentence "The machine learning model is very accurate.", removing common English stop words ("The", "is", "very") would result in "machine learning model accurate.".


✅ Tokenize the sentence into words.

Description: Tokenization is the fundamental process of breaking down a continuous stream of text into smaller, meaningful units called tokens. For word-level tokenization, this involves splitting sentences or paragraphs into individual words or punctuation marks.

Why this fits: Tokenization is typically the first essential step in almost any NLP pipeline. Machine learning models cannot directly process raw text; they require text to be converted into a structured sequence of tokens that can then be further processed into numerical representations (e.g., embeddings or bag-of-words features). AWS services like Amazon Comprehend and various built-in algorithms within Amazon SageMaker (e.g., BlazingText) inherently rely on tokenized input for their text analysis and model training capabilities.

Example: The sentence "Machine learning is powerful!" would be tokenized into a list of tokens such as ["Machine", "learning", "is", "powerful", "!"].

QUESTION 27

A company is using Amazon Polly to translate plaintext documents to speech for automated company announcements. However, company acronyms are being mispronounced in the current documents.

How should a Machine Learning Specialist address this issue for future documents?

  • A. Convert current documents to SSML with pronunciation tags.
  • B. Create an appropriate pronunciation lexicon.
  • C. Output speech marks to guide in pronunciation.
  • D. Use Amazon Lex to preprocess the text files for pronunciation
Click to View Verified Solution & Explanation

Correct Option: B

Explanation: ✅ Create an appropriate pronunciation lexicon.

Description: Amazon Polly supports the use of pronunciation lexicons, which are XML-based files written according to the W3C Pronunciation Lexicon Specification (PLS) format. These lexicons allow users to define custom pronunciations for specific words, acronyms, or proper nouns that Amazon Polly might otherwise mispronounce or pronounce inconsistently. When a lexicon is applied during the text-to-speech synthesis process, Polly consults the lexicon and applies the specified pronunciation rules if a match is found in the input text.

Why this fits: Creating and applying an appropriate pronunciation lexicon is the most effective and scalable solution for ensuring consistent and correct pronunciations of specific terms across numerous documents or repeated text-to-speech requests. Lexicons provide a persistent and reusable way to manage custom pronunciations.

  • Choice A (Convert current documents to SSML with pronunciation tags): While SSML (Speech Synthesis Markup Language) can include pronunciation tags (<phoneme> or <say-as>), modifying every document to add these tags for every instance of a specific word is labor-intensive and error-prone, especially for a large volume of existing documents. Lexicons offer a centralized, reusable approach.
  • Choice C (Output speech marks to guide in pronunciation): Speech marks are metadata about the synthesized speech (e.g., word boundaries, phonemes, visemes) that Polly outputs. They do not control or guide Polly’s input pronunciation; rather, they describe how Polly did pronounce the text.
  • Choice D (Use Amazon Lex to preprocess the text files for pronunciation): Amazon Lex is a service for building conversational interfaces using natural language understanding (NLU) and automatic speech recognition (ASR). It is not designed for preprocessing text files to control the pronunciation rules for text-to-speech synthesis in Amazon Polly. Its functionality is unrelated to directly managing Polly’s pronunciations.

    Example: If your organization frequently uses a unique product name like "QwikSense" which Polly might mispronounce, you can create a pronunciation lexicon with an entry defining its correct pronunciation using IPA (International Phonetic Alphabet) or an example word. For instance, <lexeme><grapheme>QwikSense</grapheme><phoneme alphabet="ipa">kwɪksɛns</phoneme></lexeme>. This lexicon can then be associated with your Polly requests, ensuring "QwikSense" is always pronounced correctly without modifying the source text for each use.

QUESTION 28 (Multi-Select)

When submitting Amazon SageMaker training jobs using one of the built-in algorithms, which common parameters MUST be specified? (Choose three.)

  • A. The training channel identifying the location of training data on an Amazon S3 bucket.
  • B. The validation channel identifying the location of validation data on an Amazon S3 bucket.
  • C. The IAM role that Amazon Sage Maker can assume to perform tasks on behalf of the users.
  • D. Hyperparameters in a JSON array as documented for the algorithm used.
  • E. The Amazon EC2 instance class specifying whether training will be run using CPU or GPU.
  • F. The output path specifying where on an Amazon S3 bucket the trained model will persist.
Click to View Verified Solution & Explanation

Correct Option: C,E,F

Explanation: ✅ The IAM role that Amazon Sage Maker can assume to perform tasks on behalf of the users.

Description: An IAM (Identity and Access Management) role is an AWS identity with permission policies that determine what actions the identity can and cannot perform in AWS. For Amazon SageMaker, a service role is mandatory for SageMaker to securely access other AWS services and resources, such as S3 buckets for data, Amazon ECR for container images, and Amazon CloudWatch for logging, on behalf of the user during various tasks like training, hosting, or processing.

Why this fits: When you initiate an Amazon SageMaker training job, SageMaker needs explicit permissions to interact with other AWS services. For instance, it must be able to read training data from your specified Amazon S3 location, pull the Docker image for the algorithm from Amazon ECR (if using a custom image), write logs to Amazon CloudWatch, and crucially, write the final trained model artifacts to an Amazon S3 output path. The IAM role provides these essential permissions, ensuring the training job has the necessary access without exposing user credentials.

Example: When using the SageMaker Python SDK, you pass a role ARN (Amazon Resource Name) to the Estimator constructor, like estimator = Estimator(role='arn:aws:iam::123456789012:role/SageMakerExecutionRole', ...). This role must have a trust policy allowing SageMaker to assume it and attached policies granting permissions like s3:GetObject for input data and s3:PutObject for output model artifacts.


✅ The Amazon EC2 instance class specifying whether training will be run using CPU or GPU.

Description: The EC2 instance class (e.g., ml.m5.xlarge, ml.g4dn.xlarge, ml.p3.2xlarge) defines the type and size of the underlying compute resources (CPU, GPU, memory) that Amazon SageMaker provisions for running your training job. This selection directly impacts the computational power, performance, and cost of the training process.

Why this fits: Machine learning model training, especially for large datasets and complex deep learning models, is often computationally intensive. Specifying the correct instance class allows you to choose hardware optimized for your workload. For instance, GPU-accelerated instances (e.g., ml.g4dn, ml.p3) are typically chosen for deep learning tasks due to their parallel processing capabilities, while CPU-based instances (e.g., ml.m5, ml.c5) are suitable for many traditional machine learning algorithms or data preprocessing. This is a fundamental configuration parameter that dictates the training environment.

Example: In the SageMaker Python SDK, when configuring an Estimator, you specify the instance type: estimator = Estimator(instance_type='ml.g4dn.xlarge', instance_count=1, ...). This indicates that a single GPU-enabled instance of the g4dn family will be used for training.


✅ The output path specifying where on an Amazon S3 bucket the trained model will persist.

Description: The output path is an Amazon S3 URI (e.g., s3://your-bucket/model-artifacts/) that designates the location where Amazon SageMaker will upload the compressed archive of the trained model artifacts (e.g., model weights, learned parameters, configuration files) once a training job successfully completes.

Why this fits: After a training job consumes significant computational resources and time, it is crucial to persist the resulting trained model for future use. This output path ensures that the model artifacts are saved to a durable, highly available, and accessible storage location in Amazon S3. From this S3 location, the model can then be used for deployment to a real-time endpoint, batch transformations, further fine-tuning, or archival. SageMaker automatically packages the model and uploads it to this specified path.

Example: When defining an Estimator in the SageMaker Python SDK, you specify the output S3 location: estimator = Estimator(output_path='s3://my-ml-models/customer-churn/', ...). After the estimator.fit() method completes, the trained model artifact (typically a model.tar.gz file) will be found at s3://my-ml-models/customer-churn/your-training-job-name/output/model.tar.gz.

QUESTION 29

A monitoring service generates 1 TB of scale metrics record data every minute. A Research team performs queries on this data using Amazon Athena. The queries run slowly due to the large volume of data, and the team requires better performance.

How should the records be stored in Amazon S3 to improve query performance?

  • A. CSV files
  • B. Parquet files
  • C. Compressed JSON
  • D. RecordIO
Click to View Verified Solution & Explanation

Correct Option: B

Explanation: ✅ Parquet files

Description: Apache Parquet is an open-source columnar storage format designed for efficient data storage and retrieval. It is highly optimized for analytical workloads, offering superior compression and encoding schemes compared to row-oriented formats like CSV or JSON.

Why this fits: For machine learning feature stores, especially when dealing with large datasets in a data lake, Parquet offers significant advantages. Its columnar nature allows for efficient querying of specific features (columns) without reading entire rows, which drastically reduces I/O operations and improves query performance. This is crucial for services like Amazon Athena, Amazon Redshift Spectrum, AWS Glue, and Apache Spark, which are commonly used to prepare and access data for machine learning. The enhanced compression also leads to lower storage costs and faster data transfer.

Example: An MLOps team manages a feature store in Amazon S3 for various models. They store customer demographic data, interaction history, and product preferences. By storing these features in Parquet format, when a model training job only needs specific features (e.g., ‘age’, ‘gender’, ‘last_purchase_date’), the data processing pipeline (e.g., AWS Glue job or Amazon Athena query) can read only those relevant columns efficiently, significantly speeding up data extraction and reducing computational costs compared to processing full CSV or JSON records.

QUESTION 30

Machine Learning Specialist is working with a media company to perform classification on popular articles from the company’s website. The company is using random forests to classify how popular an article will be before it is published. A sample of the data being used is below.

Given the dataset, the Specialist wants to convert the Day_Of_Week column to binary values. What technique should be used to convert this column to binary values?

  • A. Binarization
  • B. One-hot encoding
  • C. Tokenization
  • D. Normalization transformation
Click to View Verified Solution & Explanation

Correct Option: B

Explanation: ✅ One-hot encoding

Description: One-hot encoding is a technique used to convert categorical variables into a numerical format that machine learning algorithms can process. For each unique category in a feature, a new binary column is created. If a data point belongs to that category, the value in the new column is 1; otherwise, it is 0. This method is especially useful for nominal categorical data, where there is no intrinsic order between the categories.

Why this fits: The Day_Of_Week column in the provided data contains categorical values such as ‘Tuesday’, ‘Thursday’, and ‘Monday’. These are nominal categories, meaning there is no inherent ordinal relationship (e.g., ‘Tuesday’ is not "greater" or "less" than ‘Monday’). Machine learning algorithms typically require numerical input, and directly using string values would not work. One-hot encoding transforms these categorical strings into a set of binary features, where each feature represents the presence or absence of a specific day. This prevents the model from incorrectly assuming an ordinal relationship between the days, which could happen if, for example, simple integer encoding were used.

Example: For the Day_Of_Week column, if the unique values are ‘Monday’, ‘Tuesday’, ‘Thursday’, one-hot encoding would create three new columns: Day_Of_Week_Monday, Day_Of_Week_Tuesday, and Day_Of_Week_Thursday.

  • A row with Day_Of_Week: Tuesday would become: Day_Of_Week_Monday: 0, Day_Of_Week_Tuesday: 1, Day_Of_Week_Thursday: 0.
  • A row with Day_Of_Week: Monday would become: Day_Of_Week_Monday: 1, Day_Of_Week_Tuesday: 0, Day_Of_Week_Thursday: 0.

QUESTION 31 (Multi-Select)

A gaming company has launched an online game where people can start playing for free, but they need to pay if they choose to use certain features. The company needs to build an automated system to predict whether or not a new user will become a paid user within 1 year. The company has gathered a labeled dataset from 1 million users.

The training dataset consists of 1,000 positive samples (from users who ended up paying within 1 year) and 999,000 negative samples (from users who did not use any paid features). Each data sample consists of 200 features including user age, device, location, and play patterns.

Using this dataset for training, the Data Science team trained a random forest model that converged with over 99% accuracy on the training set. However, the prediction results on a test dataset were not satisfactory

Which of the following approaches should the Data Science team take to mitigate this issue? (Choose two.)

  • A. Add more deep trees to the random forest to enable the model to learn more features.
  • B. Include a copy of the samples in the test dataset in the training dataset.
  • C. Generate more positive samples by duplicating the positive samples and adding a small amount of noise to
  • D. Change the cost function so that false negatives have a higher impact on the cost value than false positives.
  • E. Change the cost function so that false positives have a higher impact on the cost value than false negatives.
Click to View Verified Solution & Explanation

Correct Option: C,D

Explanation: ✅ Generate more positive samples by duplicating the positive samples and adding a small amount of noise to

Description: This technique, known as data augmentation or oversampling, involves creating synthetic examples for the minority (positive) class. Duplicating existing samples and adding a small amount of noise (e.g., random perturbations to feature values) helps expand the dataset for the underrepresented class without simply creating exact copies, which can lead to overfitting.

Why this fits: In scenarios where the positive class is rare or undersampled, a model may struggle to learn its distinct patterns, leading to a high number of false negatives. By increasing the effective number of positive samples through augmentation, the model has more data points to learn from, making it more likely to correctly identify future positive cases and thus reduce false negatives.

Example: If a dataset for detecting a rare medical condition has only 1% positive cases, duplicating these positive patient records and slightly varying their continuous feature values (like blood pressure readings within a clinically plausible range) or subtly changing categorical features can provide the model with a richer, more balanced view of the positive class.


✅ Change the cost function so that false negatives have a higher impact on the cost value than false positives.

Description: This refers to using a cost-sensitive learning approach, where the loss function is modified to assign different penalties to different types of classification errors. Specifically, it means that misclassifying a positive sample as negative (a false negative) incurs a significantly higher cost to the model during training than misclassifying a negative sample as positive (a false positive).

Why this fits: When the consequences of a false negative are severe (e.g., missing a critical diagnosis, failing to detect fraud, or overlooking a safety hazard), it is imperative to prioritize minimizing these errors. By weighting false negatives more heavily in the cost function, the model is explicitly incentivized to be more cautious and sensitive towards identifying the positive class, even if it leads to a slight increase in false positives. This directly influences the model’s decision boundary to reduce false negatives.

Example: In an anomaly detection system for critical infrastructure, a false negative (failing to detect an actual anomaly) could lead to catastrophic failure. By adjusting the cost function to heavily penalize such missed anomalies, the model will prioritize flagging potential issues, even if it occasionally flags a benign event as an anomaly (false positive).

QUESTION 32

A Data Scientist is developing a machine learning model to predict future patient outcomes based on information collected about each patient and their treatment plans. The model should output a continuous value as its prediction. The data available includes labeled outcomes for a set of 4,000 patients. The study was conducted on a group of individuals over the age of 65 who have a particular disease that is known to worsen with age.

Initial models have performed poorly. While reviewing the underlying data, the Data Scientist notices that, out of 4,000 patient observations, there are 450 where the patient age has been input as 0. The other features for these observations appear normal compared to the rest of the sample population

How should the Data Scientist correct this issue?

  • A. Drop all records from the dataset where age has been set to 0.
  • B. Replace the age field value for records with a value of 0 with the mean or median value from the dataset
  • C. Drop the age feature from the dataset and train the model using the rest of the features.
  • D. Use k-means clustering to handle missing features
Click to View Verified Solution & Explanation

Correct Option: D

Explanation: ✅ Use k-means clustering to handle missing features

Description: K-means clustering is an unsupervised machine learning algorithm that partitions a dataset into ‘k’ distinct, non-overlapping subgroups (clusters). In the context of handling missing features, k-means can be leveraged as part of an imputation strategy. This involves first grouping data points based on their available, non-missing features. Once clusters are formed, the missing values for a specific feature in a given record can be estimated (imputed) using the statistical properties (e.g., mean, median, mode) of that same feature within the cluster to which the record belongs. This method assumes that data points within a cluster are more similar to each other than to those in other clusters, thus providing a more contextually relevant imputation than global statistics.

Why this fits: This approach offers a more sophisticated and often more accurate way to handle missing data compared to simpler methods.

  • Superior to dropping data: Unlike dropping records with missing values (Choice A) or dropping the entire feature (Choice C), k-means-based imputation preserves a larger portion of the dataset, preventing significant data loss and potential bias if the missing data is not uniformly random.
  • More nuanced than simple imputation: Compared to replacing missing values with a global mean or median (Choice B), k-means imputation leverages the underlying structure and relationships within the data. By imputing based on cluster-specific statistics, it maintains more of the feature’s original variance and distribution, leading to less distortion and potentially better model performance. For instance, if a dataset contains distinct subgroups with different age distributions, a global mean would be inaccurate for both, whereas cluster-specific means would be more appropriate.
  • Advanced technique: For an AWS Certified Machine Learning – Specialty exam, choosing a more advanced and robust technique like k-means imputation over simpler alternatives demonstrates a deeper understanding of data preprocessing best practices for machine learning.

Example: Consider a dataset of loan applicants where age is missing (or recorded as 0) for some entries. Other features include income, credit_score, and employment_status. Using k-means, applicants could be clustered into groups (e.g., ‘young professionals’, ‘established families’, ‘retirees’) based on their income, credit_score, and employment_status. For an applicant with a missing age, their age would then be imputed using the average age of other applicants within their assigned cluster, rather than the average age of all applicants, resulting in a more accurate and realistic imputation.

QUESTION 33

A Data Science team is designing a dataset repository where it will store a large amount of training data commonly used in its machine learning models. As Data Scientists may create an arbitrary number of new datasets every day, the solution has to scale automatically and be cost-effective. Also, it must be possible to explore the data using SQL.

Which storage scheme is MOST adapted to this scenario?

  • A. Store datasets as files in Amazon S3.
  • B. Store datasets as files in an Amazon EBS volume attached to an Amazon EC2 instance.
  • C. Store datasets as tables in a multi-node Amazon Redshift cluster.
  • D. Store datasets as global tables in Amazon DynamoDB.
Click to View Verified Solution & Explanation

Correct Option: A

Explanation: ✅ Store datasets as files in Amazon S3.

Description: Amazon S3 (Simple Storage Service) is an object storage service offering industry-leading scalability, data availability, security, and performance. It’s designed for 99.999999999% (11 nines) durability and can store virtually unlimited amounts of data as objects within buckets.

Why this fits: For machine learning workflows, particularly for storing large and diverse datasets (raw or preprocessed) used in model training, S3 is the industry standard. It provides a highly durable, cost-effective, and scalable solution that seamlessly integrates with a wide array of AWS machine learning services, including Amazon SageMaker, AWS Glue, and Amazon EMR. Its high throughput makes it ideal for reading vast quantities of data during distributed training jobs.

Example: A data engineering team collects terabytes of sensor data. They store these raw, large files (e.g., CSV, Parquet, images) in an S3 bucket. An AWS Glue job then processes and transforms this raw data, storing the clean, feature-engineered datasets back into another S3 bucket, which is subsequently used as input for an Amazon SageMaker training job.

QUESTION 34

A Machine Learning Specialist deployed a model that provides product recommendations on a company’s website. Initially, the model was performing very well and resulted in customers buying more products on average. However, within the past few months, the Specialist has noticed that the effect of product recommendations has diminished and customers are starting to return to their original habits of spending less. The Specialist is unsure of what happened, as the model has not changed from its initial deployment over a year ago.

Which method should the Specialist try to improve model performance?

  • A. The model needs to be completely re-engineered because it is unable to handle product inventory changes.
  • B. The model's hyperparameters should be periodically updated to prevent drift.
  • C. The model should be periodically retrained from scratch using the original data while adding a regularization term to handle product inventory changes
  • D. The model should be periodically retrained using the original training data plus new data as product inventory changes.
Click to View Verified Solution & Explanation

Correct Option: D

Explanation: ✅ The model should be periodically retrained using the original training data plus new data as product inventory changes.

Description: This choice describes a critical practice in Machine Learning Operations (MLOps) known as continuous retraining or model lifecycle management. It addresses the phenomenon of data drift, where the statistical properties of the input data or target variable change over time, leading to a degradation in model performance. For models operating in dynamic environments like product inventory management, retraining is essential to maintain relevance and accuracy.

Why this fits: Product inventory changes (e.g., new products, discontinued items, price adjustments, stock levels) directly alter the underlying data distribution that a machine learning model was initially trained on. If a model, such as one predicting demand or sales, continues to operate on an outdated understanding of the data, its predictions will become less accurate. Periodically retraining the model by incorporating both the original training data (to retain general patterns and robustness) and the newly observed data (to capture recent trends and changes in inventory) is the most effective way to adapt the model to the evolving environment, mitigate data drift, and ensure its continued utility and accuracy.

Example: Consider a sales forecasting model for an e-commerce platform. If new product lines are introduced monthly and old ones are phased out, the characteristics of the products being sold (features, categories, pricing strategy) change. Without retraining on this new data, the model might fail to accurately predict sales for new items or might overemphasize patterns from discontinued products. Retraining monthly with historical data combined with the latest product catalog and sales figures would allow the model to learn from new product trends and adapt to inventory fluctuations.

QUESTION 35

A Machine Learning Specialist working for an online fashion company wants to build a data ingestion solution for the company’s Amazon S3-based data lake.

The Specialist wants to create a set of ingestion mechanisms that will enable future capabilities comprised of:

Real-time analytics

Interactive analytics of historical data Clickstream analytics

Product recommendations

Which services should the Specialist use?

  • A. AWS Glue as the data catalog; Amazon Kinesis Data Streams and Amazon Kinesis Data Analytics for real- time data insights; Amazon Kinesis Data Firehose for delivery to Amazon ES for clickstream analytics; Amazon EMR to generate personalized product recommendations
  • B. Amazon Athena as the data catalog: Amazon Kinesis Data Streams and Amazon Kinesis Data Analytics for near-real-time data insights; Amazon Kinesis Data Firehose for clickstream analytics; AWS Glue to generate personalized product recommendations
  • C. AWS Glue as the data catalog; Amazon Kinesis Data Streams and Amazon Kinesis Data Analytics for historical data insights; Amazon Kinesis Data Firehose for delivery to Amazon ES for clickstream analytics; Amazon EMR to generate personalized product recommendations
  • D. Amazon Athena as the data catalog; Amazon Kinesis Data Streams and Amazon Kinesis Data Analytics for historical data insights; Amazon DynamoDB streams for clickstream analytics; AWS Glue to generate personalized product recommendations
Click to View Verified Solution & Explanation

Correct Option: A

Explanation: ✅ AWS Glue as the data catalog; Amazon Kinesis Data Streams and Amazon Kinesis Data Analytics for real- time data insights; Amazon Kinesis Data Firehose for delivery to Amazon ES for clickstream analytics; Amazon EMR to generate personalized product recommendations

Description: This choice outlines a robust, scalable, and commonly used architecture for real-time data ingestion, analytics, and machine learning model generation on AWS. It leverages specialized services for each phase of the data pipeline: metadata management, real-time processing, stream delivery for analytics, and big data processing for ML.

Why this fits:

  • AWS Glue as the data catalog: AWS Glue Data Catalog serves as a central metadata repository, enabling various AWS services (like Athena, EMR, Redshift Spectrum) to discover and query data from a data lake or other sources. This is a standard and effective approach for managing data definitions.
  • Amazon Kinesis Data Streams and Amazon Kinesis Data Analytics for real-time data insights: Kinesis Data Streams is designed for ingesting large volumes of real-time streaming data, while Kinesis Data Analytics processes this data in real-time using SQL or Apache Flink for immediate insights. This combination is ideal for real-time monitoring and analytics.
  • Amazon Kinesis Data Firehose for delivery to Amazon ES for clickstream analytics: Kinesis Data Firehose is a fully managed service for delivering real-time streaming data to various destinations, including Amazon OpenSearch Service (formerly Amazon ES). OpenSearch Service is a popular choice for log analytics, full-text search, and real-time operational intelligence, making it well-suited for analyzing clickstream data from user interactions.
  • Amazon EMR to generate personalized product recommendations: Amazon EMR is a leading cloud big data platform for processing vast amounts of data using open-source tools like Apache Spark, Hive, and Presto. It’s highly capable for large-scale machine learning tasks, including training models for personalized product recommendations based on historical user behavior and product data.

    Example: An e-commerce platform collects real-time user clickstream data through Kinesis Data Streams. Kinesis Data Analytics provides immediate dashboards on user activity. Simultaneously, Kinesis Data Firehose delivers this clickstream data to Amazon OpenSearch Service for detailed behavioral analysis. AWS Glue catalogs all historical data stored in S3. Periodically, Amazon EMR processes large datasets from S3, using algorithms like collaborative filtering or deep learning, to generate and update personalized product recommendations for each user, based on their past interactions and similar users’ preferences.

QUESTION 36 (Multi-Select)

A company is observing low accuracy while training on the default built-in image classification algorithm in Amazon SageMaker. The Data Science team wants to use an Inception neural network architecture instead of

a ResNet architecture.

Which of the following will accomplish this? (Choose two.)

  • A. Customize the built-in image classification algorithm to use Inception and use this for model training.
  • B. Create a support case with the SageMaker team to change the default image classification algorithm to Inception.
  • C. Bundle a Docker container with TensorFlow Estimator loaded with an Inception network and use this for model training.
  • D. Use custom code in Amazon SageMaker with TensorFlow Estimator to load the model with an Inception network, and use this for model training.
  • E. Download and apt-get install the inception network code into an Amazon EC2 instance and use this instance as a Jupyter notebook in Amazon SageMaker.
Click to View Verified Solution & Explanation

Correct Option: C,D

Explanation: ✅ Bundle a Docker container with TensorFlow Estimator loaded with an Inception network and use this for model training.

Description: Amazon SageMaker supports custom training environments by allowing users to bring their own Docker images. This provides full control over the runtime environment, including specific versions of libraries, frameworks, and pre-trained models or custom architectures like Inception. A TensorFlow Estimator within this custom container can then be used to manage the training process.

Why this fits: The Inception network is a specific convolutional neural network architecture (e.g., InceptionV3, Inception-ResNet) that is not a configurable option of SageMaker’s built-in image classification algorithm. To utilize such a custom or advanced architecture, particularly if it requires specific dependencies or a unique environment, bundling it within a custom Docker container is a robust and highly flexible method. SageMaker then runs this container for the training job.

Example: A developer creates a Dockerfile that installs TensorFlow, downloads the InceptionV3 weights, and includes a Python training script. This Docker image is pushed to Amazon Elastic Container Registry (ECR). They then configure a SageMaker training job to use this ECR image, allowing SageMaker to provision the necessary instances and execute the training process within their custom Inception-ready environment.


✅ Use custom code in Amazon SageMaker with TensorFlow Estimator to load the model with an Inception network, and use this for model training.

Description: Amazon SageMaker provides pre-built Docker images for popular machine learning frameworks like TensorFlow. Users can write custom Python training scripts that leverage the full capabilities of TensorFlow, including loading pre-defined network architectures like Inception, and then run these scripts using SageMaker’s TensorFlow Estimator. SageMaker handles the provisioning and management of the underlying infrastructure.

Why this fits: The SageMaker TensorFlow Estimator is designed to execute user-supplied Python scripts. Within such a script, you can easily import and utilize Inception architectures (e.g., from tf.keras.applications.inception_v3) and then proceed with model loading, compilation, and training. This approach is highly effective when the required libraries and framework versions are compatible with SageMaker’s provided TensorFlow environments, eliminating the need to build a custom Docker image from scratch.

Example: A data scientist creates a train.py script that imports tensorflow and loads tf.keras.applications.InceptionV3 for transfer learning. They then instantiate a sagemaker.tensorflow.TensorFlow Estimator, providing the train.py script and specifying the desired TensorFlow version. SageMaker launches a training job using its managed TensorFlow container, which executes the provided script to train the Inception-based model.

QUESTION 37

A Machine Learning Specialist built an image classification deep learning model. However, the Specialist ran into an overfitting problem in which the training and testing accuracies were 99% and 75%, respectively.

How should the Specialist address this issue and what is the reason behind it?

  • A. The learning rate should be increased because the optimization process was trapped at a local minimum.
  • B. The dropout rate at the flatten layer should be increased because the model is not generalized enough.
  • C. The dimensionality of dense layer next to the flatten layer should be increased because the model is not complex enough.
  • D. The epoch number should be increased because the optimization process was terminated before it reached the global minimum.
Click to View Verified Solution & Explanation

Correct Option: B

Explanation: ✅ The dropout rate at the flatten layer should be increased because the model is not generalized enough.

Description: Dropout is a regularization technique employed in neural networks to prevent overfitting. During the training phase, a random subset of neurons, along with their incoming and outgoing connections, are temporarily ignored (dropped out) at each update step. This forces the network to learn more robust and redundant representations, as no single neuron can rely too much on the presence of any other specific neuron. The effect is akin to training an ensemble of many different "thinner" networks, which helps in improving the model’s ability to generalize to unseen data.

Why this fits: When a model is described as "not generalized enough," it typically indicates that it is overfitting to the training data. Overfitting occurs when a model learns the training data too well, including its noise and specific patterns, leading to poor performance on new, unseen data. Increasing the dropout rate intensifies the regularization effect, making the model less prone to memorizing training examples. By applying dropout after the flatten layer and before subsequent dense layers, it helps to regularize the features extracted and prevents the dense layers from overfitting to specific combinations of these flattened features, thereby improving the model’s generalization capabilities.

Example: Consider a convolutional neural network designed for image classification. If the model performs exceptionally well on the training set but poorly on validation images, it suggests overfitting. Applying dropout, for instance, after the feature extraction layers (which might include a flatten layer to convert feature maps into a 1D vector) and before the final classification dense layers, would force the network to learn more broadly applicable visual features rather than memorizing specific pixel configurations from the training images. An increased dropout rate, say from 0.2 to 0.5, means more neurons are randomly deactivated, compelling the remaining neurons to learn more independently and robustly.

QUESTION 38

A Machine Learning team uses Amazon SageMaker to train an Apache MXNet handwritten digit classifier model using a research dataset. The team wants to receive a notification when the model is overfitting.

Auditors want to view the Amazon SageMaker log activity report to ensure there are no unauthorized API calls.

What should the Machine Learning team do to address the requirements with the least amount of code and fewest steps?

  • A. Implement an AWS Lambda function to log Amazon SageMaker API calls to Amazon S3. Add code to push a custom metric to Amazon CloudWatch. Create an alarm in CloudWatch with Amazon SNS to receive a notification when the model is overfitting.
  • B. Use AWS CloudTrail to log Amazon SageMaker API calls to Amazon S3. Add code to push a custom metric to Amazon CloudWatch. Create an alarm in CloudWatch with Amazon SNS to receive a notification when the model is overfitting.
  • C. Implement an AWS Lambda function to log Amazon SageMaker API calls to AWS CloudTrail. Add code to push a custom metric to Amazon CloudWatch. Create an alarm in CloudWatch with Amazon SNS to receive a notification when the model is overfitting.
  • D. Use AWS CloudTrail to log Amazon SageMaker API calls to Amazon S3. Set up Amazon SNS to receive a notification when the model is overfitting
Click to View Verified Solution & Explanation

Correct Option: B

Explanation: ✅ Use AWS CloudTrail to log Amazon SageMaker API calls to Amazon S3. Add code to push a custom metric to Amazon CloudWatch. Create an alarm in CloudWatch with Amazon SNS to receive a notification when the model is overfitting.

Description: This approach leverages the appropriate AWS services for comprehensive monitoring and alerting for a machine learning workflow. AWS CloudTrail is designed to log API calls made to AWS services, including Amazon SageMaker, storing these logs in Amazon S3 for auditing and analysis. To detect a custom model-specific condition like overfitting, which isn’t a standard AWS service metric, you need to implement logic within your model’s training or evaluation pipeline to calculate a relevant metric (e.g., divergence between training and validation loss). This custom metric is then pushed to Amazon CloudWatch using the PutMetricData API. Once the custom metric is in CloudWatch, an alarm can be configured to monitor its value against a defined threshold. If the threshold is breached (indicating potential overfitting), the CloudWatch alarm can trigger a notification via Amazon SNS.

Why this fits:

  1. CloudTrail for API Logging: CloudTrail is the authoritative service for auditing and logging AWS API calls, providing a detailed record of actions taken within Amazon SageMaker. This is a best practice for operational visibility and security, and logs are typically stored in S3.
  2. Custom Metrics for Overfitting Detection: Overfitting is a model-specific behavior that requires custom logic to detect. Pushing custom metrics from your model evaluation process to CloudWatch is the standard way to make these internal model behaviors observable within AWS.
  3. CloudWatch Alarms for Thresholding: CloudWatch Alarms enable automated monitoring of metrics and can change state based on predefined thresholds. This is essential for converting a metric value into an actionable event.
  4. SNS for Notifications: Amazon SNS is a highly scalable, flexible, and cost-effective messaging service for sending notifications to various subscribers (e.g., email, SMS, Lambda functions) when an event occurs, such as a CloudWatch alarm state change.

    Example: During model training in SageMaker, a script calculates the difference between the training loss and validation loss every epoch. If this difference exceeds a certain threshold (indicating the model is performing much better on training data than unseen validation data), this custom "overfitting_score" metric is pushed to CloudWatch. A CloudWatch alarm is configured to trigger an SNS topic if "overfitting_score" remains above the threshold for a specified period, alerting the MLOps team via email.

QUESTION 39

A Machine Learning Specialist is building a prediction model for a large number of features using linear models, such as linear regression and logistic regression. During exploratory data analysis, the Specialist observes that many features are highly correlated with each other. This may make the model unstable.

What should be done to reduce the impact of having such a large number of features?

  • A. Perform one-hot encoding on highly correlated features.
  • B. Use matrix multiplication on highly correlated features.
  • C. Create a new feature space using principal component analysis (PCA)
  • D. Apply the Pearson correlation coefficient.
Click to View Verified Solution & Explanation

Correct Option: C

Explanation: ✅ Create a new feature space using principal component analysis (PCA)

Description: Principal Component Analysis (PCA) is a statistical procedure that uses an orthogonal transformation to convert a set of observations of possibly correlated variables into a set of values of linearly uncorrelated variables called principal components. This transformation is defined in such a way that the first principal component has the largest possible variance (that is, accounts for as much of the variability in the data as possible), and each succeeding component in turn has the highest variance possible under the constraint that it is orthogonal to the preceding components. The result is a dimensionality reduction, creating a new, lower-dimensional feature space.

Why this fits: When features are highly correlated, it can lead to multicollinearity, which can make a machine learning model unstable, harder to interpret, and less generalizable. PCA effectively addresses this by transforming the original correlated features into a new set of uncorrelated features (principal components). These components are linear combinations of the original features and capture most of the variance in the data with fewer dimensions, thereby creating a new feature space that is more suitable for modeling without redundancy.

Example: Imagine a dataset with features like ‘daily rainfall in inches’, ‘daily humidity percentage’, and ‘daily atmospheric pressure’. These features might be highly correlated. Applying PCA could transform these into a smaller number of principal components, such as ‘overall weather severity’ and ‘atmospheric condition stability’, which are uncorrelated and still capture most of the information present in the original three features. These new principal components then form the new feature space for model training.

QUESTION 40

A Machine Learning Specialist is implementing a full Bayesian network on a dataset that describes public transit in New York City. One of the random variables is discrete, and represents the number of minutes New Yorkers wait for a bus given that the buses cycle every 10 minutes, with a mean of 3 minutes.

Which prior probability distribution should the ML Specialist use for this variable?

  • A. Poisson distribution
  • B. Uniform distribution
  • C. Normal distribution
  • D. Binomial distribution
Click to View Verified Solution & Explanation

Correct Option: A

Explanation: ✅ Poisson distribution

Description: The Poisson distribution is a discrete probability distribution that expresses the probability of a given number of events occurring in a fixed interval of time or space if these events occur with a known constant mean rate and independently of the time since the last event. It is particularly suitable for modeling count data where the events are rare or the number of trials is large, and the probability of success in any given trial is small.

Why this fits: In machine learning, particularly when dealing with phenomena like customer arrivals, website clicks, number of defects, or network events within a specific timeframe, the data often represents counts of occurrences. The Poisson distribution is the natural choice for modeling such count data. For instance, if you are building a predictive model for the number of customer support tickets received per hour, a Poisson regression model would be a strong candidate because ticket arrivals are discrete, non-negative counts over a fixed interval.

Example: Consider a scenario where you are trying to predict the number of users who click on a new feature on your website within a 1-hour window. If the clicks are independent and occur at a constant average rate, the number of clicks observed in that hour can be modeled using a Poisson distribution. Another example is predicting the number of errors a machine makes in a manufacturing process per day.

QUESTION 41

A Data Science team within a large company uses Amazon SageMaker notebooks to access data stored in Amazon S3 buckets. The IT Security team is concerned that internet-enabled notebook instances create a security vulnerability where malicious code running on the instances could compromise data privacy. The company mandates that all instances stay within a secured VPC with no internet access, and data communication traffic must stay within the AWS network.

How should the Data Science team configure the notebook instance placement to meet these requirements?

  • A. Associate the Amazon SageMaker notebook with a private subnet in a VPC. Place the Amazon SageMaker endpoint and S3 buckets within the same VPC.
  • B. Associate the Amazon SageMaker notebook with a private subnet in a VPC. Use IAM policies to grant access to Amazon S3 and Amazon SageMaker.
  • C. Associate the Amazon SageMaker notebook with a private subnet in a VPC. Ensure the VPC has S3 VPC endpoints and Amazon SageMaker VPC endpoints attached to it.
  • D. Associate the Amazon SageMaker notebook with a private subnet in a VPC. Ensure the VPC has a NAT gateway and an associated security group allowing only outbound connections to Amazon S3 and Amazon SageMaker.
Click to View Verified Solution & Explanation

Correct Option: C

Explanation: ✅ Associate the Amazon SageMaker notebook with a private subnet in a VPC. Ensure the VPC has S3 VPC endpoints and Amazon SageMaker VPC endpoints attached to it.

Description: This choice outlines the secure and recommended architecture for operating Amazon SageMaker notebook instances when sensitive data or regulatory compliance requires private network access. Associating a SageMaker notebook with a private subnet places it in a secluded network segment within your Virtual Private Cloud (VPC), preventing direct public internet access. VPC endpoints (specifically Gateway Endpoints for S3 and Interface Endpoints for SageMaker) allow resources within your private VPC to communicate directly and privately with AWS services like Amazon S3 and Amazon SageMaker APIs without requiring an Internet Gateway, NAT Gateway, or VPN connection, keeping all traffic within the AWS network.

Why this fits: This approach fulfills the requirements for secure access from a private subnet. By using VPC endpoints, the SageMaker notebook instance, residing in a private subnet, can access Amazon S3 buckets and interact with SageMaker service APIs (e.g., creating training jobs, deploying endpoints) entirely over the AWS private network. This enhances security by removing internet exposure, often a critical compliance requirement for machine learning workloads involving sensitive data. Choice D, while using a private subnet, relies on a NAT Gateway, which means traffic to S3 and SageMaker still traverses the public internet, albeit outbound-only, making it less secure than VPC endpoints which keep traffic within the AWS backbone. Choices A and B are incorrect as they either misunderstand how AWS services interact with VPCs or fail to address network reachability adequately.

Example: A data scientist is developing a model using an Amazon SageMaker notebook instance that processes highly confidential customer data stored in an S3 bucket. To ensure that this data never leaves the AWS private network and that the notebook instance is not exposed to the public internet, the SageMaker notebook is configured to launch within a private subnet of a VPC. Crucially, S3 Gateway Endpoints and SageMaker Interface Endpoints are configured in the same VPC. This setup allows the notebook to securely download data from S3, upload model artifacts back to S3, and interact with SageMaker APIs for training and deployment, all while maintaining strict network isolation.

QUESTION 42 (Multi-Select)

A Machine Learning Specialist has created a deep learning neural network model that performs well on the training data but performs poorly on the test data.

Which of the following methods should the Specialist consider using to correct this? (Choose three.)

  • A. Decrease regularization.
  • B. Increase regularization.
  • C. Increase dropout.
  • D. Decrease dropout.
  • E. Increase feature combinations.
  • F. Decrease feature combinations.
Click to View Verified Solution & Explanation

Correct Option: B,C,F

Explanation: ✅ Increase regularization.

Description: Regularization is a technique used to prevent overfitting by adding a penalty term to the loss function during model training. This penalty discourages the model from assigning overly large weights to specific features, which tends to make the model too complex and specific to the training data. Common types include L1 (Lasso) and L2 (Ridge) regularization, which constrain the magnitude of the model’s weights.

Why this fits: By increasing the regularization strength (e.g., increasing the lambda parameter in L1/L2 regularization or weight decay in optimizers), the model is more heavily penalized for complexity. This forces the model to learn simpler, more generalizable patterns by distributing weight importance more evenly or shrinking less important weights towards zero, thereby reducing its capacity to memorize the training data and improving its performance on unseen data.

Example: When training a deep learning model using Amazon SageMaker’s built-in algorithms or custom scripts with TensorFlow/PyTorch, increasing the weight_decay parameter in an optimizer like Adam or SGD applies L2 regularization, making the model less prone to overfitting by penalizing large weights.


✅ Increase dropout.

Description: Dropout is a powerful regularization technique primarily used in neural networks. During training, it randomly sets a fraction of neurons’ outputs to zero at each update step. This means that a different "thinned" network is used for each training instance, effectively preventing neurons from co-adapting too much.

Why this fits: Increasing the dropout rate means a larger percentage of neurons are randomly deactivated during each training iteration. This forces the remaining active neurons to learn more robust features that are not reliant on the presence of specific other neurons. By creating an implicit ensemble of many different "thinned" networks and breaking complex co-dependencies, dropout significantly improves the model’s ability to generalize to new, unseen data, thereby reducing overfitting.

Example: In a neural network architecture defined for training on Amazon SageMaker, adding a tf.keras.layers.Dropout(rate=0.5) layer after a dense or convolutional layer implies that 50% of the outputs from the preceding layer will be randomly dropped during training, compelling the network to learn more independent and robust features.


✅ Decrease feature combinations.

Description: Feature combinations (also known as interaction terms or polynomial features) are new features created by multiplying or otherwise combining existing features. While they can help capture non-linear relationships and intricate interactions within the data, an excessive number or overly complex combinations can significantly increase the model’s complexity and its capacity to overfit.

Why this fits: When a model is overfitting, it’s often because it has learned overly specific or spurious correlations from the training data, often facilitated by a high-dimensional and overly complex feature space. By decreasing the number of feature combinations or simplifying their complexity (e.g., reducing polynomial degrees from x^3 to x^2, or removing less significant interaction terms), you reduce the dimensionality and intricacy of the input data the model has to learn from. This forces the model to rely on more fundamental and generalizable relationships between the core features, thus simplifying the model and improving its generalization capability.

Example: If you initially engineered features like feature_A * feature_B and feature_C^3 but observe overfitting, you might simplify the input by removing feature_A * feature_B if its contribution isn’t strongly justified, or reduce feature_C^3 to feature_C^2, thereby reducing the model’s capacity to memorize noise through complex interactions.

QUESTION 43

A Data Scientist needs to create a serverless ingestion and analytics solution for high-velocity, real-time streaming data.

The ingestion process must buffer and convert incoming records from JSON to a query-optimized, columnar format without data loss. The output datastore must be highly available, and Analysts must be able to run SQL queries against the data and connect to existing business intelligence dashboards.

Which solution should the Data Scientist build to satisfy the requirements?

  • A. Create a schema in the AWS Glue Data Catalog of the incoming data format. Use an Amazon Kinesis Data Firehose delivery stream to stream the data and transform the data to Apache Parquet or ORC format using the AWS Glue Data Catalog before delivering to Amazon S3. Have the Analysts query the data directly from Amazon S3 using Amazon Athena, and connect to BI tools using the Athena Java Database Connectivity (JDBC) connector.
  • B. Write each JSON record to a staging location in Amazon S3. Use the S3 Put event to trigger an AWS Lambda function that transforms the data into Apache Parquet or ORC format and writes the data to a processed data location in Amazon S3. Have the Analysts query the data directly from Amazon S3 using Amazon Athena, and connect to BI tools using the Athena Java Database Connectivity (JDBC) connector.
  • C. Write each JSON record to a staging location in Amazon S3. Use the S3 Put event to trigger an AWS Lambda function that transforms the data into Apache Parquet or ORC format and inserts it into an Amazon RDS PostgreSQL database. Have the Analysts query and run dashboards from the RDS database.
  • D. Use Amazon Kinesis Data Analytics to ingest the streaming data and perform real-time SQL queries to convert the records to Apache Parquet before delivering to Amazon S3. Have the Analysts query the data directly from Amazon S3 using Amazon Athena and connect to BI tools using the Athena Java Database Connectivity (JDBC) connector.
Click to View Verified Solution & Explanation

Correct Option: A

Explanation: ✅ Create a schema in the AWS Glue Data Catalog of the incoming data format. Use an Amazon Kinesis Data Firehose delivery stream to stream the data and transform the data to Apache Parquet or ORC format using the AWS Glue Data Catalog before delivering to Amazon S3. Have the Analysts query the data directly from Amazon S3 using Amazon Athena, and connect to BI tools using the Athena Java Database Connectivity (JDBC) connector.

Description: This solution describes a robust, serverless, and cost-effective architecture for ingesting streaming JSON data, transforming it into an optimized columnar format, and making it available for analytical querying with BI tools. It leverages managed AWS services that integrate seamlessly.

Why this fits:

  • Kinesis Data Firehose for Streaming Ingestion and Transformation: Kinesis Data Firehose is specifically designed for reliably loading streaming data into data lakes (Amazon S3), data warehouses (Amazon Redshift), and analytics services (Amazon OpenSearch Service). A key feature is its native capability to transform incoming data formats (like JSON) into columnar formats such as Apache Parquet or ORC directly within the delivery stream. This transformation is highly efficient for analytical queries as columnar formats reduce data scanned and improve query performance and compression. It leverages the AWS Glue Data Catalog for schema definition during this process.
  • AWS Glue Data Catalog for Metadata Management: The Glue Data Catalog provides a centralized metadata repository for all data assets, enabling services like Firehose, Athena, and others to understand the schema of the data stored in S3, facilitating data transformation and querying.
  • Amazon S3 for Data Lake Storage: Amazon S3 offers highly durable, scalable, and cost-effective object storage, making it the ideal foundation for a data lake. Storing data in Parquet or ORC format optimizes storage costs and query performance.
  • Amazon Athena for Serverless Querying: Amazon Athena is a serverless interactive query service that makes it easy to analyze data directly in Amazon S3 using standard SQL. It charges based on the amount of data scanned, so using columnar formats significantly reduces costs.
  • JDBC Connectivity for BI Tools: Athena provides standard JDBC/ODBC drivers, allowing analysts to connect their preferred BI tools (e.g., Tableau, Power BI, Amazon QuickSight) to query the data in S3 via Athena.

    Example: An e-commerce platform collects real-time clickstream data in JSON format from its website. This solution allows streaming that data via Kinesis Firehose, automatically converting it to Parquet, storing it in S3, and enabling marketing analysts to run SQL queries using Athena directly from their BI tools to understand user behavior and campaign effectiveness.

QUESTION 44

An online reseller has a large, multi-column dataset with one column missing 30% of its data. A Machine Learning Specialist believes that certain columns in the dataset could be used to reconstruct the missing data.

Which reconstruction approach should the Specialist use to preserve the integrity of the dataset?

  • A. Listwise deletion
  • B. Last observation carried forward
  • C. Multiple imputation
  • D. Mean substitution
Click to View Verified Solution & Explanation

Correct Option: C

Explanation: ✅ Multiple imputation

Description: Multiple imputation is a sophisticated statistical technique for handling missing data. Instead of filling in a single value for each missing data point, it creates multiple plausible imputed datasets. Each dataset’s missing values are filled in using statistical models that leverage relationships within the observed data. The analysis is then performed on each of these complete datasets, and the results are combined to produce an overall estimate, typically accounting for the uncertainty introduced by the imputation process. This method aims to produce valid statistical inferences by preserving the variability and relationships in the data.

Why this fits: For machine learning models, especially in the context of the MLS-C01 exam, handling missing data effectively is crucial for model performance and reliability. Multiple imputation is often preferred over simpler methods like mean substitution or listwise deletion because it reduces bias and provides more accurate estimates of model parameters and their standard errors. By creating several complete datasets and combining their results, it reflects the uncertainty in the imputation process, leading to more robust models. This method is particularly valuable when data are missing at random (MAR) or missing completely at random (MCAR).

Example: Consider a dataset for predicting customer churn where some customer age and income fields are missing. Instead of just replacing missing income with the average income (mean substitution) or removing customers with any missing data (listwise deletion), multiple imputation would generate several versions of the dataset. In each version, the missing income values would be estimated based on other customer attributes like geographic location, marital status, and spending habits, using a regression model. A churn prediction model (e.g., a logistic regression or XGBoost) would then be trained on each imputed dataset, and the final predictions or model parameters would be combined to provide a more reliable and less biased outcome.

QUESTION 45

A company is setting up an Amazon SageMaker environment. The corporate data security policy does not allow communication over the internet.

How can the company enable the Amazon SageMaker service without enabling direct internet access to Amazon SageMaker notebook instances?

  • A. Create a NAT gateway within the corporate VPC.
  • B. Route Amazon SageMaker traffic through an on-premises network.
  • C. Create Amazon SageMaker VPC interface endpoints within the corporate VPC.
  • D. Create VPC peering with Amazon VPC hosting Amazon SageMaker.
Click to View Verified Solution & Explanation

Correct Option: C

Explanation: ✅ Create Amazon SageMaker VPC interface endpoints within the corporate VPC.

Description: Amazon SageMaker VPC interface endpoints are powered by AWS PrivateLink. They enable you to establish a private connection between your Amazon Virtual Private Cloud (VPC) and Amazon SageMaker without requiring an internet gateway, NAT device, VPN connection, or AWS Direct Connect connection. This means that all traffic between your VPC and SageMaker stays within the AWS network, improving security and compliance.

Why this fits: For corporate environments that prioritize security and want to prevent SageMaker traffic from traversing the public internet, creating VPC interface endpoints is the recommended and most secure approach. This method ensures that communication with SageMaker API endpoints occurs privately over the AWS backbone, satisfying strict corporate network policies and reducing exposure to potential internet-based threats.

Example: A financial institution operates its SageMaker workloads within a highly secure private subnet in its corporate AWS VPC. To ensure that data scientists can securely access SageMaker Studio, launch training jobs, and deploy models without any traffic leaving the AWS private network, the institution configures VPC interface endpoints for SageMaker, S3, and other necessary AWS services.

QUESTION 46

A Machine Learning Specialist is training a model to identify the make and model of vehicles in images. The Specialist wants to use transfer learning and an existing model trained on images of general objects. The Specialist collated a large custom dataset of pictures containing different vehicle makes and models.

What should the Specialist do to initialize the model to re-train it with the custom data?

  • A. Initialize the model with random weights in all layers including the last fully connected layer.
  • B. Initialize the model with pre-trained weights in all layers and replace the last fully connected layer.
  • C. Initialize the model with random weights in all layers and replace the last fully connected layer.
  • D. Initialize the model with pre-trained weights in all layers including the last fully connected layer.
Click to View Verified Solution & Explanation

Correct Option: B

Explanation: ✅ Initialize the model with pre-trained weights in all layers and replace the last fully connected layer.

Description: This approach describes transfer learning, a powerful technique in machine learning where a model developed for a task is reused as the starting point for a model on a second, related task. Specifically, it involves leveraging a neural network that has already been trained on a very large dataset (e.g., ImageNet for computer vision tasks or a large text corpus for NLP) and adapting it for a new, often smaller, dataset.

Why this fits: This is the most effective strategy for training deep learning models when you have a relatively small dataset for your specific task, but a suitable pre-trained model is available. By initializing the model with pre-trained weights in the early layers, you leverage features that have already been learned from vast amounts of data, acting as excellent general feature extractors. Replacing only the last fully connected layer allows the model to learn the specific classification or regression task for your new dataset, mapping the extracted features to your unique output classes, without having to re-learn fundamental patterns from scratch. This significantly reduces training time, computational resources, and the amount of data required, while often leading to better performance than training a model from random weights.

Example: A data scientist wants to classify specific types of defects on manufactured circuit boards, but only has a limited dataset of defective images. Instead of training a convolutional neural network (CNN) from scratch, they can use a pre-trained CNN (like ResNet or VGG) that was originally trained on ImageNet. They would load the pre-trained weights for all convolutional and pooling layers (feature extraction layers), effectively freezing them or fine-tuning them slightly, and then replace the original ImageNet 1000-class output layer with a new fully connected layer configured for their specific defect classes, training only this new layer on their small dataset.

QUESTION 47

An office security agency conducted a successful pilot using 100 cameras installed at key locations within the main office. Images from the cameras were uploaded to Amazon S3 and tagged using Amazon Rekognition, and the results were stored in Amazon ES. The agency is now looking to expand the pilot into a full production system using thousands of video cameras in its office locations globally. The goal is to identify activities performed by non-employees in real time

Which solution should the agency consider?

  • A. Use a proxy server at each local office and for each camera, and stream the RTSP feed to a unique Amazon Kinesis Video Streams video stream. On each stream, use Amazon Rekognition Video and create a stream processor to detect faces from a collection of known employees, and alert when non-employees are detected.
  • B. Use a proxy server at each local office and for each camera, and stream the RTSP feed to a unique Amazon Kinesis Video Streams video stream. On each stream, use Amazon Rekognition Image to detect faces from a collection of known employees and alert when non-employees are detected.
  • C. Install AWS DeepLens cameras and use the DeepLens_Kinesis_Video module to stream video to Amazon Kinesis Video Streams for each camera. On each stream, use Amazon Rekognition Video and create a stream processor to detect faces from a collection on each stream, and alert when non- employees are detected.
  • D. Install AWS DeepLens cameras and use the DeepLens_Kinesis_Video module to stream video to Amazon Kinesis Video Streams for each camera. On each stream, run an AWS Lambda function to capture image fragments and then call Amazon Rekognition Image to detect faces from a collection of known employees, and alert when non-employees are detected.
Click to View Verified Solution & Explanation

Correct Option: A

Explanation: ✅ Use a proxy server at each local office and for each camera, and stream the RTSP feed to a unique Amazon Kinesis Video Streams video stream. On each stream, use Amazon Rekognition Video and create a stream processor to detect faces from a collection of known employees, and alert when non-employees are detected.

Description: This solution outlines a robust architecture for real-time facial recognition from existing IP cameras. It involves ingesting live RTSP video feeds into AWS using local proxy servers, streaming them into Amazon Kinesis Video Streams (KVS), and then processing these streams with Amazon Rekognition Video’s stream processors to identify individuals against a pre-existing face collection.

Why this fits:

  • RTSP Integration: Using a proxy server at each local office is a standard and effective method to ingest existing RTSP camera feeds into AWS, overcoming network boundary challenges.
  • Live Video Ingestion: Amazon Kinesis Video Streams is purpose-built for securely ingesting, processing, and storing live video streams for analytics, machine learning, and playback. Each camera having a unique KVS stream ensures isolation and proper scaling.
  • Real-time Video Analysis: Amazon Rekognition Video is the correct service for analyzing video streams in near real-time. It directly integrates with Kinesis Video Streams.
  • Stream Processors: Rekognition Video stream processors are designed for continuous analysis of video streams (specifically for face detection or person pathing) against a collection of known faces, making them ideal for the requirement of detecting known employees and alerting on non-employees.
  • Face Collections: Rekognition’s ability to manage face collections allows for efficient comparison against a database of known individuals.

Example: A company with multiple branch offices and existing CCTV cameras wants to monitor entrances. Each office sets up a small compute instance (e.g., an EC2 instance or a local device running a container) as a proxy server. This proxy pulls the RTSP feeds from local security cameras and pushes them to individual Amazon Kinesis Video Streams. An Amazon Rekognition Video stream processor is configured on each KVS stream, referencing a central collection of authorized employee faces. When a face not in the collection (a non-employee) is detected, the stream processor triggers an Amazon SNS notification to security personnel.

QUESTION 48

A Marketing Manager at a pet insurance company plans to launch a targeted marketing campaign on social media to acquire new customers. Currently, the company has the following data in Amazon Aurora:

Profiles for all past and existing customers Profiles for all past and existing insured pets Policy-level information

Premiums received Claims paid.

What steps should be taken to implement a machine learning model to identify potential new customers on social media?

  • A. Use regression on customer profile data to understand key characteristics of consumer segments. Find similar profiles on social media.
  • B. Use clustering on customer profile data to understand key characteristics of consumer segments. Find similar profiles on social media.
  • C. Use a recommendation engine on customer profile data to understand key characteristics of consumer segments. Find similar profiles on social media.
  • D. Use a decision tree classifier engine on customer profile data to understand key characteristics of consumer segments. Find similar profiles on social media.
Click to View Verified Solution & Explanation

Correct Option: B

Explanation: ✅ Use clustering on customer profile data to understand key characteristics of consumer segments. Find similar profiles on social media.

Description: Clustering is an unsupervised machine learning technique used to group a set of data points into clusters, where data points within the same cluster are more similar to each other than to those in other clusters. It is employed when there are no pre-defined labels for the groups, allowing the algorithm to discover inherent structures within the data.

Why this fits: The primary objective stated is to "understand key characteristics of consumer segments" and then to "find similar profiles." Clustering is ideally suited for this. By applying clustering to customer profile data (e.g., demographics, purchase history, browsing behavior), the algorithm will identify natural groupings of customers who share common traits. Each cluster represents a distinct consumer segment. Once these segments are formed and their characteristics analyzed, new profiles, such as those from social media, can be compared against these clusters to identify which segment they most closely resemble, thus finding similar profiles. This aligns with the unsupervised nature of discovering hidden patterns in data without prior labels.

Example: An e-commerce company gathers data on customer age, geographic location, average order value, and product categories purchased. Using an AWS service like Amazon SageMaker’s K-Means or Hierarchical Clustering algorithm, they can identify distinct customer segments, such as "Young Urban Professionals," "Suburban Families," and "Luxury Shoppers." Each segment will have specific characteristics. Subsequently, when a new social media profile is analyzed, its attributes can be compared to these learned clusters to determine which customer segment it belongs to, enabling targeted marketing campaigns.

QUESTION 49

A manufacturing company has a large set of labeled historical sales data. The manufacturer would like to predict how many units of a particular part should be produced each quarter.

Which machine learning approach should be used to solve this problem?

  • A. Logistic regression
  • B. Random Cut Forest (RCF)
  • C. Principal component analysis (PCA)
  • D. Linear regression
Click to View Verified Solution & Explanation

Correct Option: D

Explanation: ✅ Linear regression

Description: Linear regression is a supervised machine learning algorithm used to model the relationship between a continuous dependent variable (the target) and one or more independent variables (the features). It achieves this by fitting a linear equation to the observed data, aiming to find the best-fitting straight line (or hyperplane in higher dimensions) that minimizes the sum of squared residuals.

Why this fits: Linear regression is the most appropriate algorithm among the given choices for tasks requiring the prediction of a continuous numerical output. It directly addresses problems where the target variable can take any real value within a range.

  • Logistic regression is for binary classification problems (predicting one of two classes).
  • Random Cut Forest (RCF) is an unsupervised algorithm primarily used for anomaly detection in data streams.
  • Principal component analysis (PCA) is an unsupervised dimensionality reduction technique, not a predictive model for a target variable.

    Example: Predicting the future temperature based on historical weather data, or estimating the sales of a product based on its price and advertising spend.

QUESTION 50

A financial services company is building a robust serverless data lake on Amazon S3. The data lake should be flexible and meet the following requirements:

Support querying old and new data on Amazon S3 through Amazon Athena and Amazon Redshift Spectrum.

Support event-driven ETL pipelines

Provide a quick and easy way to understand metadata

Which approach meets these requirements?

  • A. Use an AWS Glue crawler to crawl S3 data, an AWS Lambda function to trigger an AWS Glue ETL job, and an AWS Glue Data catalog to search and discover metadata.
  • B. Use an AWS Glue crawler to crawl S3 data, an AWS Lambda function to trigger an AWS Batch job, and an external Apache Hive metastore to search and discover metadata.
  • C. Use an AWS Glue crawler to crawl S3 data, an Amazon CloudWatch alarm to trigger an AWS Batch job, and an AWS Glue Data Catalog to search and discover metadata.
  • D. Use an AWS Glue crawler to crawl S3 data, an Amazon CloudWatch alarm to trigger an AWS Glue ETL job, and an external Apache Hive metastore to search and discover metadata.
Click to View Verified Solution & Explanation

Correct Option: A

Explanation: ✅ Use an AWS Glue crawler to crawl S3 data, an AWS Lambda function to trigger an AWS Glue ETL job, and an AWS Glue Data catalog to search and discover metadata.

Description: This choice describes a common, serverless, and integrated AWS architecture for data ingestion, processing, and cataloging. An AWS Glue crawler automatically infers schema and partitions from data sources like S3. An AWS Lambda function provides event-driven, serverless compute to orchestrate workflows, in this case, triggering an AWS Glue ETL job. The AWS Glue Data Catalog serves as a central, managed metadata repository that integrates with many AWS analytics and machine learning services.

Why this fits: This approach leverages purpose-built AWS services for each stage of the data pipeline: AWS Glue crawlers for schema discovery and catalog population, AWS Lambda for efficient event-driven job orchestration, and AWS Glue ETL for scalable, serverless data transformation. The AWS Glue Data Catalog provides a unified metadata store that enables data discovery for subsequent ML model training or analysis using services like Amazon Athena, Amazon Redshift Spectrum, or Amazon EMR. This is a highly recommended and robust pattern for preparing data for machine learning workloads on AWS.

Example: A data scientist uploads new CSV files containing daily sales transactions to an S3 bucket. An AWS Glue crawler is scheduled to run daily, discovering the schema of these new files and updating the AWS Glue Data Catalog. Upon successful crawl, an AWS Lambda function is invoked, which then triggers an AWS Glue ETL job. This ETL job reads the newly cataloged data, performs data cleaning and feature engineering (e.g., aggregating sales by product category), and stores the refined data back into S3 in Parquet format, updating the Data Catalog. The cleaned and transformed data is then easily discoverable and queryable via the AWS Glue Data Catalog for building ML models.

QUESTION 51

A company’s Machine Learning Specialist needs to improve the training speed of a time-series forecasting

model using TensorFlow. The training is currently implemented on a single-GPU machine and takes approximately 23 hours to complete. The training needs to be run daily.

The model accuracy is acceptable, but the company anticipates a continuous increase in the size of the training data and a need to update the model on an hourly, rather than a daily, basis. The company also wants to minimize coding effort and infrastructure changes.

What should the Machine Learning Specialist do to the training solution to allow it to scale for future demand?

  • A. Do not change the TensorFlow code. Change the machine to one with a more powerful GPU to speed up the training.
  • B. Change the TensorFlow code to implement a Horovod distributed framework supported by Amazon SageMaker. Parallelize the training to as many machines as needed to achieve the business goals.
  • C. Switch to using a built-in AWS SageMaker DeepAR model. Parallelize the training to as many machines as needed to achieve the business goals.
  • D. Move the training to Amazon EMR and distribute the workload to as many machines as needed to achieve the business goals.
Click to View Verified Solution & Explanation

Correct Option: B

Explanation: ✅ Change the TensorFlow code to implement a Horovod distributed framework supported by Amazon SageMaker. Parallelize the training to as many machines as needed to achieve the business goals.

Description: Horovod is an open-source distributed deep learning training framework developed by Uber. It is designed to scale single-GPU TensorFlow, Keras, PyTorch, and Apache MXNet programs to multiple GPUs and multiple nodes with minimal code changes. Horovod efficiently synchronizes gradients across workers using an all-reduce communication strategy, often leveraging high-performance collective communication libraries like NCCL for NVIDIA GPUs. Amazon SageMaker provides robust native support for running Horovod-based distributed training jobs, simplifying the setup and management of scalable deep learning workflows.

Why this fits: The core problem is to significantly speed up existing TensorFlow model training by utilizing multiple machines (parallelization) to meet specific business objectives.

  1. Scalable Distributed Training: Horovod is a proven and highly efficient framework for distributed deep learning, enabling horizontal scaling across numerous machines. This directly addresses the need to "parallelize the training to as many machines as needed."
  2. Minimal Code Changes: Horovod’s design principle is to require very few modifications to existing single-GPU TensorFlow code, making it a practical solution when working with an established codebase.
  3. Amazon SageMaker Integration: SageMaker offers seamless integration and managed services for Horovod training, abstracting away much of the infrastructure complexity associated with distributed training, allowing data scientists to focus on model development.
  4. Performance: The all-reduce communication pattern used by Horovod, combined with high-performance interconnects, provides excellent scaling efficiency for many deep learning workloads, directly contributing to achieving business goals for faster training.

    Example: A company uses a custom TensorFlow model on Amazon SageMaker for real-time fraud detection, requiring daily retraining on a massive dataset. Training on a single ml.p3.16xlarge instance takes 12 hours, which is too long for daily updates. To meet the business requirement of completing retraining within 3 hours, the data science team modifies their TensorFlow script to integrate Horovod. They then configure the SageMaker training job to run on a cluster of four ml.p3.8xlarge instances, leveraging Horovod to distribute the training workload across all GPUs, thereby reducing the training time to less than 3 hours.

QUESTION 52

Which of the following metrics should a Machine Learning Specialist generally use to compare/evaluate machine learning classification models against each other?

  • A. Recall
  • B. Misclassification rate
  • C. Mean absolute percentage error (MAPE)
  • D. Area Under the ROC Curve (AUC)
Click to View Verified Solution & Explanation

Correct Option: D

Explanation: ✅ Area Under the ROC Curve (AUC)

Description: The Area Under the ROC (Receiver Operating Characteristic) Curve is a performance metric for binary classification models. It quantifies the ability of a classifier to distinguish between positive and negative classes. The ROC curve plots the True Positive Rate (TPR, also known as Recall or Sensitivity) against the False Positive Rate (FPR) at various classification threshold settings. AUC consolidates the entire ROC curve into a single scalar value, ranging from 0.0 to 1.0, where 1.0 indicates a perfect classifier and 0.5 signifies a model no better than random guessing.

Why this fits: AUC is a highly preferred metric for evaluating binary classification models, particularly in scenarios encountered in the AWS Certified Machine Learning – Specialty exam, due to its robustness and comprehensive nature. It is advantageous because it assesses the model’s performance across all possible classification thresholds, providing a complete picture of its discriminative power. Unlike metrics such as accuracy or misclassification rate, AUC is insensitive to class imbalance, making it a more reliable indicator of model quality when one class significantly outnumbers the other. For machine learning practitioners, AUC offers a threshold-independent measure that helps in understanding how well a model can separate the two classes, irrespective of the specific decision boundary chosen.

Example: Imagine an AWS SageMaker model trained to detect a rare disease (positive class) where the majority of the population is healthy (negative class). Using accuracy might be misleading because a model that always predicts "healthy" could still achieve high accuracy. However, evaluating the model using AUC would reveal its true ability to differentiate between healthy and diseased individuals across various diagnostic cut-offs. A high AUC (e.g., 0.95) would indicate that the model effectively distinguishes between the two classes, even with the imbalanced dataset, thereby minimizing both false negatives (missed diseases) and false positives (unnecessary follow-ups).

QUESTION 53

A company is running a machine learning prediction service that generates 100 TB of predictions every day. A Machine Learning Specialist must generate a visualization of the daily precision-recall curve from the predictions, and forward a read-only version to the Business team.

Which solution requires the LEAST coding effort?

  • A. Run a daily Amazon EMR workflow to generate precision-recall data, and save the results in Amazon S3. Give the Business team read-only access to S3.
  • B. Generate daily precision-recall data in Amazon QuickSight, and publish the results in a dashboard shared with the Business team.
  • C. Run a daily Amazon EMR workflow to generate precision-recall data, and save the results in Amazon S3. Visualize the arrays in Amazon QuickSight, and publish them in a dashboard shared with the Business team.
  • D. Generate daily precision-recall data in Amazon ES, and publish the results in a dashboard shared with the Business team.
Click to View Verified Solution & Explanation

Correct Option: C

Explanation: ✅ Run a daily Amazon EMR workflow to generate precision-recall data, and save the results in Amazon S3. Visualize the arrays in Amazon QuickSight, and publish them in a dashboard shared with the Business team.

Description: This solution describes a robust data pipeline that leverages specialized AWS services for each stage of data processing, storage, visualization, and sharing. Amazon EMR is an industry-standard big data processing service capable of running analytics workloads like generating complex machine learning metrics (e.g., precision-recall). Amazon S3 provides highly durable, scalable, and cost-effective storage for the processed results. Amazon QuickSight is a cloud-native business intelligence service designed for easy visualization and dashboard creation, ideal for presenting insights to non-technical users.

Why this fits: This choice comprehensively addresses the requirements:

  1. Data Generation: Amazon EMR is well-suited for processing large datasets to generate complex metrics like precision-recall daily.
  2. Data Storage: Amazon S3 offers scalable and reliable storage for the output from EMR.
  3. Visualization: Amazon QuickSight can connect to data in S3 (often via Athena for querying S3 data) to create interactive visualizations and dashboards.
  4. Sharing with Business Team: QuickSight dashboards are specifically designed for sharing with business users, providing an intuitive interface for consuming insights without needing direct access to raw data or complex tools. This approach is superior to simply giving business users raw S3 access, which is not user-friendly for analysis.

    Example: An e-commerce company trains a recommendation model daily. They use an Amazon EMR cluster to process the latest user interaction data and model predictions, calculating daily precision and recall metrics. These metrics are stored as CSV files in an Amazon S3 bucket. An Amazon QuickSight dashboard is configured to read from this S3 data (via an Athena table) and display interactive charts showing the model’s performance trends over time. This dashboard is then shared with the product management team, allowing them to monitor the model’s effectiveness without needing technical expertise.

QUESTION 54

A Machine Learning Specialist is required to build a supervised image-recognition model to identify a cat. The ML Specialist performs some tests and records the following results for a neural network-based image classifier:

Total number of images available = 1,000 Test set images = 100 (constant test set)

The ML Specialist notices that, in over 75% of the misclassified images, the cats were held upside down by their owners.

Which techniques can be used by the ML Specialist to improve this specific test error?

  • A. Increase the training data by adding variation in rotation for training images.
  • B. Increase the number of epochs for model training
  • C. Increase the number of layers for the neural network.
  • D. Increase the dropout rate for the second-to-last layer.
Click to View Verified Solution & Explanation

Correct Option: A

Explanation: ✅ Increase the training data by adding variation in rotation for training images.

Description: Data augmentation is a technique used to artificially increase the size and diversity of a training dataset by applying various transformations to the existing data. For image data, common transformations include rotation, flipping, scaling, cropping, and color jittering. These transformations create new, unique training examples derived from the original images.

Why this fits: By introducing variations like rotation, the model is exposed to a wider range of perspectives and orientations of the objects or features it needs to learn. This helps the model become more robust and invariant to such transformations in real-world inference. It improves the model’s generalization capabilities, reduces overfitting by presenting a more diverse dataset, and ensures that the model doesn’t rely too heavily on specific orientations or positions present in the original, limited training set. In the context of the MLS-C01 exam, this is a fundamental and highly effective strategy for improving model performance, particularly in computer vision tasks where real-world data naturally exhibits variations.

Example: When training a machine learning model to classify different types of vehicles from images, adding rotated versions of cars, trucks, and motorcycles to the training dataset enables the model to correctly identify these vehicles even if they appear at various angles or orientations in new, unseen images.

QUESTION 55

A Machine Learning Specialist needs to be able to ingest streaming data and store it in Apache Parquet files for exploration and analysis.

Which of the following services would both ingest and store this data in the correct format?

  • A. AWS DMS
  • B. Amazon Kinesis Data Streams
  • C. Amazon Kinesis Data Firehose
  • D. Amazon Kinesis Data Analytics
Click to View Verified Solution & Explanation

Correct Option: C

Explanation: ✅ Amazon Kinesis Data Firehose

Description: Amazon Kinesis Data Firehose is a fully managed, serverless service that reliably captures, transforms, and loads streaming data into data lakes, data stores, and analytics services. It automatically scales to match the throughput of your data and requires no ongoing administration. Firehose can transform, convert, aggregate, and compress data before loading it to destinations like Amazon S3, Amazon Redshift, Amazon OpenSearch Service, Splunk, and generic HTTP endpoints.

Why this fits: For machine learning workloads, collecting large volumes of streaming data and reliably delivering it to a persistent store (such as Amazon S3 for a data lake) is a common requirement. Kinesis Data Firehose simplifies this process by providing an incredibly easy-to-use, fully managed solution that automatically handles data ingestion, buffering, and delivery without requiring you to provision or manage any servers. This reduces operational overhead and allows ML engineers and data scientists to focus on building models rather than managing infrastructure for data ingestion. Its built-in capabilities for data transformation (e.g., using AWS Lambda) and format conversion (e.g., to Parquet or ORC) are also highly beneficial for preparing data for downstream ML training or inference.

Example: An e-commerce company collects real-time clickstream data from its website and mobile applications. They need to deliver this data continuously to an Amazon S3 data lake for fraud detection model training and real-time recommendation engines. By using Amazon Kinesis Data Firehose, they can send all clickstream events to a Firehose delivery stream, which automatically buffers and delivers the data to a specified S3 bucket. Firehose can also be configured to transform the raw JSON data into a columnar format like Parquet, making it more efficient for subsequent analytical queries and ML model training.

QUESTION 56 (Multi-Select)

A Data Scientist is developing a machine learning model to classify whether a financial transaction is fraudulent. The labeled data available for training consists of 100,000 non-fraudulent observations and 1,000 fraudulent observations.

The Data Scientist applies the XGBoost algorithm to the data, resulting in the following confusion matrix when the trained model is applied to a previously unseen validation dataset. The accuracy of the model is 99.1%, but the Data Scientist has been asked to reduce the number of false negatives.

Which combination of steps should the Data Scientist take to reduce the number of false positive predictions by the model? (Choose two.)

  • A. Change the XGBoost eval_metric parameter to optimize based on rmse instead of error.
  • B. Increase the XGBoost scale_pos_weight parameter to adjust the balance of positive and negative weights.
  • C. Increase the XGBoost max_depth parameter because the model is currently underfitting the data.
  • D. Change the XGBoost eval_metric parameter to optimize based on AUC instead of error.
  • E. Decrease the XGBoost max_depth parameter because the model is currently overfitting the data.
Click to View Verified Solution & Explanation

Correct Option: B,D

Explanation: ✅ Increase the XGBoost scale_pos_weight parameter to adjust the balance of positive and negative weights.

Description: scale_pos_weight is an XGBoost parameter used to handle imbalanced datasets. It assigns a higher weight to the positive class (minority class) in the loss function, effectively telling the model to pay more attention to correctly classifying these instances.

Why this fits: The provided confusion matrix shows a highly imbalanced dataset where the actual positive class (Actual 1) has significantly fewer instances (1,000 total) compared to the actual negative class (Actual 0) (100,000 total). The model correctly predicted 99,966 of the 100,000 negative cases, but only 123 of the 1,000 positive cases, resulting in 877 False Negatives. This indicates the model is struggling to identify the positive class. Increasing scale_pos_weight helps to penalize false negatives more heavily, encouraging the model to improve its recall for the positive class, which is a common issue in such imbalanced scenarios.

Example: If the ratio of negative to positive samples is 100:1, scale_pos_weight could be set to 100 (or count(negative cases) / count(positive cases)), giving the positive class predictions 100 times more importance in the loss calculation.


✅ Change the XGBoost eval_metric parameter to optimize based on AUC instead of error.

Description: eval_metric is a parameter used in XGBoost for monitoring performance during training and for early stopping. AUC (Area Under the Receiver Operating Characteristic curve) is a performance metric for binary classification that measures the model’s ability to distinguish between positive and negative classes across all possible classification thresholds.

Why this fits: When dealing with imbalanced datasets, metrics like accuracy or error rate can be misleading because a model might achieve high overall accuracy by simply predicting the majority class. The current model shows this behavior with a low recall (12.3%) for the positive class despite likely high overall accuracy. AUC is a robust metric for imbalanced datasets as it is less sensitive to class distribution. By optimizing for AUC, the model is encouraged to improve its discriminative power, making it better at ranking positive instances higher than negative ones, which directly addresses the issue of high false negatives and poor recall for the minority class.

Example: Instead of using eval_metric='error' or eval_metric='accuracy', setting eval_metric='auc' tells XGBoost to use AUC to evaluate performance on the validation set during training. This guides the boosting process to prioritize models that effectively separate the classes, rather than models that are simply accurate on the majority class.

QUESTION 57

A Machine Learning Specialist is assigned a TensorFlow project using Amazon SageMaker for training, and needs to continue working for an extended period with no Wi-Fi access.

Which approach should the Specialist use to continue working?

  • A. Install Python 3 and boto3 on their laptop and continue the code development using that environment.
  • B. Download the TensorFlow Docker container used in Amazon SageMaker from GitHub to their local environment, and use the Amazon SageMaker Python SDK to test the code.
  • C. Download TensorFlow from tensorflow.org to emulate the TensorFlow kernel in the SageMaker environment.
  • D. Download the SageMaker notebook to their local environment, then install Jupyter Notebooks on their laptop and continue the development in a local notebook.
Click to View Verified Solution & Explanation

Correct Option: B

Explanation: ✅ Download the TensorFlow Docker container used in Amazon SageMaker from GitHub to their local environment, and use the Amazon SageMaker Python SDK to test the code.

Description: Amazon SageMaker provides pre-built Docker images for popular machine learning frameworks like TensorFlow. These images contain all the necessary dependencies, libraries, and environment configurations that SageMaker uses to run training jobs and host models. The Amazon SageMaker Python SDK includes a "local mode" feature, which allows developers to run SageMaker training scripts and deploy models using these same Docker images directly on their local machine, without incurring AWS costs.

Why this fits: This approach ensures the highest fidelity between the local development environment and the SageMaker cloud environment. By using the exact same Docker container as SageMaker and the local mode of the SageMaker Python SDK, the developer can test and debug their TensorFlow model locally under conditions that closely mimic how it will run in SageMaker. This significantly reduces "works on my machine, but not on SageMaker" issues and allows for cost-effective iteration. The SageMaker Python SDK’s local mode simplifies the process by handling the Docker container management and execution.

Example: A data scientist is developing a TensorFlow model for image classification. Before submitting it to SageMaker for a costly training job on a GPU instance, they can pull the official SageMaker TensorFlow Docker image to their laptop. They then use the SageMaker Python SDK’s TensorFlow estimator configured with instance_type='local' to train their model on a small dataset locally. This allows them to quickly identify and fix code errors, hyperparameter issues, or environment mismatches without incurring cloud costs or waiting for SageMaker instance provisioning.

QUESTION 58

A Machine Learning Specialist is working with a large cybersecurity company that manages security events in real time for companies around the world. The cybersecurity company wants to design a solution that will allow it to use machine learning to score malicious events as anomalies on the data as it is being ingested. The company also wants be able to save the results in its data lake for later processing and analysis.

What is the MOST efficient way to accomplish these tasks?

  • A. Ingest the data using Amazon Kinesis Data Firehose, and use Amazon Kinesis Data Analytics Random Cut Forest (RCF) for anomaly detection. Then use Kinesis Data Firehose to stream the results to Amazon S3.
  • B. Ingest the data into Apache Spark Streaming using Amazon EMR, and use Spark MLlib with k-means to perform anomaly detection. Then store the results in an Apache Hadoop Distributed File System (HDFS) using Amazon EMR with a replication factor of three as the data lake.
  • C. Ingest the data and store it in Amazon S3. Use AWS Batch along with the AWS Deep Learning AMIs to train a k-means model using TensorFlow on the data in Amazon S3.
  • D. Ingest the data and store it in Amazon S3. Have an AWS Glue job that is triggered on demand transform the new data. Then use the built-in Random Cut Forest (RCF) model within Amazon SageMaker to detect anomalies in the data.
Click to View Verified Solution & Explanation

Correct Option: A

Explanation: ✅ Ingest the data using Amazon Kinesis Data Firehose, and use Amazon Kinesis Data Analytics Random Cut Forest (RCF) for anomaly detection. Then use Kinesis Data Firehose to stream the results to Amazon S3.

Description: This solution utilizes a fully managed, serverless architecture explicitly designed for real-time stream processing and anomaly detection on streaming data. Amazon Kinesis Data Firehose is a service for reliably ingesting and delivering real-time streaming data to various destinations. Amazon Kinesis Data Analytics provides built-in machine learning functions, such as the Random Cut Forest (RCF) algorithm, to detect anomalies directly on the streaming data in real time without needing to manage servers. The processed results, including identified anomalies, are then streamed back out using Kinesis Data Firehose to Amazon S3 for durable storage, further analysis, or integration with other services.

Why this fits: This approach establishes an efficient, end-to-end serverless pipeline for real-time anomaly detection. Kinesis Data Firehose provides scalable and secure data ingestion and delivery. Kinesis Data Analytics is purpose-built for real-time analytics on streaming data, with its integrated RCF algorithm offering an effective and low-latency method for identifying anomalies. The output to S3 via Firehose ensures persistence and accessibility of anomaly detection results. This combination of services minimizes operational overhead, provides high scalability, and delivers results with low latency, aligning perfectly with requirements for real-time processing.

Example: An IoT sensor network continuously streams data about device performance. To detect unusual behavior that could indicate a malfunction, this sensor data is ingested via Kinesis Data Firehose. Kinesis Data Analytics processes this stream using its RCF algorithm to identify immediate anomalies. Any detected anomalies (e.g., sudden temperature spikes or unusual vibration patterns) are then streamed through Kinesis Data Firehose to an S3 bucket, which can trigger an alert system or an automated maintenance ticket.

QUESTION 59

A Data Scientist wants to gain real-time insights into a data stream of GZIP files.

Which solution would allow the use of SQL to query the stream with the LEAST latency?

  • A. Amazon Kinesis Data Analytics with an AWS Lambda function to transform the data.
  • B. AWS Glue with a custom ETL script to transform the data.
  • C. An Amazon Kinesis Client Library to transform the data and save it to an Amazon ES cluster.
  • D. Amazon Kinesis Data Firehose to transform the data and put it into an Amazon S3 bucket.
Click to View Verified Solution & Explanation

Correct Option: A

Explanation: ✅ Amazon Kinesis Data Analytics with an AWS Lambda function to transform the data.

Description: Amazon Kinesis Data Analytics is a fully managed service that allows you to process and analyze streaming data in real time using SQL or Apache Flink. It can take streaming data from Kinesis Data Streams or Kinesis Data Firehose, process it, and send the results to various destinations. AWS Lambda functions can be integrated with Kinesis Data Analytics as user-defined functions (UDFs) or as a pre-processing step to perform custom transformations, enrichments, or complex logic on the incoming data streams before further analysis or storage.

Why this fits: This combination is highly effective for real-time data transformation. Kinesis Data Analytics provides the real-time processing engine, while Lambda offers a flexible, serverless compute environment for implementing arbitrary data transformation logic that might be too complex for SQL or simple Flink operations. This allows for immediate cleaning, normalization, or feature engineering of streaming data as it arrives, making it ready for real-time inference or near real-time ingestion into a data lake or ML pipeline.

Example: Imagine a scenario where IoT sensor data is streaming in, and you need to convert temperature readings from Celsius to Fahrenheit, filter out noisy data points, and concatenate several fields into a single feature string before feeding it to a real-time anomaly detection model. Kinesis Data Analytics can ingest the stream, and a Lambda function can be invoked for each record to perform the unit conversion, filtering, and string concatenation, outputting the transformed data to a Kinesis Data Stream which an ML model can then consume.

QUESTION 60

A retail company intends to use machine learning to categorize new products. A labeled dataset of current products was provided to the Data Science team. The dataset includes 1,200 products. The labeled dataset has 15 features for each product such as title dimensions, weight, and price. Each product is labeled as belonging to one of six categories such as books, games, electronics, and movies.

Which model should be used for categorizing new products using the provided dataset for training?

  • A. AnXGBoost model where the objective parameter is set to multi:softmax
  • B. A deep convolutional neural network (CNN) with a softmax activation function for the last layer
  • C. A regression forest where the number of trees is set equal to the number of product categories
  • D. A DeepAR forecasting model based on a recurrent neural network (RNN)
Click to View Verified Solution & Explanation

Correct Option: A

Explanation: ✅ An XGBoost model where the objective parameter is set to multi:softmax

Description: XGBoost (Extreme Gradient Boosting) is an open-source distributed gradient boosting library that provides a highly efficient and flexible implementation of gradient boosting machines. It is widely recognized for its speed, performance, and ability to handle various types of tabular data problems. When the objective parameter is set to multi:softmax, XGBoost is configured for multi-class classification tasks, where each instance must be assigned to one of several mutually exclusive categories. This objective requires the num_class parameter to be specified, indicating the total number of classes.

Why this fits: For multi-class classification problems on structured or tabular data, XGBoost with the multi:softmax objective is an excellent choice. It excels at accurately classifying data points into distinct categories and is known for its strong predictive performance across a wide range of datasets. Its efficiency and ability to handle complex relationships within the data make it a go-to algorithm for many real-world classification challenges, making it a suitable option for a wide array of machine learning applications on AWS.

Example: An online retailer wants to classify customer support tickets into predefined categories such as "billing inquiry," "technical issue," "product complaint," or "delivery status." An XGBoost model with objective='multi:softmax' and num_class=4 (for the four categories) can be trained on past ticket data (features could include keywords from the ticket description, customer history, etc.) to automatically route new tickets to the correct department or categorize them for analysis.

QUESTION 61

A Data Scientist is working on an application that performs sentiment analysis. The validation accuracy is poor, and the Data Scientist thinks that the cause may be a rich vocabulary and a low average frequency of words in the dataset.

Which tool should be used to improve the validation accuracy?

  • A. Amazon Comprehend syntax analysis and entity detection
  • B. Amazon SageMaker BlazingText cbow mode
  • C. Natural Language Toolkit (NLTK) stemming and stop word removal
  • D. Scikit-leam term frequency-inverse document frequency (TF-IDF) vectorizer
Click to View Verified Solution & Explanation

Correct Option: D

Explanation: ✅ Scikit-learn term frequency-inverse document frequency (TF-IDF) vectorizer

Description: TF-IDF (Term Frequency-Inverse Document Frequency) is a numerical statistic used in information retrieval and text mining. It reflects how important a word is to a document in a collection or corpus. The Scikit-learn TfidfVectorizer is a utility that transforms a collection of raw documents into a matrix of TF-IDF features. It takes into account both the frequency of a term within a document (TF) and the inverse frequency of the term across all documents (IDF), effectively down-weighting common words like "the" and "is" that appear frequently across many documents but carry less unique information.

Why this fits: In machine learning, particularly with text data, models require numerical input. TF-IDF is a standard, robust, and widely used technique to convert unstructured text data into a structured numerical feature vector representation suitable for various machine learning algorithms. This process is often a crucial step in feature engineering for tasks like text classification, clustering, or information retrieval. While AWS offers managed NLP services (e.g., Comprehend) and algorithms for embeddings (e.g., BlazingText), the MLS-C01 exam also assesses fundamental machine learning techniques and the ability to prepare data using common libraries like Scikit-learn, especially when developing custom models on Amazon SageMaker.

Example: For a sentiment analysis task where customer reviews are collected, the raw text reviews would first be preprocessed (e.g., lowercasing, punctuation removal). Then, a Scikit-learn TfidfVectorizer would be applied to convert these cleaned reviews into a sparse matrix of TF-IDF features. This numerical matrix, where each row represents a review and columns represent TF-IDF scores for different words, could then be used as input to train a classification model (e.g., Logistic Regression, XGBoost) on Amazon SageMaker to predict positive or negative sentiment.

QUESTION 62

Machine Learning Specialist is building a model to predict future employment rates based on a wide range of economic factors. While exploring the data, the Specialist notices that the magnitude of the input features vary greatly. The Specialist does not want variables with a larger magnitude to dominate the model.

What should the Specialist do to prepare the data for model training?

  • A. Apply quantile binning to group the data into categorical bins to keep any relationships in the data by replacing the magnitude with distribution.
  • B. Apply the Cartesian product transformation to create new combinations of fields that are independent of the magnitude.
  • C. Apply normalization to ensure each field will have a mean of 0 and a variance of 1 to remove any significant magnitude.
  • D. Apply the orthogonal sparse bigram (OSB) transformation to apply a fixed-size sliding window to generate new features of a similar magnitude.
Click to View Verified Solution & Explanation

Correct Option: C

Explanation: ✅ Apply normalization to ensure each field will have a mean of 0 and a variance of 1 to remove any significant magnitude.

Description: Normalization, specifically standardization (also known as Z-score normalization), is a data preprocessing technique where the values are rescaled such that they have a mean of 0 and a standard deviation (and thus variance) of 1. The formula for standardization is z = (x – μ) / σ, where x is the original value, μ is the mean of the feature, and σ is the standard deviation of the feature.

Why this fits: Many machine learning algorithms, particularly those based on gradient descent (e.g., neural networks, logistic regression) or distance calculations (e.g., k-NN, SVMs), are sensitive to the scale of input features. Features with larger magnitudes can dominate the learning process, leading to slower convergence or suboptimal model performance. By normalizing features to a mean of 0 and a variance of 1, all features contribute equally to the distance calculations or gradient updates, improving model stability and performance. This process effectively removes the "significant magnitude" difference between features.

Example: Consider a dataset for predicting house prices with features like ‘number of bedrooms’ (values typically 1-5) and ‘square footage’ (values typically 500-5000). Without normalization, ‘square footage’ would have a much larger impact on the model’s loss function or distance metrics than ‘number of bedrooms’ due to its larger magnitude. Applying standardization ensures both features are on a comparable scale, allowing the model to learn their true relationships without bias towards the larger-magnitude feature.

QUESTION 63

A Machine Learning Specialist must build out a process to query a dataset on Amazon S3 using Amazon Athena. The dataset contains more than 800,000 records stored as plaintext CSV files. Each record contains 200 columns and is approximately 1.5 MB in size. Most queries will span 5 to 10 columns only.

How should the Machine Learning Specialist transform the dataset to minimize query runtime?

  • A. Convert the records to Apache Parquet format.
  • B. Convert the records to JSON format.
  • C. Convert the records to GZIP CSV format.
  • D. Convert the records to XML format.
Click to View Verified Solution & Explanation

Correct Option: A

Explanation: ✅ Convert the records to Apache Parquet format.

Description: Apache Parquet is an open-source, column-oriented data file format designed for efficient data storage and retrieval. It is widely used in the big data ecosystem, particularly for analytical workloads and machine learning.

Why this fits: Converting records to Apache Parquet format is a best practice for optimizing data storage and processing efficiency in AWS machine learning workflows for several key reasons:

  1. Columnar Storage: Parquet stores data in a columnar fashion, meaning that values for a specific column are stored contiguously. This significantly improves query performance by allowing data processing engines (like Amazon Athena, AWS Glue, or SageMaker processing jobs) to read only the necessary columns, rather than scanning entire rows. This is especially beneficial when you only need a subset of features for your machine learning model.
  2. Efficient Compression: Parquet files are highly compressed, leading to smaller file sizes. This reduces storage costs in Amazon S3 and decreases the amount of data that needs to be transferred over the network, thereby speeding up data loading for training jobs and reducing processing times. Common compression algorithms like Snappy, GZIP, or LZO are integrated.
  3. Predicate Pushdown: This optimization allows query engines to filter data directly at the file level based on column values, further reducing the amount of data read from storage and improving performance.
  4. Schema Evolution: Parquet supports schema evolution, making it flexible for handling changes in data structure over time without requiring a full data reload.
  5. Wide Compatibility: Parquet is broadly supported across AWS services, including Amazon S3, Amazon Athena, AWS Glue, Amazon EMR, and Amazon SageMaker, making it an ideal format for integrated ML data pipelines.

    Example: Imagine a dataset with millions of customer records, each having hundreds of features. If a machine learning model only requires 10 specific features for training, storing this data in Parquet format allows SageMaker or an upstream processing job to efficiently extract just those 10 columns from S3 without having to read and parse the entire dataset row by row, dramatically speeding up data preparation and model training.

QUESTION 64

A Machine Learning Specialist is developing a daily ETL workflow containing multiple ETL jobs. The workflow consists of the following processes:

  • A. Start the workflow as soon as data is uploaded to Amazon S3.
  • B. When all the datasets are available in Amazon S3, start an ETL job to join the uploaded datasets with multiple terabyte-sized datasets already stored in Amazon S3.
  • C. Store the results of joining datasets in Amazon S3.
  • D. If one of the jobs fails, send a notification to the Administrator.
  • E. Use AWS Lambda to trigger an AWS Step Functions workflow to wait for dataset uploads to complete in Amazon S3. Use AWS Glue to join the datasets. Use an Amazon CloudWatch alarm to send an SNS notification to the Administrator in the case of a failure.
  • F. Develop the ETL workflow using AWS Lambda to start an Amazon SageMaker notebook instance. Use a lifecycle configuration script to join the datasets and persist the results in Amazon S3. Use an Amazon CloudWatch alarm to send an SNS notification to the Administrator in the case of a failure.
  • G. Develop the ETL workflow using AWS Batch to trigger the start of ETL jobs when data is uploaded to Amazon S3. Use AWS Glue to join the datasets in Amazon S3. Use an Amazon CloudWatch alarm to send an SNS notification to the Administrator in the case of a failure.
  • H. Use AWS Lambda to chain other Lambda functions to read and join the datasets in Amazon S3 as soon as the data is uploaded to Amazon S3. Use an Amazon CloudWatch alarm to send an SNS notification to the Administrator in the case of a failure.
Click to View Verified Solution & Explanation

Correct Option: A

Explanation: ✅ Start the workflow as soon as data is uploaded to Amazon S3.

Description: This choice refers to leveraging Amazon S3 event notifications, a core capability for building event-driven architectures on AWS. When an object is created, deleted, or modified in an S3 bucket, S3 can publish an event notification to various destinations, including AWS Lambda functions, Amazon Simple Notification Service (SNS) topics, or Amazon Simple Queue Service (SQS) queues. This mechanism allows for immediate, automated reactions to data arrival.

Why this fits: For machine learning workflows, data ingestion is a critical first step. Initiating a workflow immediately upon data upload to S3 is a highly efficient and scalable pattern. It ensures that processing—such as data validation, preprocessing, feature engineering, or even triggering model inference—begins without delay, optimizing resource utilization and minimizing the latency between data arrival and its use in the ML pipeline. This serverless, event-driven approach is a best practice for building responsive and automated data lakes for machine learning on AWS.

Example: An IoT device fleet uploads new sensor readings as CSV files to an Amazon S3 bucket. An S3 event notification for object creation (s3:ObjectCreated:*) is configured to invoke an AWS Lambda function. This Lambda function then triggers an AWS Glue job to transform the raw data into a clean, standardized format, or it might initiate an AWS Step Functions workflow to orchestrate a more complex pipeline involving data quality checks, feature store updates, and potentially model retraining, all immediately upon the arrival of new data.

QUESTION 65 (Multi-Select)

An agency collects census information within a country to determine healthcare and social program needs by province and city. The census form collects responses for approximately 500 questions from each citizen.

Which combination of algorithms would provide the appropriate insights? (Choose two.)

  • A. The factorization machines (FM) algorithm
  • B. The Latent Dirichlet Allocation (LDA) algorithm
  • C. The principal component analysis (PCA) algorithm
  • D. The k-means algorithm
  • E. The Random Cut Forest (RCF) algorithm
Click to View Verified Solution & Explanation

Correct Option: C,D

Explanation: ✅ The principal component analysis (PCA) algorithm

Description: Principal Component Analysis (PCA) is an unsupervised dimensionality reduction technique. Its primary goal is to transform a dataset with many features into a new dataset with fewer features (principal components) while retaining as much variance from the original data as possible. These new features are orthogonal (uncorrelated).

Why this fits: PCA is a fundamental algorithm in machine learning for feature engineering, data preprocessing, and noise reduction. By reducing the number of features, it can speed up model training, reduce memory usage, and sometimes improve model performance by mitigating the curse of dimensionality. It is a built-in algorithm in Amazon SageMaker.

Example: In a dataset with hundreds of sensor readings from a machine, PCA can be used to identify the most significant underlying factors (principal components) that explain the variance in the sensor data, allowing for more efficient anomaly detection or predictive maintenance modeling.


✅ The k-means algorithm

Description: K-means is an unsupervised clustering algorithm that partitions ‘n’ data points into ‘k’ clusters. The algorithm aims to minimize the within-cluster variance, meaning data points within the same cluster are as similar as possible, and data points in different clusters are as dissimilar as possible. Each cluster is represented by its centroid (mean).

Why this fits: K-means is a widely used algorithm for discovering inherent groupings in data without prior knowledge of labels. It is essential for tasks like customer segmentation, document clustering, and image compression. Amazon SageMaker provides a highly scalable implementation of the k-means algorithm.

Example: A marketing team can use k-means to segment their customer base into distinct groups based on purchasing history, browsing behavior, or demographic data. This allows for targeted marketing campaigns tailored to the specific needs and preferences of each customer segment.

QUESTION 66

A Machine Learning Specialist uploads a dataset to an Amazon S3 bucket protected with server-side encryption using AWS KMS.

How should the ML Specialist define the Amazon SageMaker notebook instance so it can read the same dataset from Amazon S3?

  • A. Define security group(s) to allow all HTTP inbound/outbound traffic and assign those security group(s) to the Amazon SageMaker notebook instance.
  • B. Configure the Amazon SageMaker notebook instance to have access to the VPC. Grant permission in the KMS key policy to the notebook’s KMS role.
  • C. Assign an IAM role to the Amazon SageMaker notebook with S3 read access to the dataset. Grant permission in the KMS key policy to that role.
  • D. Assign the same KMS key used to encrypt data in Amazon S3 to the Amazon SageMaker notebook instance.
Click to View Verified Solution & Explanation

Correct Option: C

Explanation: ✅ Assign an IAM role to the Amazon SageMaker notebook with S3 read access to the dataset. Grant permission in the KMS key policy to that role.

Description: When an Amazon SageMaker notebook instance needs to access data stored in Amazon S3, especially if that data is encrypted using an AWS Key Management Service (KMS) customer-managed key (CMK), two distinct sets of permissions are required. First, the IAM role associated with the SageMaker notebook must have explicit permissions (e.g., s3:GetObject, s3:ListBucket) to read objects from the S3 bucket. Second, if the data is encrypted with KMS, the KMS key policy for the specific KMS key used to encrypt the S3 objects must grant the SageMaker notebook’s IAM role permission to decrypt the data (e.g., kms:Decrypt). Both sets of permissions are crucial for successful data access.

Why this fits: This choice correctly identifies the two-pronged approach required for accessing KMS-encrypted data in S3 from a SageMaker notebook instance. The IAM role provides authorization for S3 actions, and the KMS key policy provides authorization for cryptographic operations on the encrypted data. Without both, the notebook instance would either lack permission to interact with S3 or be unable to decrypt the data even if it could retrieve the encrypted object from S3.

Example: An Amazon S3 bucket named my-ml-data contains training data encrypted with a KMS CMK named arn:aws:kms:us-east-1:123456789012:key/abcdefgh-1234-abcd-1234-abcdefghijkl. The SageMaker notebook instance is launched with an IAM role SageMakerExecutionRole. To access the data, SageMakerExecutionRole must have a policy allowing s3:GetObject on arn:aws:s3:::my-ml-data/*. Additionally, the resource policy for the KMS key arn:aws:kms:us-east-1:123456789012:key/abcdefgh-1234-abcd-1234-abcdefghijkl must explicitly include a statement allowing SageMakerExecutionRole to perform kms:Decrypt actions.

QUESTION 67

A Data Scientist needs to migrate an existing on-premises ETL process to the cloud. The current process runs at regular time intervals and uses PySpark to combine and format multiple large data sources into a single consolidated output for downstream processing.

The Data Scientist has been given the following requirements to the cloud solution: Combine multiple data sources.

Reuse existing PySpark logic.

Run the solution on the existing schedule.

Minimize the number of servers that will need to be managed.

Which architecture should the Data Scientist use to build this solution?

  • A. Write the raw data to Amazon S3. Schedule an AWS Lambda function to submit a Spark step to a persistent Amazon EMR cluster based on the existing schedule. Use the existing PySpark logic to run the ETL job on the EMR cluster. Output the results to a “processed” location in Amazon S3 that is accessible for downstream use.
  • B. Write the raw data to Amazon S3. Create an AWS Glue ETL job to perform the ETL processing against the input data. Write the ETL job in PySpark to leverage the existing logic. Create a new AWS Glue trigger to trigger the ETL job based on the existing schedule. Configure the output target of the ETL job to write to a “processed” location in Amazon S3 that is accessible for downstream use.
  • C. Write the raw data to Amazon S3. Schedule an AWS Lambda function to run on the existing schedule and process the input data from Amazon S3. Write the Lambda logic in Python and implement the existing PySpark logic to perform the ETL process. Have the Lambda function output the results to a “processed” location in Amazon S3 that is accessible for downstream use.
  • D. Use Amazon Kinesis Data Analytics to stream the input data and perform real-time SQL queries against the stream to carry out the required transformations within the stream. Deliver the output results to a “processed” location in Amazon S3 that is accessible for downstream use.
Click to View Verified Solution & Explanation

Correct Option: B

Explanation: ✅ Choice B: Write the raw data to Amazon S3. Create an AWS Glue ETL job to perform the ETL processing against the input data. Write the ETL job in PySpark to leverage the existing logic. Create a new AWS Glue trigger to trigger the ETL job based on the existing schedule. Configure the output target of the ETL job to write to a “processed” location in Amazon S3 that is accessible for downstream use.

Description: AWS Glue is a fully managed, serverless extract, transform, and load (ETL) service that makes it easy to prepare your data for analytics and machine learning. It supports running jobs written in PySpark (Python with Spark) or Scala. Glue provides a data catalog, job scheduler (triggers), and job execution environment, abstracting away the underlying infrastructure.

Why this fits: This choice leverages AWS Glue, which is designed for exactly this type of workload: scheduled batch ETL processing, especially when existing PySpark logic needs to be migrated.

  1. Serverless ETL: AWS Glue is a serverless service, which means it automatically provisions and manages the necessary compute resources, reducing operational overhead compared to managing persistent EMR clusters.
  2. PySpark Compatibility: AWS Glue natively supports PySpark, allowing the direct reuse of existing PySpark ETL logic, which is a significant advantage for migration and consistency.
  3. Scheduled Execution: AWS Glue triggers enable jobs to be scheduled, perfectly aligning with the requirement for existing scheduled processing.
  4. S3 Integration: It seamlessly integrates with Amazon S3 for both input (raw data) and output (processed data), aligning with standard data lake architectures.
  5. Cost-Effective: As a serverless service, you pay only for the resources consumed during the execution of your ETL jobs.

Example: A company has daily sensor data arriving in Amazon S3. They currently use an on-premises Apache Spark cluster with PySpark scripts to clean, transform, and aggregate this data before storing it in a structured format for analytics. To migrate this to AWS, they can create an AWS Glue ETL job, upload their PySpark script, and configure an AWS Glue time-based trigger to run the job every day at a specific time, writing the processed output to another S3 bucket.

QUESTION 68 (Multi-Select)

A Data Scientist is building a model to predict customer churn using a dataset of 100 continuous numerical features. The Marketing team has not provided any insight about which features are relevant for churn prediction. The Marketing team wants to interpret the model and see the direct impact of relevant features on the model outcome. While training a logistic regression model, the Data Scientist observes that there is a wide gap between the training and validation set accuracy.

Which methods can the Data Scientist use to improve the model performance and satisfy the Marketing team’s needs? (Choose two.)

  • A. Add L1 regularization to the classifier
  • B. Add features to the dataset
  • C. Perform recursive feature elimination
  • D. Perform t-distributed stochastic neighbor embedding (t-SNE)
  • E. Perform linear discriminant analysis
Click to View Verified Solution & Explanation

Correct Option: A,C

Explanation: ✅ Choice A: Add L1 regularization to the classifier

Description: L1 regularization, also known as Lasso regularization, adds a penalty term to the loss function that is proportional to the absolute value of the magnitude of the coefficients. This penalty encourages the model to prefer simpler models by pushing some feature coefficients exactly to zero, effectively performing automatic feature selection.
Why this fits: Overfitting occurs when a model learns the training data too well, including its noise and outliers, leading to poor generalization on unseen data. L1 regularization reduces model complexity by shrinking less important feature coefficients to zero, thereby simplifying the model and reducing its tendency to overfit.
Example: In a linear regression model with many features, applying L1 regularization can identify and zero out the coefficients of irrelevant features, resulting in a sparser model that is less prone to overfitting and more interpretable.


✅ Choice C: Perform recursive feature elimination

Description: Recursive Feature Elimination (RFE) is a feature selection method that works by fitting a model and eliminating the weakest feature(s) (e.g., those with the smallest coefficients for linear models) until the specified number of features is reached. This process is repeated recursively on the reduced set of features.
Why this fits: By systematically removing less important or redundant features, RFE reduces the dimensionality of the dataset and the overall complexity of the model. A simpler model with fewer, more relevant features is less likely to memorize noise in the training data, thus directly combating overfitting and improving generalization performance.
Example: When building a classification model for a dataset with hundreds of features, RFE can be used to select the top 20 most impactful features, significantly reducing model complexity and preventing the model from overfitting to noisy or irrelevant predictors.

QUESTION 69

An aircraft engine manufacturing company is measuring 200 performance metrics in a time-series. Engineers want to detect critical manufacturing defects in near-real time during testing. All of the data needs to be stored for offline analysis.

What approach would be the MOST effective to perform near-real time defect detection?

  • A. Use AWS IoT Analytics for ingestion, storage, and further analysis. Use Jupyter notebooks from within AWS IoT Analytics to carry out analysis for anomalies.
  • B. Use Amazon S3 for ingestion, storage, and further analysis. Use an Amazon EMR cluster to carry out Apache Spark ML k-means clustering to determine anomalies.
  • C. Use Amazon S3 for ingestion, storage, and further analysis. Use the Amazon SageMaker Random Cut Forest (RCF) algorithm to determine anomalies.
  • D. Use Amazon Kinesis Data Firehose for ingestion and Amazon Kinesis Data Analytics Random Cut Forest (RCF) to perform anomaly detection. Use Kinesis Data Firehose to store data in Amazon S3 for further analysis.
Click to View Verified Solution & Explanation

Correct Option: D

Explanation: ✅ Use Amazon Kinesis Data Firehose for ingestion and Amazon Kinesis Data Analytics Random Cut Forest (RCF) to perform anomaly detection. Use Kinesis Data Firehose to store data in Amazon S3 for further analysis.

Description: This choice leverages AWS Kinesis services for a complete, real-time streaming data pipeline. Amazon Kinesis Data Firehose is an ETL service for reliably loading streaming data into data lakes, data stores, and analytics services. Amazon Kinesis Data Analytics is a real-time analytics service for streaming data, capable of running SQL queries or Apache Flink applications. It includes built-in machine learning algorithms, such as Random Cut Forest (RCF), specifically designed for anomaly detection on streaming data.

Why this fits: This solution precisely addresses the need for real-time ingestion, real-time anomaly detection, and subsequent storage for further analysis. Kinesis Data Firehose efficiently ingests and delivers streaming data, while Kinesis Data Analytics with RCF performs the crucial real-time anomaly detection directly on the data stream. Firehose can then continuously deliver the raw or processed data to Amazon S3, creating a durable data lake for historical analysis, training models, or audit purposes. This architecture is highly scalable and well-suited for scenarios requiring immediate insights from fast-moving data.

Example: A manufacturing plant needs to monitor sensor data from equipment to detect unusual patterns indicating potential failures in real-time. Sensor data is streamed to Kinesis Data Firehose, which then forwards it to Kinesis Data Analytics. A Kinesis Data Analytics application uses the RCF algorithm to identify anomalies in the sensor readings as they arrive, triggering alerts for maintenance teams. Simultaneously, Firehose continuously delivers all sensor data to Amazon S3 for long-term storage and future predictive maintenance model training.

QUESTION 70 (Multi-Select)

A Machine Learning team runs its own training algorithm on Amazon SageMaker. The training algorithm requires external assets. The team needs to submit both its own algorithm code and algorithm-specific parameters to Amazon SageMaker.

What combination of services should the team use to build a custom algorithm in Amazon SageMaker? (Choose two.)

  • A. AWS Secrets Manager
  • B. AWS CodeStar
  • C. Amazon ECR
  • D. Amazon ECS
  • E. Amazon S3
Click to View Verified Solution & Explanation

Correct Option: C,E

Explanation: ✅ Amazon ECR

Description: Amazon Elastic Container Registry (ECR) is a fully managed Docker container registry that makes it easy for developers to store, manage, and deploy Docker container images.

Why this fits: In machine learning workflows, especially for advanced or customized scenarios using services like Amazon SageMaker, it’s common to require specific software environments or libraries that are not included in standard base images. Data scientists build custom Docker images containing their training code, frameworks, and dependencies. Amazon ECR serves as the secure, scalable repository for these custom container images, allowing them to be pulled by SageMaker training jobs, inference endpoints, or other containerized services for consistent execution.

Example: A data scientist develops a custom deep learning model using a bleeding-edge version of PyTorch and several specialized libraries. They package this environment into a Docker image, push it to Amazon ECR, and then configure an Amazon SageMaker training job to use this image, ensuring the exact required environment is available during training.


✅ Amazon S3

Description: Amazon Simple Storage Service (S3) is an object storage service that offers industry-leading scalability, data availability, security, and performance.

Why this fits: Amazon S3 is the foundational storage service for nearly all machine learning workloads on AWS. It is used to store raw datasets, preprocessed features, model artifacts (the trained models themselves), intermediate outputs from training jobs, and experiment logs. Its high durability, availability, scalability, and seamless integration with services like Amazon SageMaker, AWS Glue, and Amazon Athena make it indispensable for managing the large volumes of data characteristic of ML projects.

Example: A large dataset of historical sales transactions is stored in an S3 bucket. An Amazon SageMaker processing job reads this data from S3, cleans and transforms it, and then writes the processed features back to another S3 location. Subsequently, a SageMaker training job reads these processed features from S3 to train a predictive model, and finally saves the trained model artifact back to a designated S3 bucket.

QUESTION 71

A Machine Learning Specialist wants to determine the appropriate SageMakerVariantInvocationsPerInstance setting for an endpoint automatic scaling configuration. The Specialist has performed a load test on a single instance and determined that peak requests per second (RPS) without service degradation is about 20 RPS. As this is the first deployment, the Specialist intends to set the invocation safety factor to 0.5.

Based on the stated parameters and given that the invocations per instance setting is measured on a per- minute basis, what should the Specialist set as the SageMakerVariantInvocationsPerInstance setting?

  1. 10
  2. 30
  • C. 600
  • D. 2,400<h1>
Click to View Verified Solution & Explanation

Correct Option: C

Explanation: ✅ 600

Description: The default soft limit for the number of running Kernel Gateway Apps within an Amazon SageMaker Studio domain. Kernel Gateway Apps are essential components that power interactive development environments such as notebooks, terminals, and interactive shells in SageMaker Studio.

Why this fits: AWS imposes a default soft limit of 600 running Kernel Gateway Apps per SageMaker Studio domain to manage resource allocation and ensure service stability. This means, by default, a maximum of 600 such applications can be running concurrently across all users within a single Studio domain. If an organization requires more, they must submit a service quota increase request. The value 2,400 is not the default soft limit for this specific resource.

Example: An enterprise has a large data science team utilizing Amazon SageMaker Studio. If 600 of their data scientists simultaneously open a Jupyter notebook in Studio, they will reach the default soft limit for Kernel Gateway Apps. Any additional scientist attempting to open a new notebook (which requires a new Kernel Gateway App) would be unable to, unless a quota increase has been approved for the Studio domain.

QUESTION 72

A company uses a long short-term memory (LSTM) model to evaluate the risk factors of a particular energy sector. The model reviews multi-page text documents to analyze each sentence of the text and categorize it as either a potential risk or no risk. The model is not performing well, even though the Data Scientist has experimented with many different network structures and tuned the corresponding hyperparameters.

Which approach will provide the MAXIMUM performance boost?

  • A. Initialize the words by term frequency-inverse document frequency (TF-IDF) vectors pretrained on a large collection of news articles related to the energy sector.
  • B. Use gated recurrent units (GRUs) instead of LSTM and run the training process until the validation loss stops decreasing.
  • C. Reduce the learning rate and run the training process until the training loss stops decreasing.
  • D. Initialize the words by word2vec embeddings pretrained on a large collection of news articles related to the energy sector.
Click to View Verified Solution & Explanation

Correct Option: D

Explanation: ✅ Initialize the words by word2vec embeddings pretrained on a large collection of news articles related to the energy sector.

Description: Word2vec is a group of related models used to produce word embeddings. These models are shallow, two-layer neural networks that are trained to reconstruct linguistic contexts of words. They learn to represent words as dense vectors in a continuous vector space, where words with similar meanings are located close together in the vector space. Pretraining these embeddings on a large corpus allows the model to capture general semantic and syntactic relationships between words before being fine-tuned on a specific task.

Why this fits: For machine learning models, especially deep learning models like LSTMs or Transformers, ingesting text data often starts with converting words into numerical representations. Word2vec embeddings are superior to traditional bag-of-words representations like TF-IDF for capturing semantic meaning and context. When dealing with a specialized domain, such as the energy sector, using embeddings pretrained on a relevant corpus (e.g., news articles related to the energy sector) is crucial. This pretraining allows the embeddings to learn domain-specific nuances and relationships that might not be present in general-purpose embeddings or that TF-IDF simply cannot capture. This approach effectively transfers knowledge from a large dataset to a potentially smaller, target dataset, improving model performance, especially in tasks like text classification, sentiment analysis, or named entity recognition within that domain.

Example: Consider a task to analyze sentiment in energy sector news. If the model uses word2vec embeddings pretrained on a general corpus, it might understand "oil" and "gas" are related. However, if pretrained on energy sector news, it would also understand that "drilling rights," "offshore platforms," and "carbon capture" are specific concepts within this domain and their nuanced relationships, leading to more accurate sentiment analysis or topic modeling results for articles discussing these terms.

QUESTION 73 (Multi-Select)

A Machine Learning Specialist needs to move and transform data in preparation for training. Some of the data needs to be processed in near-real time, and other data can be moved hourly. There are existing Amazon EMR MapReduce jobs to clean and feature engineering to perform on the data.

Which of the following services can feed data to the MapReduce jobs? (Choose two.)

  • A. AWS DMS
  • B. Amazon Kinesis
  • C. AWS Data Pipeline
  • D. Amazon Athena
  • E. Amazon ES
Click to View Verified Solution & Explanation

Correct Option: B,C

Explanation: ✅ Amazon Kinesis

Description: Amazon Kinesis is a suite of services designed for real-time processing of large streams of data. It includes Kinesis Data Streams for capturing and storing data streams, Kinesis Firehose for loading streaming data into data lakes, data stores, and analytics services, and Kinesis Data Analytics for real-time processing of streaming data.

Why this fits: In machine learning, especially for real-time or near real-time applications, Kinesis is crucial for ingesting continuous streams of data such as sensor data, application logs, website clickstreams, and IoT telemetry. This data can be used for real-time feature engineering, anomaly detection, online model training, or immediate inference.

Example: A company uses Kinesis Data Streams to ingest real-time clickstream data from its e-commerce website, which is then processed to update user profiles for a recommendation engine in near real-time.


✅ AWS Data Pipeline

Description: AWS Data Pipeline is a web service that helps you reliably process and move data between different AWS compute and storage services, as well as on-premises data sources, at specified intervals. It allows you to create complex data processing workloads that are fault-tolerant, repeatable, and highly available.

Why this fits: For machine learning workloads, Data Pipeline is an effective tool for orchestrating batch-oriented data processing tasks. This includes extracting data from various sources (e.g., RDS, DynamoDB), transforming it into a suitable format for ML models, and loading it into destinations like Amazon S3 data lakes or Amazon Redshift data warehouses, which then serve as data sources for model training. It manages dependencies and schedules for these ETL (Extract, Transform, Load) jobs.

Example: A data scientist configures AWS Data Pipeline to daily extract customer transaction data from an Amazon RDS database, run a series of cleaning and aggregation scripts, and then load the transformed features into an S3 bucket for use in a SageMaker batch training job.

QUESTION 74

A Machine Learning Specialist previously trained a logistic regression model using scikit-learn on a local machine, and the Specialist now wants to deploy it to production for inference only.

What steps should be taken to ensure Amazon SageMaker can host a model that was trained locally?

  • A. Build the Docker image with the inference code. Tag the Docker image with the registry hostname and upload it to Amazon ECR.
  • B. Serialize the trained model so the format is compressed for deployment. Tag the Docker image with the registry hostname and upload it to Amazon S3.
  • C. Serialize the trained model so the format is compressed for deployment. Build the image and upload it to Docker Hub.
  • D. Build the Docker image with the inference code. Configure Docker Hub and upload the image to Amazon ECR.
Click to View Verified Solution & Explanation

Correct Option: A

Explanation: ✅ Build the Docker image with the inference code. Tag the Docker image with the registry hostname and upload it to Amazon ECR.

Description: For custom inference logic or environments in Amazon SageMaker, a Docker container image is required to package the inference code (which includes pre-processing, post-processing, and model loading logic) and all its dependencies. This container image must then be stored in a registry that SageMaker can access. Amazon Elastic Container Registry (ECR) is the AWS-managed Docker container registry service that provides a secure, scalable, and reliable repository for Docker container images.

Why this fits: This choice accurately describes the standard and recommended process for deploying custom machine learning models for real-time or batch inference on Amazon SageMaker. SageMaker pulls the inference image from ECR, runs it on compute instances, and exposes the model endpoint. Tagging the image with the ECR registry hostname (e.g., aws_account_id.dkr.ecr.aws_region.amazonaws.com/my-repository:tag) is crucial for uniquely identifying and retrieving the correct image. Uploading to ECR provides a secure, scalable, and deeply integrated solution within the AWS ecosystem for managing container images, which is essential for production-grade machine learning deployments.

Example: An MLOps engineer develops a custom inference handler for a scikit-learn model, which includes a custom pre-processing step. They create a Dockerfile to define the environment, install scikit-learn, add their inference code, and expose the required HTTP endpoints. After building the Docker image locally, they log into ECR, tag the image with their ECR repository URI, and then push it to their Amazon ECR repository using docker push. SageMaker can then be configured to use this ECR image as the Container for their model endpoint configuration.

QUESTION 75

A credit card company wants to build a credit scoring model to help predict whether a new credit card

applicant will default on a credit card payment. The company has collected data from a large number of sources with thousands of raw attributes. Early experiments to train a classification model revealed that many attributes are highly correlated, the large number of features slows down the training speed significantly, and that there are some overfitting issues.

The Data Scientist on this project would like to speed up the model training time without losing a lot of information from the original dataset.

Which feature engineering technique should the Data Scientist use to meet the objectives?

  • A. Run self-correlation on all features and remove highly correlated features
  • B. Normalize all numerical values to be between 0 and 1
  • C. Use an autoencoder or principal component analysis (PCA) to replace original features with new features
  • D. Cluster raw data using k-means and use sample data from each cluster to build a new dataset
Click to View Verified Solution & Explanation

Correct Option: C

Explanation: ✅ Use an autoencoder or principal component analysis (PCA) to replace original features with new features

Description: Principal Component Analysis (PCA) is a linear dimensionality reduction technique that transforms a set of possibly correlated features into a smaller set of uncorrelated features called principal components, which capture the most variance in the data. An autoencoder is a neural network model used for unsupervised learning that aims to learn a compressed, lower-dimensional representation (encoding) of the input data. Both methods effectively create new features that are derived from the original feature set, reducing the dimensionality while preserving key information.

Why this fits: Both PCA and autoencoders are widely recognized and effective techniques for feature extraction and dimensionality reduction. They address the challenge of high-dimensional data by creating a new, reduced set of features that are more compact and often more informative for downstream machine learning tasks than the original features. This "replacement" strategy is a core aspect of their application in machine learning to mitigate issues like the curse of dimensionality, improve model generalization, and reduce computational complexity.

Example: In a scenario with a very large number of sensor readings (features) from an IoT device, using PCA could reduce these thousands of readings to a few principal components representing the most significant patterns. Alternatively, an autoencoder could learn a compressed representation of customer transaction data, where the latent space features capture essential purchasing behaviors more efficiently than individual transaction details.

QUESTION 76

A Data Scientist is training a multilayer perception (MLP) on a dataset with multiple classes. The target class of interest is unique compared to the other classes within the dataset, but it does not achieve and acceptable recall metric. The Data Scientist has already tried varying the number and size of the MLP’s hidden layers, which has not significantly improved the results. A solution to improve recall must be implemented as quickly as possible.

Which techniques should be used to meet these requirements?

  • A. Gather more data using Amazon Mechanical Turk and then retrain
  • B. Train an anomaly detection model instead of an MLP
  • C. Train an XGBoost model instead of an MLP
  • D. Add class weights to the MLP’s loss function and then retrain
Click to View Verified Solution & Explanation

Correct Option: D

Explanation: ✅ Add class weights to the MLP’s loss function and then retrain

Description: Class weights are numerical values assigned to different classes in a classification problem. When training a model, these weights are incorporated into the loss function, effectively increasing the penalty for misclassifying samples from classes with higher assigned weights. This method helps the model pay more attention to classes that are considered more important or are underrepresented in the dataset.

Why this fits: If an MLP (Multi-Layer Perceptron) is performing poorly on one specific class, it often indicates a problem with imbalanced datasets. In such scenarios, the model might optimize for overall accuracy by largely ignoring the minority class, leading to good performance on the majority classes but poor performance on the underrepresented one. By adding class weights to the loss function, you can increase the penalty for misclassifying the minority or underperforming class, compelling the model to learn its characteristics more effectively and improve its predictive performance for that specific class. This is a standard and highly effective technique for addressing class imbalance in deep learning models.

Example: Consider a medical diagnosis system where a rare disease (Class A) is present in only 1% of the training data, while healthy cases (Class B) make up 99%. An MLP might achieve 99% accuracy by always predicting Class B, completely failing to detect Class A. By assigning a higher weight (e.g., 99) to Class A and a lower weight (e.g., 1) to Class B in the loss function, the model is heavily penalized for missing Class A cases, thereby encouraging it to learn better distinguishing features for the rare disease.

QUESTION 77

A Machine Learning Specialist works for a credit card processing company and needs to predict which transactions may be fraudulent in near-real time. Specifically, the Specialist must train a model that returns the probability that a given transaction may fraudulent.

How should the Specialist frame this business problem?

  • A. Streaming classification
  • B. Binary classification
  • C. Multi-category classification
  • D. Regression classification
Click to View Verified Solution & Explanation

Correct Option: B

Explanation: ✅ Binary classification

Description: Binary classification is a supervised machine learning task where the objective is to categorize inputs into one of two distinct and mutually exclusive classes. These classes are often represented numerically (e.g., 0 or 1) or categorically (e.g., "true" or "false," "positive" or "negative," "spam" or "not spam").

Why this fits: Understanding different types of machine learning problems is a foundational requirement for the AWS Certified Machine Learning – Specialty exam. Binary classification is one of the most common and fundamental problem types encountered in real-world ML applications and is a core concept that candidates are expected to understand for model selection, evaluation, and deployment strategies on AWS.

Example: A classic example is a fraud detection system that classifies a transaction as either "fraudulent" or "legitimate." Another example is predicting whether a customer will "churn" (cancel a subscription) or "not churn."

QUESTION 78

A real estate company wants to create a machine learning model for predicting housing prices based on a historical dataset. The dataset contains 32 features.

Which model will meet the business requirement?

  • A. Logistic regression
  • B. Linear regression
  • C. K-means
  • D. Principal component analysis (PCA)
Click to View Verified Solution & Explanation

Correct Option: B

Explanation: ✅ Linear regression

Description: Linear regression is a supervised machine learning algorithm used for predicting a continuous target variable. It models the relationship between a dependent variable and one or more independent variables by fitting a linear equation to observed data. The goal is to find the best-fitting straight line (or hyperplane in higher dimensions) that minimizes the sum of squared differences between the predicted and actual values.

Why this fits: In the context of the AWS Certified Machine Learning – Specialty exam, linear regression is a fundamental algorithm taught and evaluated for problems requiring the prediction of a continuous numerical output. This algorithm is widely used in various industries for tasks such as sales forecasting, risk assessment, and resource planning, all of which involve predicting a specific numerical value. AWS Machine Learning services like Amazon SageMaker provide robust support for implementing and deploying linear regression models.

Example: Predicting the future price of a stock based on historical data, trading volume, and economic indicators. Another example is predicting the sales of a product in the next quarter based on past sales, marketing spend, and seasonal trends. Both scenarios aim to predict a continuous numerical value, making linear regression a suitable choice.

Need the Full Exam Simulator?

Practice the complete question bank in a realistic, timed environment with advanced tracking.

Access Full CertoMetrics Engine →

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top