Courseiva

AWS Certified Machine Learning Specialty MLS-C01 (MLS-C01) — Questions 16511672

1672 questions total · 23pages · All types, answers revealed

Page 22

Page 23 of 23

1651
MCQhard

A team is building a model to predict customer churn. They have 50 features, including categorical variables with high cardinality (e.g., zip code with 10,000 unique values). Which feature engineering technique is most appropriate?

A.Binning zip codes into regions
B.Target encoding
C.Label encoding
D.One-hot encoding
AnswerB

Target encoding condenses high cardinality into one numeric feature.

Why this answer

Target encoding replaces each category with the mean of the target variable, which handles high cardinality well. Option A (binning) reduces cardinality but loses information. Option B is correct because target encoding is specifically designed for high-cardinality categorical features.

Option C (label encoding) implies ordinality and can introduce misleading relationships. Option D (one-hot encoding) would create 10,000 binary columns, causing high dimensionality.

1652
MCQhard

A data scientist is analyzing a dataset with 1 million rows and 50 features. The scientist wants to detect outliers in a numerical feature 'transaction_amount' which has a long right tail. The scientist suspects that outliers are due to data entry errors and should be removed. Which outlier detection method is MOST robust for this scenario?

A.Interquartile range (IQR) with multiplier 1.5
B.Mahalanobis distance
C.Z-score with threshold 3
D.DBSCAN clustering
AnswerA

IQR method is non-parametric and robust to skewness.

Why this answer

The IQR method (Option A) is the most robust for detecting outliers in the 'transaction_amount' feature because it is based on quartiles and does not assume any underlying distribution, making it resistant to skew and extreme values. Z-score (Option C) is inappropriate because it assumes a normal distribution, which the long right tail violates. Mahalanobis distance (Option B) assumes multivariate normality and is not suited for univariate outlier detection.

DBSCAN (Option D) is computationally expensive on 1 million rows and is designed for density-based clustering, not for univariate outlier detection.

1653
MCQmedium

A machine learning engineer is building a pipeline using Amazon SageMaker Pipelines. The pipeline has multiple steps including data preprocessing, training, and evaluation. Which statement about SageMaker Pipelines is correct?

A.Steps in a pipeline must run sequentially.
B.Pipelines support caching of step outputs.
C.Pipelines can only use built-in algorithms.
D.Pipelines cannot have conditional branches.
AnswerB

Caching speeds up re-runs.

Why this answer

SageMaker Pipelines supports output caching, which allows step outputs to be reused when the step configuration and inputs remain unchanged. This caching mechanism reduces execution time and cost by skipping redundant computations for steps like data preprocessing or training when their parameters have not changed.

Exam trap

The trap here is that candidates often assume pipelines are strictly sequential (like traditional scripts) and overlook SageMaker's support for parallelism, custom code, and conditional logic, leading them to select option A or D.

How to eliminate wrong answers

Option A is wrong because SageMaker Pipelines supports parallel execution of independent steps, not strictly sequential execution. Option C is wrong because pipelines can use custom algorithms, scripts, and containers in addition to built-in algorithms. Option D is wrong because SageMaker Pipelines supports conditional branching via the `ConditionStep`, allowing different execution paths based on evaluation metrics or other criteria.

1654
MCQmedium

A data scientist is training a deep learning model on a GPU instance. The training loss is decreasing, but the validation loss starts increasing after a few epochs. Which action should the data scientist take to address this?

A.Reduce the batch size
B.Implement early stopping
C.Increase the learning rate
D.Add more layers to the model
AnswerB

Early stopping halts training when validation loss increases.

Why this answer

Early stopping monitors validation loss and stops training when it starts to increase, which directly addresses overfitting. Option A (reduce batch size) is not the best action; while it can affect training dynamics, it does not directly prevent validation loss increase due to overfitting. Option C (increase learning rate) is incorrect as it may cause the model to diverge or overshoot optimal minima.

Option D (add more layers) is incorrect because adding layers increases model complexity, which typically worsens overfitting.

1655
MCQeasy

A company is using Amazon SageMaker to train a linear learner model for predicting customer lifetime value. The target variable is right-skewed with a long tail. The data scientist applies a log transformation to the target variable and trains the model. The model achieves a low root mean squared error (RMSE) on the log scale. However, when the predictions are exponentiated back to the original scale, the RMSE is much higher. Which step should the data scientist take to improve the model's performance on the original scale?

