A machine learning (ML) specialist needs to extract embedding vectors from a text series.
The goal is to provide a ready-to-ingest feature space for a data scientist to develop
downstream ML predictive models. The text consists of curated sentences in English. Many
sentences use similar words but in different contexts. There are questions and answers
among the sentences, and the embedding space must differentiate between them.
Which options can produce the required embedding vectors that capture word context and
sequential QA information? (Choose two.)
Show answerHide answer
Correct answer: B, EAmazon SageMaker BlazingText algorithm in Skip-gram mode
Combination of the Amazon SageMaker BlazingText algorithm in Batch Skip-gram mode
with a custom recurrent neural network (RNN)
Explanation
Explanation:
To capture word context and sequential QA information, the embedding vectors
need to consider both the order and the meaning of the words in the text.
Option B, Amazon SageMaker BlazingText algorithm in Skip-gram mode, is a valid
option because it can learn word embeddings that capture the semantic similarity
and syntactic relations between words based on their co-occurrence in a window
of words. Skip-gram mode can also handle rare words better than continuous bagof-
words (CBOW) mode1.
Option E, combination of the Amazon SageMaker BlazingText algorithm in Batch
Skip-gram mode with a custom recurrent neural network (RNN), is another valid
option because it can leverage the advantages of Skip-gram mode and also use
an RNN to model the sequential nature of the text. An RNN can capture the
temporal dependencies and long-term dependencies between words, which are
important for QA tasks2.
Option A, Amazon SageMaker seq2seq algorithm, is not a valid option because it
is designed for sequence-to-sequence tasks such as machine translation,
summarization, or chatbots. It does not produce embedding vectors for text series,
but rather generates an output sequence given an input sequence3.
Option C, Amazon SageMaker Object2Vec algorithm, is not a valid option because
it is designed for learning embeddings for pairs of objects, such as text-image,
text-text, or image-image. It does not produce embedding vectors for text series,
but rather learns a similarity function between pairs of objects4.
Option D, Amazon SageMaker BlazingText algorithm in continuous bag-of-words
(CBOW) mode, is not a valid option because it does not capture word context as
well as Skip-gram mode. CBOW mode predicts a word given its surrounding
words, while Skip-gram mode predicts the surrounding words given a
word. CBOW mode is faster and more suitable for frequent words, but Skip-gram
mode can learn more meaningful embeddings for rare words1.
Question 12Choose 1
For the given confusion matrix, what is the recall and precision of the model?
Show answerHide answer
Correct answer: CRecall = 0.92 Precision = 0.8
Explanation
Explanation: Recall and precision are two metrics that can be used to evaluate the
performance of a classification model. Recall is the ratio of true positives to the total
number of actual positives, which measures how well the model can identify all the relevant
cases. Precision is the ratio of true positives to the total number of predicted positives,
which measures how accurate the model is when it makes a positive prediction. Based on
the confusion matrix in the image, we can calculate the recall and precision as follows:
Recall = TP / (TP + FN) = 12 / (12 + 1) = 0.92
Precision = TP / (TP + FP) = 12 / (12 + 3) = 0.8
Where TP is the number of true positives, FN is the number of false negatives, and FP is
the number of false positives. Therefore, the recall and precision of the model are 0.92 and
0.8, respectively.
Question 13Choose 1
A company wants to predict the sale prices of houses based on available historical sales
data. The target
variable in the company’s dataset is the sale price. The features include parameters such
as the lot size, living
area measurements, non-living area measurements, number of bedrooms, number of
bathrooms, year built,
and postal code. The company wants to use multi-variable linear regression to predict
house sale prices.
Which step should a machine learning specialist take to remove features that are irrelevant
for the analysis
and reduce the model’s complexity?
Show answerHide answer
Correct answer: DRun a correlation check of all features against the target variable. Remove features with
low target variable correlation scores.
Explanation
Explanation: Feature selection is the process of reducing the number of input variables to
those that are most relevant for predicting the target variable. One way to do this is to run a
correlation check of all features against the target variable and remove features with low
target variable correlation scores. This means that these features have little or no linear
relationship with the target variable and are not useful for the prediction. This can reduce
the model’s complexity and improve its performance.
Question 14Choose 1
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?
Show answerHide answer
Correct answer: DDownload word embedding’s pre-trained on a large corpus.
Explanation
Explanation: Word embeddings are a type of dense representation of words, which
encode semantic meaning in a vector form. These embeddings are typically pre-trained on
a large corpus of text data, such as a large set of books, news articles, or web pages, and
capture the context in which words are used. Word embeddings can be used as features
for a nearest neighbor model, which can be used to find words used in similar contexts.
Downloading pre-trained word embeddings is a good way to get started quickly and
leverage the strengths of these representations, which have been optimized on a large
amount of data. This is likely to result in more accurate and reliable features than other
options like one-hot encoding, edit distance, or using Amazon Mechanical Turk to produce
synonyms.
Question 15Choose 1
A technology startup is using complex deep neural networks and GPU compute to
recommend the company’s products to its existing customers based upon each customer’s
habits and interactions. The solution currently pulls each dataset from an Amazon S3
bucket before loading the data into a TensorFlow model pulled from the company’s Git
repository that runs locally. This job then runs for several hours while continually outputting
its progress to the same S3 bucket. The job can be paused, restarted, and continued at
any time in the event of a failure, and is run from a central queue.
Senior managers are concerned about the complexity of the solution’s resource
management and the costs involved in repeating the process regularly. They ask for the
workload to be automated so it runs once a week, starting Monday and completing by the
close of business Friday.
Which architecture should be used to scale the solution at the lowest cost?
Show answerHide answer
Correct answer: AImplement the solution using AWS Deep Learning Containers and run the container as a
job using AWS Batch on a GPU-compatible Spot Instance
Explanation
Explanation: The best architecture to scale the solution at the lowest cost is to implement
the solution using AWS Deep Learning Containers and run the container as a job using
AWS Batch on a GPU-compatible Spot Instance. This option has the following advantages:
AWS Deep Learning Containers: These are Docker images that are pre-installed
and optimized with popular deep learning frameworks such as TensorFlow,
PyTorch, and MXNet. They can be easily deployed on Amazon EC2, Amazon
ECS, Amazon EKS, and AWS Fargate. They can also be integrated with AWS
Batch to run containerized batch jobs. Using AWS Deep Learning Containers can
simplify the setup and configuration of the deep learning environment and reduce
the complexity of the resource management.
AWS Batch: This is a fully managed service that enables you to run batch
computing workloads on AWS. You can define compute environments, job
queues, and job definitions to run your batch jobs. You can also use AWS Batch to
automatically provision compute resources based on the requirements of the batch
jobs. You can specify the type and quantity of the compute resources, such as
GPU instances, and the maximum price you are willing to pay for them. You can
also use AWS Batch to monitor the status and progress of your batch jobs and
handle any failures or interruptions.
GPU-compatible Spot Instance: This is an Amazon EC2 instance that uses a
spare compute capacity that is available at a lower price than the On-Demand
price. You can use Spot Instances to run your deep learning training jobs at a
lower cost, as long as you are flexible about when your instances run and how
long they run. You can also use Spot Instances with AWS Batch to automatically
launch and terminate instances based on the availability and price of the Spot
capacity. You can also use Spot Instances with Amazon EBS volumes to store
your datasets, checkpoints, and logs, and attach them to your instances when they
are launched. This way, you can preserve your data and resume your training
even if your instances are interrupted.
Question 16Choose 1
A company wants to conduct targeted marketing to sell solar panels to homeowners. The
company wants to use machine learning (ML) technologies to identify which houses
already have solar panels. The company has collected 8,000 satellite images as training
data and will use Amazon SageMaker Ground Truth to label the data.
The company has a small internal team that is working on the project. The internal team
has no ML expertise and no ML experience.
Which solution will meet these requirements with the LEAST amount of effort from the
internal team?
Show answerHide answer
Correct answer: ASet up a private workforce that consists of the internal team. Use the private workforce
and the SageMaker Ground Truth active learning feature to label the data. Use Amazon
Rekognition Custom Labels for model training and hosting.
Explanation
Explanation: The solution A will meet the requirements with the least amount of effort
from the internal team because it uses Amazon SageMaker Ground Truth and Amazon
Rekognition Custom Labels, which are fully managed services that can provide the desired
functionality. The solution A involves the following steps:
Set up a private workforce that consists of the internal team. Use the private
workforce and the SageMaker Ground Truth active learning feature to label the
data. Amazon SageMaker Ground Truth is a service that can create high-quality
training datasets for machine learning by using human labelers. A private
workforce is a group of labelers that the company can manage and control. The
internal team can use the private workforce to label the satellite images as having
solar panels or not. The SageMaker Ground Truth active learning feature can
reduce the labeling effort by using a machine learning model to automatically label
the easy examples and only send the difficult ones to the human labelers1.
Use Amazon Rekognition Custom Labels for model training and hosting. Amazon
Rekognition Custom Labels is a service that can train and deploy custom machine
learning models for image analysis. Amazon Rekognition Custom Labels can use
the labeled data from SageMaker Ground Truth to train a model that can detect
solar panels in satellite images. Amazon Rekognition Custom Labels can also host
the model and provide an API endpoint for inference2.
The other options are not suitable because:
Option B: Setting up a private workforce that consists of the internal team, using
the private workforce to label the data, and using Amazon Rekognition Custom
Labels for model training and hosting will incur more effort from the internal team
than using SageMaker Ground Truth active learning feature. The internal team will
have to label all the images manually, without the assistance of the machine
learning model that can automate some of the labeling tasks1.
Option C: Setting up a private workforce that consists of the internal team, using
the private workforce and the SageMaker Ground Truth active learning feature to
label the data, using the SageMaker Object Detection algorithm to train a model,
and using SageMaker batch transform for inference will incur more operational
overhead than using Amazon Rekognition Custom Labels. The company will have
to manage the SageMaker training job, the model artifact, and the batch transform
job. Moreover, SageMaker batch transform is not suitable for real-time inference,
as it processes the data in batches and stores the results in Amazon S33.
Option D: Setting up a public workforce, using the public workforce to label the
data, using the SageMaker Object Detection algorithm to train a model, and using
SageMaker batch transform for inference will incur more operational overhead and
cost than using a private workforce and Amazon Rekognition Custom Labels. A
public workforce is a group of labelers from Amazon Mechanical Turk, a
crowdsourcing marketplace. The company will have to pay the public workforce for
each labeling task, and it may not have full control over the quality and security of
the labeled data. The company will also have to manage the SageMaker training
job, the model artifact, and the batch transform job, as explained in option C4.
Question 17Choose 1
A data scientist is building a linear regression model. The scientist inspects the dataset and
notices that the mode of the distribution is lower than the median, and the median is lower
than the mean. Which data transformation will give the data scientist the ability to apply a linear regression
model?
Show answerHide answer
Correct answer: BLogarithmic transformation
Explanation
Explanation: A logarithmic transformation is a suitable data transformation for a linear
regression model when the data has a skewed distribution, such as when the mode is
lower than the median and the median is lower than the mean. A logarithmic transformation
can reduce the skewness and make the data more symmetric and normally distributed,
which are desirable properties for linear regression. A logarithmic transformation can also
reduce the effect of outliers and heteroscedasticity (unequal variance) in the data. An
exponential transformation would have the opposite effect of increasing the skewness and
making the data more asymmetric. A polynomial transformation may not be able to capture
the nonlinearity in the data and may introduce multicollinearity among the transformed
variables. A sinusoidal transformation is not appropriate for data that does not have a
periodic pattern.
Question 18Choose 2
A manufacturing company needs to identify returned smartphones that have been
damaged by moisture. The company has an automated process that produces 2.000
diagnostic values for each phone. The database contains more than five million phone
evaluations. The evaluation process is consistent, and there are no missing values in the
data. A machine learning (ML) specialist has trained an Amazon SageMaker linear learner
ML model to classify phones as moisture damaged or not moisture damaged by using all
available features. The model's F1 score is 0.6.
What changes in model training would MOST likely improve the model's F1 score? (Select
TWO.)
Show answerHide answer
Correct answer: A, EContinue to use the SageMaker linear learner algorithm. Reduce the number of features
with the SageMaker principal component analysis (PCA) algorithm.Use the SageMaker k-nearest neighbors (k-NN) algorithm. Set a dimension reduction
target of less than 1,000 to train the model.
Explanation
Explanation:
Option A is correct because reducing the number of features with the SageMaker
PCA algorithm can help remove noise and redundancy from the data, and improve
the model’s performance. PCA is a dimensionality reduction technique that
transforms the original features into a smaller set of linearly uncorrelated features
called principal components. The SageMaker linear learner algorithm supports
PCA as a built-in feature transformation option.
Option E is correct because using the SageMaker k-NN algorithm with a
dimension reduction target of less than 1,000 can help the model learn from the
similarity of the data points, and improve the model’s performance. k-NN is a nonparametric
algorithm that classifies an input based on the majority vote of its k
nearest neighbors in the feature space. The SageMaker k-NN algorithm supports
dimension reduction as a built-in feature transformation option.
Option B is incorrect because using the scikit-learn MDS algorithm to reduce the
number of features is not a feasible option, as MDS is a computationally expensive
technique that does not scale well to large datasets. MDS is a dimensionality
reduction technique that tries to preserve the pairwise distances between the
original data points in a lower-dimensional space.
Option C is incorrect because setting the predictor type to regressor would change
the model’s objective from classification to regression, which is not suitable for the
given problem. A regressor model would output a continuous value instead of a
binary label for each phone.
Option D is incorrect because using the SageMaker k-means algorithm with k of
less than 1,000 would not help the model classify the phones, as k-means is a
clustering algorithm that groups the data points into k clusters based on their
similarity, without using any labels. A clustering model would not output a binary
label for each phone.
Question 19Choose 1
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?
Show answerHide answer
Correct answer: CCreate Amazon SageMaker VPC interface endpoints within the corporate VPC.
Explanation
Explanation: To enable the Amazon SageMaker service without enabling direct internet
access to Amazon SageMaker notebook instances, the company should create Amazon
SageMaker VPC interface endpoints within the corporate VPC. A VPC interface endpoint is
a gateway that enables private connections between the VPC and supported AWS services
without requiring an internet gateway, a NAT device, a VPN connection, or an AWS Direct
Connect connection. The instances in the VPC do not need to connect to the public internet
in order to communicate with the Amazon SageMaker service. The VPC interface endpoint
connects the VPC directly to the Amazon SageMaker service using AWS PrivateLink,
which ensures that the traffic between the VPC and the service does not leave the AWS
network1.
Question 20Choose 1
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?
Show answerHide answer
Correct answer: CCreate a new feature space using principal component analysis (PCA)
Explanation
Explanation: Principal component analysis (PCA) is an unsupervised machine learning
algorithm that attempts to reduce the dimensionality (number of features) within a dataset
while still retaining as much information as possible. This is done by finding a new set of
features called components, which are composites of the original features that are
uncorrelated with one another. They are also constrained so that the first component
accounts for the largest possible variability in the data, the second component the second
most variability, and so on. By using PCA, the impact of having a large number of features
that are highly correlated with each other can be reduced, as the new feature space will
have fewer dimensions and less redundancy. This can make the linear models more stable
and less prone to overfitting.
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.