A company wants to use machine learning (ML) to improve its customer churn prediction
model. The company stores data in an Amazon Redshift data warehouse.
A data science team wants to use Amazon Redshift machine learning (Amazon Redshift
ML) to build a model and run predictions for new data directly within the data warehouse.
Which combination of steps should the company take to use Amazon Redshift ML to meet
these requirements? (Select THREE.)
Show answerHide answer
Correct answer: A, C, FDefine the feature variables and target variable for the churn prediction model.
Write a CREATE MODEL SQL statement to create a model.
Use the SQL prediction function to run predictions,
Explanation
Explanation: Amazon Redshift ML enables in-database machine learning model creation
and predictions, allowing data scientists to leverage Redshift for model training without
needing to export data.
To create and run a model for customer churn prediction in Amazon Redshift ML:
Define the feature variables and target variable: Identify the columns to use as
features (predictors) and the target variable (outcome) for the churn prediction
model.
Create the model: Write a CREATE MODEL SQL statement, which trains the
model using Amazon Redshift’s integration with Amazon SageMaker and stores
the model directly in Redshift.
Run predictions: Use the SQL PREDICT function to generate predictions on new
data directly within Redshift.
Options B, D, and E are not required as Redshift ML handles model creation and prediction
without manual data export to Amazon S3 or additional Spectrum integration.
Question 22Choose 1
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?
Show answerHide answer
Correct answer: BInitialize the model with pre-trained weights in all layers and replace the last fully
connected layer.
Explanation
Explanation: Transfer learning is a technique that allows us to use a model trained for a
certain task as a starting point for a machine learning model for a different task. For image
classification, a common practice is to use a pre-trained model that was trained on a large
and general dataset, such as ImageNet, and then customize it for the specific task. One
way to customize the model is to replace the last fully connected layer, which is responsible
for the final classification, with a new layer that has the same number of units as the
number of classes in the new task. This way, the model can leverage the features learned
by the previous layers, which are generic and useful for many image recognition tasks, and
learn to map them to the new classes. The new layer can be initialized with random
weights, and the rest of the model can be initialized with the pre-trained weights. This
method is also known as feature extraction, as it extracts meaningful features from the pretrained
model and uses them for the new task.
Question 23Choose 1
A company wants to create a data repository in the AWS Cloud for machine learning (ML)
projects. The company wants to use AWS to perform complete ML lifecycles and wants to
use Amazon S3 for the data storage. All of the company’s data currently resides on
premises and is 40 in size.
The company wants a solution that can transfer and automatically update data between the
on-premises object storage and Amazon S3. The solution must support encryption,
scheduling, monitoring, and data integrity validation.
Which solution meets these requirements?
Show answerHide answer
Correct answer: CUse AWS DataSync to make an initial copy of the entire dataset. Schedule subsequent
incremental transfers of changing data until the final cutover from on premises to AWS.
Explanation
Explanation: The best solution to meet the requirements of the company is to use AWS
DataSync to make an initial copy of the entire dataset, and schedule subsequent
incremental transfers of changing data until the final cutover from on premises to AWS.
This is because:
AWS DataSync is an online data movement and discovery service that simplifies
data migration and helps you quickly, easily, and securely transfer your file or
object data to, from, and between AWS storage services 1. AWS DataSync can
copy data between on-premises object storage and Amazon S3, and also supports
encryption, scheduling, monitoring, and data integrity validation 1.
AWS DataSync can make an initial copy of the entire dataset by using a DataSync
agent, which is a software appliance that connects to your on-premises storage
and manages the data transfer to AWS 2. The DataSync agent can be deployed
as a virtual machine (VM) on your existing hypervisor, or as an Amazon EC2
instance in your AWS account 2.
AWS DataSync can schedule subsequent incremental transfers of changing data
by using a task, which is a configuration that specifies the source and destination
locations, the options for the transfer, and the schedule for the transfer 3. You can
create a task to run once or on a recurring schedule, and you can also use filters
to include or exclude specific files or objects based on their names or prefixes 3.
AWS DataSync can perform the final cutover from on premises to AWS by using a
sync task, which is a type of task that synchronizes the data in the source and
destination locations 4. A sync task transfers only the data that has changed or
that doesn’t exist in the destination, and also deletes any files or objects from the
destination that were deleted from the source since the last sync 4.
Therefore, by using AWS DataSync, the company can create a data repository in the AWS
Cloud for machine learning projects, and use Amazon S3 for the data storage, while
meeting the requirements of encryption, scheduling, monitoring, and data integrity
validation.
Question 24Choose 1
While working on a neural network project, a Machine Learning Specialist discovers thai
some features in the data have very high magnitude resulting in this data being weighted
more in the cost function What should the Specialist do to ensure better convergence
during backpropagation?
Show answerHide answer
Correct answer: BData normalization
Explanation
Explanation: Data normalization is a data preprocessing technique that scales the
features to a common range, such as [0, 1] or [-1, 1]. This helps reduce the impact of
features with high magnitude on the cost function and improves the convergence during
backpropagation. Data normalization can be done using different methods, such as minmax
scaling, z-score standardization, or unit vector normalization. Data normalization is
different from dimensionality reduction, which reduces the number of features; model
regularization, which adds a penalty term to the cost function to prevent overfitting; and
data augmentation, which increases the amount of data by creating synthetic samples.
Question 25Choose 1
A manufacturing company has a production line with sensors that collect hundreds of
quality metrics. The company has stored sensor data and manual inspection results in a
data lake for several months. To automate quality control, the machine learning team must
build an automated mechanism that determines whether the produced goods are good
quality, replacement market quality, or scrap quality based on the manual inspection
results.
Which modeling approach will deliver the MOST accurate prediction of product quality?
Show answerHide answer
Correct answer: DA convolutional neural network (CNN) and ResNet
Explanation
Explanation: A convolutional neural network (CNN) is a type of deep learning model that
can learn to extract features from images and perform tasks such as classification,
segmentation, and detection1. ResNet is a popular CNN architecture that uses residual
connections to overcome the problem of vanishing gradients and enable very deep
networks2. For the task of predicting product quality based on sensor data, a CNN and
ResNet approach can leverage the spatial structure of the data and learn complex patterns
that distinguish different quality levels.
Question 26Choose 3
An Amazon SageMaker notebook instance is launched into Amazon VPC The SageMaker
notebook references data contained in an Amazon S3 bucket in another account The
bucket is encrypted using SSE-KMS The instance returns an access denied error when
trying to access data in Amazon S3.
Which of the following are required to access the bucket and avoid the access denied
error? (Select THREE)
Show answerHide answer
Correct answer: A, B, CAn AWS KMS key policy that allows access to the customer master key (CMK)A SageMaker notebook security group that allows access to Amazon S3An 1AM role that allows access to the specific S3 bucket
Explanation
Explanation: To access an Amazon S3 bucket in another account that is encrypted using
SSE-KMS, the following are required:
A. An AWS KMS key policy that allows access to the customer master key (CMK).
The CMK is the encryption key that is used to encrypt and decrypt the data in the
S3 bucket. The KMS key policy defines who can use and manage the CMK. To
allow access to the CMK from another account, the key policy must include a
statement that grants the necessary permissions (such as kms:Decrypt) to the
principal from the other account (such as the SageMaker notebook IAM role).
B. A SageMaker notebook security group that allows access to Amazon S3. A
security group is a virtual firewall that controls the inbound and outbound traffic for
the SageMaker notebook instance. To allow the notebook instance to access the
S3 bucket, the security group must have a rule that allows outbound traffic to the
S3 endpoint on port 443 (HTTPS).
C. An IAM role that allows access to the specific S3 bucket. An IAM role is an
identity that can be assumed by the SageMaker notebook instance to access AWS
resources. The IAM role must have a policy that grants the necessary permissions
(such as s3:GetObject) to access the specific S3 bucket. The policy must also
include a condition that allows access to the CMK in the other account.
The following are not required or correct:
D. A permissive S3 bucket policy. A bucket policy is a resource-based policy that
defines who can access the S3 bucket and what actions they can perform. A
permissive bucket policy is not required and not recommended, as it can expose
the bucket to unauthorized access. A bucket policy should follow the principle of
least privilege and grant the minimum permissions necessary to the specific
principals that need access.
E. An S3 bucket owner that matches the notebook owner. The S3 bucket owner
and the notebook owner do not need to match, as long as the bucket owner grants
cross-account access to the notebook owner through the KMS key policy and the
bucket policy (if applicable).
F. A SegaMaker notebook subnet ACL that allow traffic to Amazon S3. A subnet
ACL is a network access control list that acts as an optional layer of security for
the SageMaker notebook instance’s subnet. A subnet ACL is not required to
access the S3 bucket, as the security group is sufficient to control the traffic.
However, if a subnet ACL is used, it must not block the traffic to the S3 endpoint.
Question 27Choose 1
A Machine Learning Specialist is attempting to build a linear regression model. Given the displayed residual plot only, what is the MOST likely problem with the model?
Show answerHide answer
Correct answer: ALinear regression is inappropriate. The residuals do not have constant variance.
Explanation
Explanation: A residual plot is a type of plot that displays the values of a predictor variable
in a regression model along the x-axis and the values of the residuals along the y-axis. This
plot is used to assess whether or not the residuals in a regression model are normally
distributed and whether or not they exhibit heteroscedasticity. Heteroscedasticity means
that the variance of the residuals is not constant across different values of the predictor
variable. This violates one of the assumptions of linear regression and can lead to biased
estimates and unreliable predictions. The displayed residual plot shows a clear pattern of
heteroscedasticity, as the residuals spread out as the fitted values increase. This indicates
that linear regression is inappropriate for this data and a different model should be used.
Question 28Choose 1
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?
Show answerHide answer
Correct answer: BCreate an appropriate pronunciation lexicon.
Explanation
Explanation: A pronunciation lexicon is a file that defines how words or phrases should be
pronounced by Amazon Polly. A lexicon can help customize the speech output for words
that are uncommon, foreign, or have multiple pronunciations. A lexicon must conform to the
Pronunciation Lexicon Specification (PLS) standard and can be stored in an AWS region
using the Amazon Polly API. To use a lexicon for synthesizing speech, the lexicon name
must be specified in the SSML tag. For example, the following lexicon defines
how to pronounce the acronym W3C:
W3CWorld
Wide Web Consortium
To use this lexicon, the text input must include the following SSML tag: The W3C is an international community that develops open
standards to ensure the long-term growth of the Web.
Question 29Choose 2
A company's machine learning (ML) specialist is building a computer vision model to
classify 10 different traffic signs. The company has stored 100 images of each class in
Amazon S3, and the company has another 10.000 unlabeled images. All the images come
from dash cameras and are a size of 224 pixels * 224 pixels. After several training runs, the
model is overfitting on the training data.
Which actions should the ML specialist take to address this problem? (Select TWO.)
Show answerHide answer
Correct answer: C, EUse data augmentation to rotate and translate the labeled images.
Use the Amazon SageMaker k-nearest neighbors (k-NN) algorithm to label the
unlabeled images.
Explanation
Explanation:
Data augmentation is a technique to increase the size and diversity of the training
data by applying random transformations such as rotation, translation, scaling,
flipping, etc. This can help reduce overfitting and improve the generalization of the
model. Data augmentation can be done using the Amazon SageMaker image
classification algorithm, which supports various augmentation options such as
horizontal_flip, vertical_flip, rotate, brightness, contrast, etc1.
The Amazon SageMaker k-nearest neighbors (k-NN) algorithm is a supervised
learning algorithm that can be used to label unlabeled data based on the similarity
to the labeled data. The k-NN algorithm assigns a label to an unlabeled instance
by finding the k closest labeled instances in the feature space and taking a
majority vote among their labels. This can help increase the size and diversity of
the training data and reduce overfitting. The k-NN algorithm can be used with the
Amazon SageMaker image classification algorithm by extracting features from the
images using a pre-trained model and then applying the k-NN algorithm on the
feature vectors2.
Using Amazon SageMaker Ground Truth to label the unlabeled images is not a
good option because it is a manual and costly process that requires human
annotators. Moreover, it does not address the issue of overfitting on the existing
labeled data.
Using image preprocessing to transform the images into grayscale images is not a
good option because it reduces the amount of information and variation in the
images, which can degrade the performance of the model. Moreover, it does not
address the issue of overfitting on the existing labeled data.
Replacing the activation of the last layer with a sigmoid is not a good option
because it is not suitable for a multi-class classification problem. A sigmoid
activation function outputs a value between 0 and 1, which can be interpreted as a
probability of belonging to a single class. However, for a multi-class classification
problem, the output should be a vector of probabilities that sum up to 1, which can
be achieved by using a softmax activation function.
Question 30Choose 1
A company is building a demand forecasting model based on machine learning (ML). In the
development stage, an ML specialist uses an Amazon SageMaker notebook to perform
feature engineering during work hours that consumes low amounts of CPU and memory
resources. A data engineer uses the same notebook to perform data preprocessing once a
day on average that requires very high memory and completes in only 2 hours. The data
preprocessing is not configured to use GPU. All the processes are running well on an
ml.m5.4xlarge notebook instance.
The company receives an AWS Budgets alert that the billing for this month exceeds the
allocated budget.
Which solution will result in the MOST cost savings?
Show answerHide answer
Correct answer: CChange the notebook instance type to a smaller general-purpose instance. Stop the
notebook when it is not in use. Run data preprocessing on an ml. r5 instance with the same
memory size as the ml.m5.4xlarge instance by using Amazon SageMaker Processing.
Explanation
Explanation: The best solution to reduce the cost of the notebook instance and the data
preprocessing job is to change the notebook instance type to a smaller general-purpose
instance, stop the notebook when it is not in use, and run data preprocessing on an ml.r5
instance with the same memory size as the ml.m5.4xlarge instance by using Amazon
SageMaker Processing. This solution will result in the most cost savings because:
Changing the notebook instance type to a smaller general-purpose instance will
reduce the hourly cost of running the notebook, since the feature engineering
development does not require high CPU and memory resources. For example, an
ml.t3.medium instance costs $0.0464 per hour, while an ml.m5.4xlarge instance
costs $0.888 per hour1.
Stopping the notebook when it is not in use will also reduce the cost, since the
notebook will only incur charges when it is running. For example, if the notebook is
used for 8 hours per day, 5 days per week, then stopping it when it is not in use
will save about 76% of the monthly cost compared to leaving it running all the
time2.
Running data preprocessing on an ml.r5 instance with the same memory size as
the ml.m5.4xlarge instance by using Amazon SageMaker Processing will reduce
the cost of the data preprocessing job, since the ml.r5 instance is optimized for
memory-intensive workloads and has a lower cost per GB of memory than the
ml.m5 instance. For example, an ml.r5.4xlarge instance has 128 GB of memory
and costs $1.008 per hour, while an ml.m5.4xlarge instance has 64 GB of memory
and costs $0.888 per hour1.
Therefore, the ml.r5.4xlarge instance can process the
same amount of data in half the time and at a lower cost than the ml.m5.4xlarge
instance. Moreover, using Amazon SageMaker Processing will allow the data
preprocessing job to run on a separate, fully managed infrastructure that can be
scaled up or down as needed, without affecting the notebook instance.
The other options are not as effective as option C for the following reasons:
Option A is not optimal because changing the notebook instance type to a memory
optimized instance with the same vCPU number as the ml.m5.4xlarge instance
has will not reduce the cost of the notebook, since the memory optimized
instances have a higher cost per vCPU than the general-purpose instances. For
example, an ml.r5.4xlarge instance has 16 vCPUs and costs $1.008 per hour,
while an ml.m5.4xlarge instance has 16 vCPUs and costs $0.888 per hour1.
Moreover, running both data preprocessing and feature engineering development
on the same instance will not take advantage of the scalability and flexibility of
Amazon SageMaker Processing.
Option B is not suitable because running data preprocessing on a P3 instance type
with the same memory as the ml.m5.4xlarge instance by using Amazon
SageMaker Processing will not reduce the cost of the data preprocessing job,
since the P3 instance type is optimized for GPU-based workloads and has a
higher cost per GB of memory than the ml.m5 or ml.r5 instance types. For
example, an ml.p3.2xlarge instance has 61 GB of memory and costs $3.06 per
hour, while an ml.m5.4xlarge instance has 64 GB of memory and costs $0.888 per
hour1. Moreover, the data preprocessing job does not require GPU, so using a P3
instance type will be wasteful and inefficient.
Option D is not feasible because running data preprocessing on an R5 instance
with the same memory size as the ml.m5.4xlarge instance by using the Reserved
Instance option will not reduce the cost of the data preprocessing job, since the
Reserved Instance option requires a commitment to a consistent amount of usage
for a period of 1 or 3 years3. However, the data preprocessing job only runs once
a day on average and completes in only 2 hours, so it does not have a consistent
or predictable usage pattern. Therefore, using the Reserved Instance option will
not provide any cost savings and may incur additional charges for unused
capacity.
Full mock exam
Sit the MLS-C01 exam before exam day
Full-length mocks with the same number of questions and the same time limit as the real MLS-C01 exam. Every attempt draws a new set of questions from the full bank, so you can keep going until you pass comfortably.