A.Increase the regularization strength
B.Remove outliers from the training data
C.Use a loss function that models the original distribution, such as Poisson or Tweedie
D.Use a deep learning model instead of linear learner
AnswerC

These loss functions handle skewed distributions better.

Why this answer

Using a loss function like Poisson or Tweedie directly models the non-negative, skewed distribution of the target variable in its original scale, which avoids the bias introduced by log transformation when predicting on the original scale. Option A (increase regularization) may not address the scale mismatch. Option B (remove outliers) could discard valuable data.

Option D (use a deep learning model) might not solve the fundamental issue of loss function selection.

1656
Multi-Selecthard

Which THREE of the following are valid strategies to reduce overfitting in a deep neural network? (Choose 3)

Select 3 answers
A.Increase the number of layers.
B.Use early stopping.
C.Increase the learning rate.
D.Add L2 regularization to the loss function.
E.Use dropout layers.
AnswersB, D, E

Early stopping prevents overfitting.

Why this answer

Early stopping halts training when validation performance degrades, preventing overfitting. Option D is correct because L2 regularization adds a penalty on large weights, discouraging complexity. Option E is correct because dropout randomly drops neurons during training, reducing co-adaptation.

Option A is wrong because adding more layers increases model capacity, which exacerbates overfitting. Option C is wrong because a higher learning rate can cause the loss to diverge and does not directly address overfitting.

1657
MCQeasy

A machine learning engineer is building a pipeline to preprocess data and train a model using Amazon SageMaker. The data is stored in Amazon S3 and the preprocessing step is computationally intensive. The engineer wants to minimize costs while ensuring that the preprocessing step does not fail due to instance termination. Which instance type should be used for the preprocessing step?

A.Reserved instances
B.On-demand instances
C.A larger instance type to speed up processing
D.Spot instances
AnswerB

On-demand instances are reliable and not terminated, ensuring the step completes.

Why this answer

On-demand instances (Option B) are the correct choice because they provide reliable, non-interruptible compute capacity for the preprocessing step. Spot instances can be terminated at any time (with a 2-minute warning) when AWS reclaims capacity, which would cause the computationally intensive preprocessing to fail. Reserved instances require a 1- or 3-year commitment and are not cost-effective for a single preprocessing job that may not run continuously.

Exam trap

A common misconception in AWS is that Spot instances are always the cheapest option and should be used for all cost-sensitive workloads, ignoring the risk of interruption for non-fault-tolerant preprocessing steps.

How to eliminate wrong answers

Option A is wrong because Reserved instances require a long-term commitment (1 or 3 years) and are designed for steady-state workloads, not for a single preprocessing job where you want to minimize costs without upfront payment. Option C is wrong because using a larger instance type may speed up processing but does not address the core requirement of preventing failure due to instance termination; it also increases cost per hour. Option D is wrong because Spot instances can be reclaimed by AWS with a 2-minute termination notice when capacity is needed elsewhere, making them unsuitable for a computationally intensive preprocessing step that must not fail due to interruption.

1658
MCQhard

Refer to the exhibit. A data scientist runs the AWS CLI command shown to explore the contents of an S3 bucket. The command returns an empty array. However, the data scientist knows there are objects larger than 1000 bytes in the bucket. What is the most likely reason for the empty result?

A.The query syntax is incorrect; backticks should not be used
B.The command should use list-objects instead of list-objects-v2
C.The --query parameter is not supported by list-objects-v2
D.The AWS CLI is not configured with the correct region for the bucket
AnswerD

If the bucket is in a different region, the command returns no results.

Why this answer

The command syntax is correct: `--query 'Contents[?Size > `1000`]'` uses backticks for the numeric literal as per JMESPath. The empty result indicates the CLI could not find matching objects. Since the data scientist knows objects larger than 1000 bytes exist, the most likely cause is that the CLI is configured with a default region different from the bucket's region.

Running the command without an explicit `--region` parameter causes it to query the bucket in the wrong region, returning no results. Option A is incorrect because the backticks are valid. Option B is incorrect because `list-objects-v2` supports `--query`.

