MLA-C01 AWS Certified Machine Learning Engineer - Associate Practice Questions
MLA-C01 AWS Certified Machine Learning Engineer - Associate Practice Questions
What's Inside:
Important Note:
For full access to the complete question bank and topic-wise explanations, visit:
CertQuestionsBank.com
FB page: https://www.facebook.com/certquestionsbank
Share some MLA-C01 exam online questions below.
1.You are a data scientist working on a predictive maintenance model for an industrial manufacturing
company. The model is designed to predict equipment failures based on sensor data collected over
time. During the development process, you notice that the model performs exceptionally well on the
training data but struggles to generalize to new, unseen data. Additionally, there are some indications
that the model might not be fully capturing the complexity of the problem. To ensure the model
performs well in production, you need to identify whether it is overfitting, underfitting, or both.
Which of the following strategies is the MOST EFFECTIVE for identifying overfitting and underfitting in
your model?
A. Perform cross-validation with different subsets of the data; if the model’s performance varies
significantly across folds, the model is underfitting
B. Compare the training and validation loss curves over time; if the validation loss is much higher than
the training loss, the model is likely overfitting
C. Reduce the number of features in the model; if performance improves, the model was previously
overfitting
D. Analyze the model’s performance on a separate test set; if the model performs well on both the
training and test sets, it is neither overfitting nor underfitting
Answer: B
Explanation:
Correct option:
Compare the training and validation loss curves over time; if the validation loss is much higher than
the training loss, the model is likely overfitting
Your model is underfitting the training data when the model performs poorly on the training data. This
is because the model is unable to capture the relationship between the input examples (often called
X) and the target values (often called Y). Your model is overfitting your training data when you see
that the model performs well on the training data but does not perform well on the evaluation data.
This is because the model is memorizing the data it has seen and is unable to generalize to unseen
examples.
via - https://docs.aws.amazon.com/machine-learning/latest/dg/model-fit-underfitting-vs-overfitting.html
Comparing the training and validation loss curves is an effective way to identify overfitting. If the
validation loss is significantly higher than the training loss, it indicates that the model is overfitting the
training data and failing to generalize to unseen data. This is a clear sign that the model is too
complex or trained for too many epochs.
Incorrect options:
Reduce the number of features in the model; if performance improves, the model was previously
overfitting - Reducing the number of features might reduce overfitting, but it’s not a diagnostic
method. It’s a corrective measure rather than a strategy to identify overfitting or underfitting. The
model’s behavior on training versus validation data is a better indicator of overfitting or underfitting.
Perform cross-validation with different subsets of the data; if the model’s performance varies
significantly across folds, the model is underfitting - Cross-validation is a useful technique for
assessing model performance, but significant variation in performance across folds is more indicative
of data variance rather than underfitting. Underfitting is generally identified when the model performs
poorly on both the training and validation sets.
Analyze the model’s performance on a separate test set; if the model performs well on both the
training and test sets, it is neither overfitting nor underfitting - Analyzing performance on a test set is
important, but it only confirms the final model’s ability to generalize. If the model performs well on
both training and test data, it likely indicates a good fit, but this does not help identify overfitting or
underfitting during the training process itself.
Reference: https://docs.aws.amazon.com/machine-learning/latest/dg/model-fit-underfitting-vs-
overfitting.html
https://aws.amazon.com/what-is/overfitting/
2.You are an ML engineer at a data analytics company tasked with training a deep learning model on
a large, computationally intensive dataset. The training job can tolerate interruptions and is expected
to run for several hours or even days, depending on the available compute resources. The company
has a limited budget for cloud infrastructure, so you need to minimize costs as much as possible.
Which strategy is the MOST EFFECTIVE for your ML training job while minimizing cost and ensuring
the job completes successfully?
A. Start the training job using only Spot Instances to minimize cost, and switch to On-Demand
instances manually if any Spot Instances are interrupted during training
B. Use Amazon SageMaker Managed Spot Training to dynamically allocate Spot Instances for the
training job, automatically retrying any interrupted instances via checkpoints
C. Deploy the training job on a fixed number of On-Demand EC2 instances to ensure stability, and
manually add Spot Instances as needed to speed up the job during off-peak hours
D. Use Amazon EC2 Auto Scaling to automatically add Spot Instances to the training job based on
demand, and configure the job to continue processing even if some Spot Instances are interrupted
Answer: B
Explanation:
Correct option:
Use Amazon SageMaker Managed Spot Training to dynamically allocate Spot Instances for the
training job, automatically retrying any interrupted instances via checkpoints
Managed Spot Training uses Amazon EC2 Spot instance to run training jobs instead of on-demand
instances. You can specify which training jobs use spot instances and a stopping condition that
specifies how long SageMaker waits for a job to run using Amazon EC2 Spot instances. Spot
instances can be interrupted, causing jobs to take longer to start or finish. You can configure your
managed spot training job to use checkpoints. SageMaker copies checkpoint data from a local path to
Amazon S3. When the job is restarted, SageMaker copies the data from Amazon S3 back into the
local path. The training job can then resume from the last checkpoint instead of restarting.
via -
https://aws.amazon.com/blogs/aws/managed-spot-training-save-up-to-90-on-your-amazon-
sagemaker-training-jobs/
Incorrect options:
Use Amazon EC2 Auto Scaling to automatically add Spot Instances to the training job based on
demand, and configure the job to continue processing even if some Spot Instances are interrupted -
Amazon EC2 Auto Scaling can add Spot Instances based on demand, but it does not provide the
same level of automation and resilience as SageMaker Managed Spot Training, especially for ML-
specific workloads where Spot interruptions need to be handled gracefully.
Deploy the training job on a fixed number of On-Demand EC2 instances to ensure stability, and
manually add Spot Instances as needed to speed up the job during off-peak hours - Using a fixed
number of On-Demand EC2 instances provides stability, but manually adding Spot Instances
introduces complexity and may not fully optimize costs. Automating this process with SageMaker is
more efficient.
Start the training job using only Spot Instances to minimize cost, and switch to On-Demand instances
manually if any Spot Instances are interrupted during training - Starting with only Spot Instances
minimizes costs, but manually switching to On-Demand instances increases the risk of delays and
interruptions if Spot capacity becomes unavailable. SageMaker Managed Spot Training offers a more
reliable and automated solution.
References:
https://docs.aws.amazon.com/sagemaker/latest/dg/model-managed-spot-training.html
https://aws.amazon.com/blogs/aws/managed-spot-training-save-up-to-90-on-your-amazon-
sagemaker-tr
aining-jobs/
3.How do financial institutions use machine learning with mobile check deposits?
A. To automate logistics
B. To improve ride-sharing apps
C. To reduce wait times
D. To recognize content
Answer: D
Explanation:
Financial institutions use AI to recognize content on mobile check deposits.
4.You are a data scientist working for a media company that processes large volumes of video and
image data to generate personalized content recommendations. The dataset, which is stored in
Amazon S3, contains tens of millions of small image files and several terabytes of high-resolution
large video files. The training jobs you run on Amazon SageMaker require low-latency access to this
data and need to be completed quickly to keep up with the dynamic content pipeline.
Given the characteristics of your data and the requirements for low-latency, high-throughput access,
which approach is the MOST APPROPRIATE for this scenario?
A. Use Fast File mode with Amazon S3 for the large video files, enabling on-demand streaming of
data, and store the small image files locally on the training instances to reduce I/O latency
B. Use Amazon FSx for Lustre to mount the entire dataset as a high-performance file system,
providing consistently low-latency access to both the small image files and the large video files
C. Create an FSx for Lustre file system linked with the Amazon S3 bucket folder having the training
data for the small image files and apply Fast File mode for the video files in the relevant Amazon S3
bucket folder, thereby combining the strengths of both approaches
D. Use Fast File mode with Amazon S3 to stream the small image files directly to the training
instances on-demand, minimizing the time required to start training
Answer: C
Explanation:
Correct option:
Create an FSx for Lustre file system linked with the Amazon S3 bucket folder having the training data
for the small image files and apply Fast File mode for the video files in the relevant Amazon S3
bucket folder, thereby combining the strengths of both approaches
via - https://docs.aws.amazon.com/sagemaker/latest/dg/model-access-training-data.html
FSx for Lustre can scale to hundreds of gigabytes of throughput and millions of IOPS with low-latency
file retrieval. When starting a training job, SageMaker mounts the FSx for Lustre file system to the
training instance file system, then starts your training script. Mounting itself is a relatively fast
operation that doesn't depend on the size of the dataset stored in FSx for Lustre.
If your dataset is too large for file mode, has many small files that you can't serialize easily, or uses a
random read access pattern, FSx for Lustre is a good option to consider. Its file system scales to
hundreds of gigabytes per second (GB/s) of throughput and millions of IOPS, which is ideal when you
have many small files.
via - https://docs.aws.amazon.com/sagemaker/latest/dg/model-access-training-data.html
For the given use case, you can create an FSx for Lustre file system linked with the Amazon S3
bucket folder having the training data for the small image files, like so:
via - https://docs.aws.amazon.com/sagemaker/latest/dg/model-access-training-data.html
You can then apply Fast File mode for the video files in the relevant Amazon S3 bucket folder, like so:
via - https://docs.aws.amazon.com/sagemaker/latest/dg/model-access-training-data.html
Incorrect options:
Use Amazon FSx for Lustre to mount the entire dataset as a high-performance file system, providing
consistently low-latency access to both the small image files and the large video files - Amazon FSx
for Lustre is designed for high-performance workloads with large datasets, especially when you need
low-latency access to many small files that you can't serialize easily, or uses a random read access
pattern.
FSx is not the optimal solution to provide low-latency access to many large video files, you should
rather use the Fast File mode for the video files in the relevant Amazon S3 bucket folder. So, this
option is incorrect.
Use Fast File mode with Amazon S3 to stream the small image files directly to the training instances
on-demand, minimizing the time required to start training - While Fast File mode is effective for large
files, it does not provide the low-latency, high-throughput access needed for a large number of small
files. So, this option is incorrect.
Use Fast File mode with Amazon S3 for the large video files, enabling on-demand streaming of data,
and store the small image files locally on the training instances to reduce I/O latency - Splitting data
management between Fast File mode for large files and local storage for small files adds
unnecessary complexity and additional costs without providing a proportional performance
improvement, so this option is incorrect.
References:
https://docs.aws.amazon.com/sagemaker/latest/dg/model-access-training-data.html
https://aws.amazon.com/about-aws/whats-new/2021/10/amazon-sagemaker-fast-file-mode/
https://aws.amazon.com/fsx/lustre/faqs/
5.Your data science team is working on developing a machine learning model to predict customer
churn. The dataset that you are using contains hundreds of features, but you suspect that not all of
these features are equally important for the model's accuracy. To improve the model's performance
and reduce its complexity, the team wants to focus on selecting only the most relevant features that
contribute significantly to minimizing the model's error rate.
Which feature engineering process should your team apply to select a subset of features that are the
most relevant towards minimizing the error rate of the trained model?
A. Feature extraction
B. Feature creation
C. Feature transformation
D. Feature selection
Answer: D
Explanation:
Correct option:
Feature selection
Feature selection is the process of selecting a subset of extracted features. This is the subset that is
relevant and contributes to minimizing the error rate of a trained model. Feature importance score and
correlation matrix can be factors in selecting the most relevant features for model training.
Incorrect options:
Feature creation - Feature creation refers to the creation of new features from existing data to help
with better predictions. Examples of feature creation include: one-hot-encoding, binning, splitting, and
calculated features.
Feature transformation - Feature transformation and imputation include steps for replacing missing
features or features that are not valid. Some techniques include: forming Cartesian products of
features, non-linear transformations (such as binning numeric variables into categories), and creating
re extraction involves reducing the amount of data to be processed using dimensionality reduction
techniques. These
techniques include: Principal Components Analysis (PCA), Independent Component Analysis (ICA),
and Linear Discriminant Analysis (LDA).
Reference: https://docs.aws.amazon.com/wellarchitected/latest/machine-learning-lens/feature-
engineering.html
6.Which task is machine learning NOT used for in the examples provided?
A. Scheduling medical staff
B. Improving product recommendations
C. Recognizing content on mobile check deposits
D. Customizing search results
Answer: A
Explanation:
Machine learning is not used for scheduling medical staff in the provided examples.
7.You are a data scientist working on a machine learning project to predict customer lifetime value
(CLV) for an e-commerce company. Before deploying a complex model like a deep neural network,
you need to establish a performance baseline to measure the effectiveness of your advanced models.
You decide to use Amazon SageMaker to create this baseline efficiently. The goal is to build a simple
model that can be easily implemented and provide a reference point for evaluating the performance of
more sophisticated models later.
Which of the following approaches is the MOST EFFECTIVE for creating a performance baseline
using Amazon SageMaker?
A. Train a basic linear learner model using Amazon SageMaker, focusing on key features like
customer age, purchase frequency, and average order value, to establish a baseline for CLV
prediction
B. Implement SageMaker Autopilot to automatically explore various models and select the best one
as the baseline, allowing you to skip manual model selection
C. Deploy a SageMaker BlazingText model to create word embeddings from customer reviews, which
can be used as a baseline for evaluating CLV predictions
D. Use SageMaker JumpStart to deploy a pre-trained model for customer segmentation, which can
serve as a baseline for your CLV prediction model
Answer: A
Explanation:
Correct option:
Train a basic linear learner model using Amazon SageMaker, focusing on key features like customer
age, purchase frequency, and average order value, to establish a baseline for CLV prediction Using
SageMaker’s linear learner algorithm is an effective approach for creating a simple and interpretable
baseline. This method allows you to establish a performance benchmark using key features that are
directly related to predicting CLV. The linear learner is quick to train and provides a clear point of
comparison for more complex models.
Incorrect options:
Use SageMaker JumpStart to deploy a pre-trained model for customer segmentation, which can
serve as a baseline for your CLV prediction model - SageMaker JumpStart is great for quickly
deploying pre-built models, but a pre-trained customer segmentation model is not directly aligned with
predicting CLV. It would not serve as an appropriate baseline for this specific task.
Implement SageMaker Autopilot to automatically explore various models and select the best one as
the baseline, allowing you to skip manual model selection - SageMaker Autopilot can automatically
explore and select the best models, but it typically aims for optimal performance rather than
establishing a simple baseline. While Autopilot is useful, starting with a basic model like linear learner
helps you understand the incremental value of more complex models.
Deploy a SageMaker BlazingText model to create word embeddings from customer reviews, which
can be used as a baseline for evaluating CLV predictions - BlazingText is designed for natural
language processing tasks like text classification and word embedding, which are not directly
applicable to creating a CLV prediction baseline. It’s not the right tool for this use case.
References:
https://docs.aws.amazon.com/sagemaker/latest/dg/linear-learner.html
https://aws.amazon.com/sagemaker/jumpstart/
https://docs.aws.amazon.com/sagemaker/latest/dg/autopilot-automate-model-development.html
8.What is the primary distinction between discriminative models and generative models in the context
of generative AI?
A. Discriminative models are only used for text classification, while generative models are only used
for image classification
B. Discriminative models are used to generate new data, while generative models are used only for
classification
C. Generative models are trained on labeled data, while discriminative models can be trained on both
labeled and unlabeled data
D. Generative models focus on generating new data from learned patterns, whereas discriminative
models classify data by distinguishing between different classes
Answer: D
Explanation:
Correct option:
Generative models focus on generating new data from learned patterns, whereas discriminative
models classify data by distinguishing between different classes
Generative models learn the underlying patterns of data to create new, similar data, while
discriminative models learn to distinguish between different classes of data. Generative models, such
as GPT-3, can generate new content, whereas discriminative models are used for classification tasks.
The former focuses on understanding and replicating the data distribution, while the latter focuses on
decision boundaries to classify inputs.
For example, discriminative models look at images - known data like pixel arrangement, line, color,
and shape ? and then map them to an outcome ? the unknown factor. Mathematically, these models
work by identifying equations that could numerically map unknown and known factors as x and y
variables.
Generative models take this one step further. Instead of predicting a label given some features, they
try to predict features given a certain label. Mathematically, generative modeling calculates the
probability of
x and y occurring together. It learns the distribution of different data features and their relationships.
For example, generative models analyze animal images to record variables like different ear shapes,
eye shapes, tail features, and skin patterns. They learn features and their relations to understand
what different animals look like in general. They can then recreate new animal images that were not
in the training set.
Incorrect options:
Discriminative models are used to generate new data, while generative models are used only for
classification - Discriminative models are used primarily for classification, not for generating new data.
Discriminative models are only used for text classification, while generative models are only used for
image classification - Discriminative models can be used for both text and image classification, while
generative models learn the underlying patterns of data to create new data.
Generative models are trained on labeled data, while discriminative models can be trained on both
labeled and unlabeled data - The training data type (labeled vs. unlabeled) is not the primary
distinction between generative and discriminative models.
Reference: https://aws.amazon.com/what-is/generative-ai/
11.You are an ML engineer working for a logistics company that uses machine learning models to
optimize delivery routes, predict maintenance needs, and forecast demand. The company wants to
deploy several models into production, each serving different business functions but running on the
same infrastructure to minimize costs. These models differ in the frequency of updates. The company
is considering whether to use a multi-model deployment approach or a multi-container deployment
approach on Amazon SageMaker to manage these models efficiently.
Given these requirements, which deployment strategy is MOST SUITABLE for managing these
diverse models?
A. Implement a multi-container deployment strategy on a single SageMaker endpoint, where each
model runs in its own container, allowing you to manage resource allocation more precisely across
models
B. Use a multi-model deployment on a single SageMaker endpoint to host all models together,
allowing you to dynamically load and serve models as needed without needing separate endpoints
C. Deploy each model individually using separate SageMaker endpoints, ensuring each model has
dedicated resources and can be scaled independently
D. Use a hybrid approach where frequently updated models are deployed using multi-model
endpoints and more complex models are deployed using multi-container endpoints, balancing
flexibility and resource management
Answer: B
Explanation:
Correct option:
Use a multi-model deployment on a single SageMaker endpoint to host all models together, allowing
you to dynamically load and serve models as needed without needing separate endpoints
Multi-model endpoints are ideal for hosting a large number of models that use the same ML
framework on a shared serving container. If you have a mix of frequently and infrequently accessed
models, a multi-model endpoint can efficiently serve this traffic with fewer resources and higher cost
savings. Your application should be tolerant of occasional cold start-related latency penalties that
occur when invoking infrequently used models.
Multi-model endpoints support hosting both CPU and GPU backed models. By using GPU backed
models, you can lower your model deployment costs through increased usage of the endpoint and its
underlying accelerated compute instances.
Multi-model endpoints also enable time-sharing of memory resources across your models. This works
best when the models are fairly similar in size and invocation latency. When this is the case, multi-
model endpoints can effectively use instances across all models. If you have models that have
significantly higher transactions per second (TPS) or latency requirements, we recommend hosting
them on dedicated endpoints.
via - https://docs.aws.amazon.com/sagemaker/latest/dg/multi-model-endpoints.html
Incorrect options:
Deploy each model individually using separate SageMaker endpoints, ensuring each model has
dedicated resources and can be scaled independently - Deploying each model on a separate
endpoint provides dedicated resources and independent scaling but can lead to higher costs and
complexity, especially when managing many models.
Implement a multi-container deployment strategy on a single SageMaker endpoint, where each model
runs in its own container, allowing you to manage resource allocation more precisely across models -
A multi-container deployment is useful when models have different dependencies or require isolation
for security reasons. However, it is more complex to manage than multi-model deployment and may
be overkill if your models do not require strict separation or have different runtime environments.
Use a hybrid approach where frequently updated models are deployed using multi-model endpoints
and more complex models are deployed using multi-container endpoints, balancing flexibility and
resource management - While a hybrid approach might seem to provide flexibility, it adds complexity
in terms of management and deployment. It’s better to choose a single approach that meets most of
your needs unless there are specific reasons to segregate models by deployment type.
References:
https://docs.aws.amazon.com/sagemaker/latest/dg/multi-model-endpoints.html
https://docs.aws.amazon.com/sagemaker/latest/dg/multi-container-direct.html
12.You are a Senior ML Engineer at a global logistics company that heavily relies on machine
learning models for optimizing delivery routes, predicting demand, and detecting anomalies in real-
time. The company is rapidly expanding, and you are tasked with building a maintainable, scalable,
and cost-effective ML infrastructure that can handle increasing data volumes and evolving model
requirements. You must implement best practices to ensure that the infrastructure can support
ongoing development, deployment, monitoring, and scaling of multiple models across different
regions.
Which of the following strategies should you implement to create a maintainable, scalable, and cost-
effective ML infrastructure for your company using AWS services? (Select three)
A. Provision fixed resources for each model to avoid unexpected costs, ensuring that the
infrastructure is always available for each model
B. Store all model artifacts and data in Amazon CodeCommit for version control and managing
changes over time
C. Use a monolithic architecture to manage all machine learning models in a single environment,
simplifying management and reducing overhead
D. Store all model artifacts and data in Amazon S3, and use versioning to manage changes over
time, ensuring that models can be easily rolled back if needed
E. Implement a microservices-based architecture with Amazon SageMaker endpoints, where each
model is deployed independently, allowing for isolated scaling and updates
F. Utilize infrastructure as code (IaC) with AWS CloudFormation to automate the deployment and
management of ML resources, making it easy to replicate and scale infrastructure across regions
Answer: D, E, F
Explanation:
Correct options:
Implement a microservices-based architecture with Amazon SageMaker endpoints, where each
model is deployed independently, allowing for isolated scaling and updates
A microservices-based architecture with Amazon SageMaker endpoints allows each model to be
deployed, managed, and scaled independently. This approach enhances maintainability by isolating
different components, making it easier to update models or scale specific services without affecting
others. It also supports a more scalable and flexible infrastructure.
Utilize infrastructure as code (IaC) with AWS CloudFormation to automate the deployment and
management of ML resources, making it easy to replicate and scale infrastructure across regions
Utilizing infrastructure as code (IaC) with AWS CloudFormation enables you to automate the
deployment and management of your ML infrastructure. This approach ensures consistency across
environments, simplifies scaling, and allows for rapid deployment in multiple regions. IaC also
enhances maintainability by providing a version-controlled, repeatable process for managing
infrastructure changes.
Store all model artifacts and data in Amazon S3, and use versioning to manage changes over time,
ensuring that models can be easily rolled back if needed
Storing model artifacts and data in Amazon S3 with versioning is a good practice for maintaining
model history and enabling rollbacks.
Incorrect options:
Use a monolithic architecture to manage all machine learning models in a single environment,
simplifying management and reducing overhead - A monolithic architecture can simplify management
in the short term but becomes difficult to maintain and scale as the number of models and services
grows. It also limits flexibility in updating or scaling individual models, leading to potential bottlenecks
and higher costs. Provision fixed resources for each model to avoid unexpected costs, ensuring that
the infrastructure is always available for each model - Provisioning fixed resources for each model
may lead to underutilization or overprovisioning, resulting in higher costs. Dynamic resource
allocation, such as using auto-scaling or spot instances, is generally more cost-effective and scalable.
Store all model artifacts and data in Amazon CodeCommit for version control and managing changes
over time - Amazon CodeCommit is the right fit for code-specific version control. You should not use
CodeCommit to store model related data.
References:
https://docs.aws.amazon.com/sagemaker/latest/dg/how-it-works-deployment.html
https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cloudformation-overview.html
https://aws.amazon.com/codecommit/
13. The recommendations models need to handle real-time inference with low latency.
14.You are a data scientist at a financial services company tasked with deploying a lightweight
machine learning model that predicts creditworthiness based on a customer’s transaction history.
The model needs to provide real-time predictions with minimal latency, and the traffic pattern is
unpredictable, with occasional spikes during business hours. The company is cost-conscious and
prefers a serverless architecture to minimize infrastructure management overhead.
Which approach is the MOST SUITABLE for deploying this solution, and why?
A. Deploy the model directly within AWS Lambda as a function, and expose it through an API
Gateway endpoint, allowing the function to scale automatically with traffic and provide real-time
predictions
B. Deploy the model as a SageMaker endpoint for real-time inference, and configure AWS Lambda to
preprocess incoming requests before sending them to the SageMaker endpoint for prediction
C. Deploy the model using Amazon ECS (Elastic Container Service) and configure an AWS Lambda
to trigger the ECS service on-demand, ensuring that the model is only running during peak traffic
periods
D. Use an Amazon EC2 instance to host the model, with AWS Lambda functions handling the
communication between the API Gateway and the EC2 instance for prediction requests
Answer: A
Explanation:
Correct option:
Deploy the model directly within AWS Lambda as a function, and expose it through an API Gateway
endpoint, allowing the function to scale automatically with traffic and provide real-time predictions
Deploying the model within AWS Lambda as a function and exposing it through an API Gateway
endpoint is ideal for lightweight, serverless, real-time inference. Lambda’s automatic scaling and pay-
per-use model align well with unpredictable traffic patterns and the need for cost efficiency.
via -
https://aws.amazon.com/blogs/compute/deploying-machine-learning-models-with-serverless-
templates/
Incorrect options:
Deploy the model as a SageMaker endpoint for real-time inference, and configure AWS Lambda to
preprocess incoming requests before sending them to the SageMaker endpoint for prediction - While
deploying the model as a SageMaker endpoint is suitable for more complex models requiring
managed infrastructure, this approach might be overkill for a lightweight model, especially if you want
to minimize costs and management overhead. Lambda functions can serve the model directly in a
more cost-effective manner.
Use an Amazon EC2 instance to host the model, with AWS Lambda functions handling the
communication between the API Gateway and the EC2 instance for prediction requests - Hosting the
model on an Amazon EC2 instance with Lambda managing communication adds unnecessary
complexity and overhead. EC2-based deployments require more management and may not be as
cost-effective for serverless and real-time use cases.
Deploy the model using Amazon ECS (Elastic Container Service) and configure an AWS Lambda to
trigger the ECS service on-demand, ensuring that the model is only running during peak traffic
periods - Using Amazon ECS triggered by AWS Lambda adds complexity and may not provide the
same level of real-time responsiveness as directly deploying the model in Lambda.
Reference: https://aws.amazon.com/blogs/compute/deploying-machine-learning-models-with-
serverless-templates/
15.You are a data scientist at a healthcare startup tasked with developing a machine learning model
to predict the likelihood of patients developing a specific chronic disease within the next five years.
The dataset available includes patient demographics, medical history, lab results, and lifestyle factors,
but it is relatively small, with only 1,000 records. Additionally, the dataset has missing values in some
critical features, and the class distribution is highly imbalanced, with only 5% of patients labeled as
having developed the disease.
Given the data limitations and the complexity of the problem, which of the following approaches is the
MOST LIKELY to determine the feasibility of an ML solution and guide your next steps?
A. Proceed with training a deep neural network (DNN) model using the available data, as DNNs can
handle small datasets by learning complex patterns
B. Increase the dataset size by generating synthetic data and then train a simple logistic regression
model to avoid overfitting
C. Conduct exploratory data analysis (EDA) to understand the data distribution, address missing
values, and assess the class imbalance before determining if an ML solution is feasible
D. Immediately apply an oversampling technique to balance the dataset, then train an XGBoost
model to maximize performance on the minority class
Answer: C
Explanation:
Correct option:
Conduct exploratory data analysis (EDA) to understand the data distribution, address missing values,
and assess the class imbalance before determining if an ML solution is feasible
Conducting exploratory data analysis (EDA) is the most appropriate first step. EDA allows you to
understand the data distribution, identify and address missing values, and assess the extent of the
class imbalance. This process helps determine whether the available data is sufficient to build a
reliable model and what preprocessing steps might be necessary.
Exploratory data analysis, feature engineering, and operationatizing your data ftow into your ML
pipeline with Amazon
SageMaker Data Wrangter
by Phi Nguyen and Roberto Bruno Martins | on 11 DEC 2020 | in Amazon 5agef•1aker, Amazon
SageMaker Data Wrangter, Artificial Intelligence | Permalink | Comments | r'+ Share
According to The State of Data Science 2020 survey, data management, exploratory data analysis
(EDA), feature selection, and feature engineering accounts for more than 66% of a data scientist's
time (see the following diagram).
Data
loading 19o/
eta
cleansing
The same survey highlights that the top three biggest roadblocks to deploying a model in production
are managing dependencies and environments, security, and skill gaps (see the following diagram).
via -
https://aws.amazon.com/blogs/machine-learning/exploratory-data-analysis-feature-engineering-and-
operationalizing-your-data-flow-into-your-ml-pipeline-with-amazon-sagemaker-data-wrangler/
Incorrect options:
Proceed with training a deep neural network (DNN) model using the available data, as DNNs can
handle small datasets by learning complex patterns - Training a deep neural network on a small
dataset is not advisable, as DNNs typically require large amounts of data to perform well and avoid
overfitting. Additionally, jumping directly to model training without assessing the data first may lead to
poor results.
Increase the dataset size by generating synthetic data and then train a simple logistic regression
model to avoid overfitting - While generating synthetic data can help increase the dataset size, it may
introduce biases if not done carefully. Additionally, without first understanding the data through EDA,
you risk applying the wrong strategy or misinterpreting the results.
Immediately apply an oversampling technique to balance the dataset, then train an XGBoost model to
maximize performance on the minority class - Although oversampling can address class imbalance,
it’s important to first understand the underlying data issues through EDA. Oversampling should not
be the immediate next step without understanding the data quality, feature importance, and potential
need for feature engineering.
References:
https://aws.amazon.com/blogs/machine-learning/exploratory-data-analysis-feature-engineering-and-
oper
ationalizing-your-data-flow-into-your-ml-pipeline-with-amazon-sagemaker-data-wrangler/
https://aws.amazon.com/blogs/machine-learning/use-amazon-sagemaker-canvas-for-exploratory-data-
a
nalysis/
16.You are preparing a dataset for training a machine learning model using SageMaker Data
Wrangler. The dataset has several missing values spread across different columns, and these
columns contain numeric data. Before training the model, it is essential to handle these missing
values to ensure the model performs optimally. The goal is to replace the missing values in each
numeric column with the mean of that column.
Which transformation in SageMaker Data Wrangler should you apply to replace the missing values in
numeric columns with the mean of those columns?
A. Encode
B. Impute
C. Scale
D. Drop
Answer: B
Explanation:
Correct option:
Impute
Amazon SageMaker Data Wrangler provides numerous ML data transforms to streamline cleaning,
transforming, and featurizing your data. When you add a transform, it adds a step to the data flow.
Each transform you add modifies your dataset and produces a new dataframe. All subsequent
transforms apply to the resulting dataframe.
Use the Impute missing transform to create a new column that contains imputed values where
missing values were found in input categorical and numerical data. The configuration depends on
your data type. For numeric data, choose an imputing strategy, the strategy used to determine the
new value to impute. You can choose to impute the mean (as needed in the use case)or the median
over the values that are present in your dataset. Data Wrangler uses the value that it computes to
impute the missing values.
For categorical data, Data Wrangler imputes missing values using the most frequent value in the
column.
To impute a custom string, use the Fill missing transform instead.
Incorrect options:
Drop - Use the Drop missing option to drop rows that contain missing values from the Input column.
Scale - This action normalizes or standardizes the data but does not handle missing values.
Encode - This action transforms categorical data into numerical data. Encoding categorical data is the
process of creating a numerical representation for categories. For example, if your categories are Dog
and Cat, you may encode this information into two vectors, [1,0] to represent Dog, and [0,1] to
represent Cat. Encoding does not address missing values.
Reference: https://docs.aws.amazon.com/sagemaker/latest/dg/data-wrangler-transform.html
19.What is the primary purpose of collecting more data in the Amazon ML flywheel?
A. To store for future use without immediate application.
B. To improve the accuracy of predictions and drive further efficiency.
C. To validate past decisions without influencing future strategies.
D. To limit the scope of machine learning applications to predefined areas.
Answer: B
Explanation:
Collecting more data improves the accuracy of predictions, which drives efficiency and reinforces the
growth loop in the Amazon ML flywheel.
20. The fraud detection model is a large model and needs to be integrated into serverless
applications to minimize infrastructure management.
Which of the following deployment targets should you choose for the different machine learning
models, given their specific requirements? (Select two)
A. Choose Amazon Elastic Container Service (Amazon ECS) for the recommendation model, as it
provides container orchestration for large-scale, batch processing workloads with tight integration into
other AWS services
B. Use AWS Lambda to deploy the fraud detection model, which requires rapid scaling and
integration into an existing serverless architecture, minimizing infrastructure management
C. Deploy the real-time recommendation model using Amazon SageMaker endpoints to ensure low-
latency, high-availability, and managed infrastructure for real-time inference
D. Deploy the generative AI model using Amazon Elastic Kubernetes Service (Amazon EKS) to
leverage containerized microservices for high scalability and control over the deployment environment
E. Deploy all models using Amazon SageMaker endpoints for consistency and ease of management,
regardless of their individual requirements for scalability, latency, or integration
Answer: C, D
Explanation:
Correct options:
Deploy the real-time recommendation model using Amazon SageMaker endpoints to ensure low-
latency, high-availability, and managed infrastructure for real-time inference
Amazon EKS is designed for containerized applications that need high scalability and flexibility. It is
suitable for the generative AI model, which may require complex orchestration and scaling in
response to varying demand, while giving you full control over the deployment environment.
via - https://aws.amazon.com/blogs/containers/deploy-generative-ai-models-on-amazon-eks/
Deploy the generative AI model using Amazon Elastic Kubernetes Service (Amazon EKS) to leverage
containerized microservices for high scalability and control over the deployment environment
Real-time inference is ideal for inference workloads where you have real-time, interactive, low latency
requirements. You can deploy your model to SageMaker hosting services and get an endpoint that
can be used for inference. These endpoints are fully managed and support autoscaling.
This makes it an ideal choice for the recommendation model, which must provide fast responses to
user interactions with minimal downtime.
Incorrect options:
Use AWS Lambda to deploy the fraud detection model, which requires rapid scaling and integration
into an existing serverless architecture, minimizing infrastructure management - While AWS Lambda
is excellent for serverless applications, it may not be the best choice for a fraud detection model if it
requires continuous, low-latency processing or needs to handle very high throughput. Lambda is
better suited for lightweight, event-driven tasks rather than long-running, complex inference jobs.
Choose Amazon Elastic Container Service (Amazon ECS) for the recommendation model, as it
provides container orchestration for large-scale, batch processing workloads with tight integration into
other AWS services - Amazon ECS is a good choice for containerized workloads but is generally
more appropriate for batch processing or large-scale, stateless applications. It might not provide the
low-latency and real-time capabilities needed for the recommendation model.
Deploy all models using Amazon SageMaker endpoints for consistency and ease of management,
regardless of their individual requirements for scalability, latency, or integration - Deploying all models
using Amazon SageMaker endpoints without considering their specific requirements for latency,
scalability, and integration would be suboptimal. While SageMaker endpoints are highly versatile, they
may not be the best fit for every use case, especially for models requiring serverless architecture or
advanced container orchestration.
References:
https://docs.aws.amazon.com/sagemaker/latest/dg/realtime-endpoints.html
https://aws.amazon.com/blogs/containers/deploy-generative-ai-models-on-amazon-eks/