Option C is incorrect because `--query` is supported. Option D is correct because a region mismatch would cause the CLI to look for the bucket in the wrong location, resulting in an empty array even though the bucket contains objects.

1659
Multi-Selectmedium

Which TWO steps are required to set up cross-account access to an Amazon S3 data lake for AWS Glue jobs running in a different AWS account? (Choose two.)

Select 2 answers
A.Add a bucket policy to the S3 bucket that grants access to the Glue service role from the other account.
B.Create an IAM role in the second account that the Glue job can assume, with permissions to read from the S3 bucket.
C.Create a cross-account Glue crawler in the source account.
D.Set up VPC peering between the two accounts' VPCs.
E.Ensure both accounts are in the same AWS organization.
AnswersA, B

Correct: Bucket policy allows cross-account access.

Why this answer

An S3 bucket policy can grant cross-account access by specifying the AWS account ID of the second account as the principal, allowing the Glue service role from that account to read objects. This is a standard method for delegating access to S3 resources across accounts without requiring IAM roles in the source account.

Exam trap

The trap here is that candidates often confuse network-level connectivity (VPC peering) with IAM-level authorization, or assume that cross-account Glue crawlers are a built-in feature, when in fact the crawler must be in the same account as the data lake or use an assumed role with cross-account permissions.

1660
Drag & Dropmedium

Drag and drop the steps to train a model using Amazon SageMaker built-in algorithm in the correct order.

Drag steps to the numbered slots on the right, or tap a step then tap a slot.

Steps
Order
1Step 1
2Step 2
3Step 3
4Step 4

Why this order

Training involves data preparation, job creation, algorithm selection, input/output paths, and execution.

1661
Multi-Selecteasy

Which TWO of the following are appropriate use cases for using Amazon SageMaker BlazingText? (Choose 2)

Select 2 answers
A.Text classification using supervised learning.
B.Time series forecasting.
C.Learning word embeddings from a large text corpus.
D.Classifying images.
E.Sequence-to-sequence translation.
AnswersA, C

BlazingText has supervised mode.

Why this answer

Amazon SageMaker BlazingText supports text classification using supervised learning. Option C is correct because BlazingText can learn word embeddings (e.g., Word2Vec) from large text corpora. Option B is incorrect because time series forecasting is not a capability of BlazingText; it is suited for NLP tasks.

Option D is incorrect because BlazingText does not support image classification—that would require a different service or algorithm. Option E is incorrect because sequence-to-sequence translation is not supported by BlazingText; it is designed for word-level embeddings and text classification.

1662
MCQmedium

A company is building a recommendation system for an e-commerce platform. The data includes user-item interactions and features such as user demographics and item categories. Which algorithm would be most appropriate for generating personalized recommendations?

A.XGBoost
B.Factorization Machines
C.k-means clustering
D.Principal Component Analysis (PCA)
AnswerB

Factorization Machines model pairwise feature interactions and work well with sparse data, making them suitable for recommendation systems.

Why this answer

Factorization Machines (FM) are specifically designed for recommendation tasks with sparse, high-dimensional data like user-item interactions. They model pairwise feature interactions (e.g., user demographics × item categories) using factorized parameters, enabling personalized recommendations even when many user-item pairs are unobserved. This makes FM far more effective than tree-based or clustering methods for collaborative filtering and feature-rich recommendation scenarios.

Exam trap

The MLS-C01 exam often tests whether candidates confuse general-purpose ML algorithms (like XGBoost or clustering) with specialized recommendation algorithms, expecting you to recognize that factorization machines are the only option designed for sparse interaction data and feature crosses.

How to eliminate wrong answers

Option A (XGBoost) is wrong because it is a tree-based ensemble method that struggles with sparse, high-cardinality categorical features common in recommendation data; it cannot efficiently learn latent interaction patterns between users and items without extensive feature engineering. Option C (k-means clustering) is wrong because it is an unsupervised clustering algorithm that groups users or items into clusters, but it cannot generate personalized recommendations that account for individual user-item interactions or feature crosses. Option D (PCA) is wrong because it is a dimensionality reduction technique that transforms features into uncorrelated principal components, losing interpretability and failing to model the pairwise feature interactions needed for personalized recommendations.

1663
Multi-Selectmedium

A data engineer needs to design a data ingestion pipeline that ingests data from a MySQL database hosted on-premises into Amazon S3 for analytics. The pipeline must capture change data (CDC) and run continuously with low latency. Which two services should the data engineer use?

Select 2 answers
A.AWS Database Migration Service (DMS) with ongoing replication.
B.Amazon S3 as the target endpoint for DMS.
C.Amazon AppFlow.
D.AWS Glue ETL jobs scheduled at regular intervals.
E.Amazon Kinesis Data Streams.
AnswersA, B

DMS supports CDC and can write changes to S3 continuously.

Why this answer

AWS Database Migration Service (DMS) with ongoing replication can continuously capture changes from on-premises MySQL using Change Data Capture (CDC). Amazon S3 can be configured as the target endpoint for DMS, allowing the CDC data to be written directly to S3 with low latency. Option C (Amazon AppFlow) is designed for SaaS applications, not on-premises databases.

Option D (AWS Glue ETL) is batch-oriented and not suitable for low-latency continuous ingestion. Option E (Amazon Kinesis Data Streams) is not required because DMS can directly write to S3.

1664
Multi-Selectmedium

A data engineering team is designing a data lake on AWS. They need to store raw data in S3 and allow multiple analytics services to query the data. Which service can be used to catalog and provide schema information for the data?

Select 1 answer
A.AWS Glue Data Catalog
B.Amazon Kinesis Data Streams
C.Amazon RDS
D.Amazon DynamoDB
E.Amazon Athena
AnswersA

Glue Data Catalog stores metadata and schemas.

Why this answer

AWS Glue Data Catalog is a fully managed metadata repository that stores table definitions, schema information, and partition details for data in S3. Amazon Athena, while it can query data in S3 using SQL, does not provide its own catalog; it relies on the Glue Data Catalog for schema information. Therefore, only AWS Glue Data Catalog directly catalogs and provides schema information.

Exam trap

The trap is that Amazon Athena can create and query tables using DDL statements, leading candidates to think it serves as a catalog. However, Athena stores its table definitions in the Glue Data Catalog, making the Data Catalog the actual schema repository. Thus, only AWS Glue Data Catalog is the correct service for cataloging and providing schema information.

1665
MCQhard

A data scientist is performing EDA on a large dataset (10 TB) stored in S3. They need to compute summary statistics for each column. Which approach is most cost-effective and efficient?

A.Use an AWS Glue ETL job with PySpark to compute statistics
B.Use Amazon Athena with SQL queries
C.Download the dataset to an Amazon SageMaker Studio notebook and use pandas
D.Launch an Amazon EMR cluster and use Spark SQL
AnswerB

Athena is serverless, cost-effective, and efficient for ad-hoc queries.

Why this answer

Amazon Athena is a serverless query service that allows you to run SQL queries directly on data stored in S3, charging only for the data scanned per query. This makes it highly cost-effective and efficient for computing summary statistics on large datasets without needing to provision or manage infrastructure. Option A is wrong because AWS Glue ETL jobs with PySpark have startup overhead and are better suited for complex data transformation tasks rather than simple ad-hoc analysis.

Option C is wrong because downloading 10 TB to a SageMaker Studio notebook incurs high data transfer costs and requires substantial local storage, which is neither efficient nor cost-effective. Option D is wrong because launching an Amazon EMR cluster involves provisioning and managing compute resources, leading to higher costs and complexity for a straightforward statistical analysis that Athena can handle more simply.

1666
MCQhard

Refer to the exhibit. A data scientist is trying to create a SageMaker training job but receives an access denied error. The IAM policy shown is attached to their role. What is the most likely reason for the error?

A.The policy only allows CreateTrainingJob when the training job status is 'Failed', which is never true initially
B.The Action is not allowed because 'CreateTrainingJob' is misspelled
C.There is an explicit deny in another policy
D.The Resource is set to '*' which does not include the specific training job ARN
AnswerA

Condition prevents creation.

Why this answer

The IAM policy uses a `Condition` block with `sagemaker:TrainingJobStatus` set to `Failed`. When a `CreateTrainingJob` API call is made, the training job status is not yet set (it is `Creating` or `InProgress`), so the condition evaluates to false, and the request is denied. The policy only grants permission when the status equals `Failed`, which never occurs at creation time.

Exam trap

The MLS-C01 exam often tests the nuance that IAM condition keys like `sagemaker:TrainingJobStatus` are evaluated against the current state of the resource at the time of the API call, and candidates mistakenly assume a wildcard resource or a missing action is the issue rather than a condition that never matches.

How to eliminate wrong answers

Option B is wrong because 'CreateTrainingJob' is the correct AWS API action name; there is no misspelling in the policy. Option C is wrong because while an explicit deny in another policy could cause an access denied error, the question asks for the 'most likely' reason, and the given policy's condition is a direct and obvious cause. Option D is wrong because the `Resource` element set to `'*'` in a SageMaker training job policy actually covers all training job ARNs, so it is not the source of the denial.

1667
MCQhard

A machine learning team is analyzing feature importance in a dataset with many categorical features. They plan to use a tree-based model. Which encoding method should they use to handle high-cardinality categorical features without creating too many dummy variables?

A.One-hot encoding
B.Label encoding
C.Target encoding
D.Frequency encoding
AnswerC

Target encoding replaces categories with the target mean, preserving information without increasing dimensionality.

Why this answer

Target encoding replaces categories with the mean of the target, which is efficient and works well with tree models. Option A is wrong because one-hot encoding creates many columns for high cardinality. Option B is wrong because label encoding imposes ordinality.

Option D is wrong because frequency encoding may not capture predictive information.

1668
MCQmedium

A company is using AWS Glue to catalog metadata from various data sources. The crawler is configured to run daily. However, the catalog is not reflecting new partitions added to an S3 bucket during the day. What is the MOST likely cause?

A.The S3 bucket has insufficient permissions for the Glue crawler
B.The table schema has changed and the crawler does not update it
C.The crawler is not scheduled frequently enough to capture changes
D.The data format is not supported by AWS Glue
AnswerC

The crawler runs once a day, so it misses partitions added between runs.

Why this answer

The crawler is configured to run daily, but new partitions are being added to the S3 bucket throughout the day. Since the crawler only runs once per day, it will not detect and catalog those new partitions until its next scheduled run. To capture changes more frequently, the crawler schedule should be increased or an event-driven trigger (e.g., using Amazon S3 Events and AWS Lambda) should be implemented.

Exam trap

The trap here is that candidates may assume the crawler automatically detects all changes in real time, but AWS Glue crawlers are batch-oriented and only discover new partitions during a crawl run, so scheduling frequency is critical.

How to eliminate wrong answers

Option A is wrong because if the S3 bucket had insufficient permissions for the Glue crawler, the crawler would fail entirely or produce errors, not selectively miss new partitions while still cataloging existing data. Option B is wrong because the question states that new partitions are not being reflected, not that the table schema has changed; Glue crawlers can update schemas by default unless configured otherwise, and schema changes would cause different symptoms (e.g., type mismatches). Option D is wrong because AWS Glue supports a wide range of data formats (CSV, JSON, Parquet, Avro, ORC, etc.), and if the format were unsupported, the crawler would fail to read the data entirely, not just miss new partitions.

1669
MCQhard

A data scientist is training a neural network using a custom loss function. The training process converges, but the model's performance on the validation set is poor. The data scientist suspects that the model is overfitting. Which action should the data scientist take to diagnose overfitting?

A.Plot the training and validation loss over epochs
B.Add more layers to the network
C.Increase the learning rate
D.Compute the confusion matrix on the training set
AnswerA

If training loss decreases while validation loss increases, it indicates overfitting.

Why this answer

Plotting the training and validation loss over epochs is the standard diagnostic technique for detecting overfitting. If the training loss continues to decrease while the validation loss plateaus or increases, it indicates that the model is memorizing the training data rather than generalizing. This visual comparison directly confirms overfitting, allowing the data scientist to take corrective action such as regularization or early stopping.

Exam trap

The MLS-C01 exam often tests the misconception that improving training performance (e.g., by adding layers or increasing learning rate) is a valid diagnostic step, when in fact the correct approach is to compare training and validation metrics to detect overfitting.

How to eliminate wrong answers

Option B is wrong because adding more layers increases model capacity, which typically exacerbates overfitting rather than diagnosing it. Option C is wrong because increasing the learning rate can cause training instability or divergence, but it does not help identify whether overfitting is occurring. Option D is wrong because computing the confusion matrix on the training set only shows performance on training data, which is already expected to be high when overfitting; it provides no comparison to validation performance and thus cannot diagnose overfitting.

1670
MCQhard

A data scientist is using Amazon SageMaker to train a TensorFlow model on a dataset that includes sensitive personal information (PII). The data is stored in Amazon S3 with server-side encryption using AWS KMS (SSE-KMS). The training job fails with an Access Denied error when trying to read from S3. The data scientist has already verified that the SageMaker execution role has s3:GetObject permissions on the S3 bucket. What additional configuration is needed?

A.Add kms:Decrypt permission to the SageMaker execution role.
B.Add kms:Encrypt permission to the SageMaker execution role.
C.Add a bucket policy that grants s3:GetObject to the SageMaker role.
D.Configure a VPC endpoint for S3 and attach a policy.
AnswerA

SSE-KMS requires decrypt permission to read objects.

Why this answer

When S3 objects are encrypted with SSE-KMS, the SageMaker execution role must have the kms:Decrypt permission to decrypt the data during training. Even though the role has s3:GetObject access, the KMS key policy or the role's IAM policy must explicitly allow decryption of the KMS key used for server-side encryption. Without this, SageMaker cannot read the encrypted objects, resulting in an Access Denied error.

Exam trap

The trap here is that candidates often focus solely on S3 permissions and overlook the fact that SSE-KMS introduces a separate KMS authorization layer, so even with full S3 access, the role still needs explicit kms:Decrypt to read encrypted objects.

How to eliminate wrong answers

Option B is wrong because kms:Encrypt is used for writing or uploading encrypted data, not for reading; the training job only needs to decrypt the existing data. Option C is wrong because the data scientist has already verified that s3:GetObject permissions are in place, so adding another bucket policy for the same action is redundant and does not address the KMS encryption requirement. Option D is wrong because a VPC endpoint for S3 is used to route traffic privately within a VPC, but it does not grant KMS decryption permissions; the Access Denied error stems from missing KMS permissions, not network connectivity.

1671
MCQeasy

A data engineer runs the AWS CLI command above to inspect a file in S3. They need to determine if the file was modified after a Glue ETL job processed it. What additional information could they obtain from this command?

A.The object's content type.
B.The object's storage class.
C.The object's last modified timestamp.
D.The object's ETag.
AnswerC

The LastModified field indicates when the object was last modified.

Why this answer

The AWS CLI command `aws s3api head-object --bucket my-bucket --key my-key` returns metadata about an S3 object without downloading it. The `LastModified` field in the response provides the exact timestamp of the last modification, which can be compared to the Glue ETL job's execution time to determine if the file was modified after processing. This is the only field that directly answers the question about modification timing.

Exam trap

The trap here is that candidates may confuse the `ETag` (a content hash) with a modification timestamp, or assume that `head-object` returns only basic metadata like size and type, overlooking the `LastModified` field that directly answers the question.

How to eliminate wrong answers

Option A is wrong because the `ContentType` field indicates the MIME type (e.g., text/csv) but has no relation to modification timing. Option B is wrong because the `StorageClass` field (e.g., STANDARD, GLACIER) describes the storage tier, not when the object was last changed. Option D is wrong because the `ETag` field is an MD5 hash (or a hash of concatenated parts for multipart uploads) used for integrity checks, not for tracking modification timestamps.

1672
MCQmedium

A data analyst is performing exploratory data analysis on a dataset with 100 features. The analyst wants to identify which features contribute most to the variance in the data. Which technique should the analyst use?

A.K-means clustering
B.Principal Component Analysis (PCA)
C.t-Distributed Stochastic Neighbor Embedding (t-SNE)
D.Linear Discriminant Analysis (LDA)
AnswerB

PCA decomposes the data into components that capture the maximum variance.

Why this answer

Principal Component Analysis (PCA) is the correct technique because it is an unsupervised dimensionality reduction method that identifies the principal components, which are linear combinations of the original features that capture the maximum variance in the data. Option A (K-means) is incorrect because it is a clustering algorithm that groups data points, not used for analyzing feature variance. Option C (t-SNE) is incorrect because it is primarily used for visualizing high-dimensional data in lower dimensions but does not provide explicit variance contributions.

Option D (LDA) is incorrect because it is a supervised method that requires class labels and aims to maximize class separability, not variance.

Page 22

Page 23 of 23