Google Professional Machine Learning Engineer (PMLE) Practice Questions & Study Guide
# SEO Description: Google Professional Machine Learning Engineer (PMLE)
## Exam Scope and Overview
The Google Professional Machine Learning Engineer (PMLE) examination is a high-level certification for machine learning professionals who want to demonstrate their expertise in designing and implementing scalable and secure machine learning (ML) solutions on the Google Cloud platform. This exam validates a candidate's expertise in cloud-native ML architecture, model development, and optimization. Candidates will explore the role of a machine learning engineer, the processes for building and deploying cloud-native ML solutions, and the tools used in a modern AI-driven environment on Google Cloud. Mastering these professional-level ML engineering concepts is a crucial step for any data professional aiming to become a certified Google Professional Machine Learning Engineer.
## Target Audience
This exam is primarily designed for senior machine learning engineers, data scientists, and ML professionals who have significant experience in designing and implementing complex cloud-native ML solutions on the Google Cloud platform. It is highly beneficial for professionals who are responsible for managing and optimizing large-scale ML pipelines, as well as those who are involved in designing and implementing advanced AI-driven solutions. Professionals working in data analytics, business intelligence, and big data will find the content invaluable for enhancing their knowledge and credibility at a professional level.
## Key Topics and Domain Areas
The PMLE curriculum covers a broad spectrum of professional-level ML engineering topics, including:
* **Designing for Google Cloud ML Architecture:** Designing advanced cloud-native ML architectures for complex enterprise environments on the Google Cloud platform.
* **Managing and Provisioning Google Cloud ML Resources:** Implementing and managing Google Cloud ML services, including Vertex AI and BigQuery ML.
* **Model Development and Optimization:** Exploring various techniques for developing and optimizing ML models on the Google Cloud platform.
* **ML Pipeline Orchestration:** Implementing and managing ML pipelines on the Google Cloud platform at scale.
* **ML Security and Ethics:** Learning about security measures and ethical considerations in an ML-driven environment on Google Cloud.
* **Advanced Troubleshooting:** Diagnosing and resolving complex cloud-native ML architecture and infrastructure issues on the Google Cloud platform.
## Why Prepare with NotJustExam?
Preparing for the PMLE exam requires professional-level logic and a deep understanding of advanced cloud-native ML engineering concepts on Google Cloud. NotJustExam offers a unique interactive learning platform that goes beyond traditional practice tests.
* **ML Engineering Simulations:** Our questions are designed to mirror the logic used in advanced Google Cloud ML tools, helping you think like an ML engineer specialist.
* **Comprehensive Explanations:** Every practice question comes with a comprehensive breakdown of the correct answer, ensuring you understand the "why" behind every advanced ML configuration and optimization task.
* **Efficient Preparation:** Streamline your study process with our organized content modules, designed to maximize retention and minimize study time.
* **Master the PMLE Level:** Our content is specifically tailored to the PMLE objectives, ensuring you are studying the most relevant material for the professional level of certification.
Elevate your career as an ML professional with NotJustExam. Our interactive study materials are the key to mastering the PMLE exam and becoming a certified Google Professional Machine Learning Engineer.
Free Google Professional Machine Learning Engineer (PMLE) Practice Questions Preview
-
Question 1
You are building an ML model to detect anomalies in real-time sensor data. You will use Pub/Sub to handle incoming requests. You want to store the results for analytics and visualization. How should you configure the pipeline?
- A. 1 = Dataflow, 2 = AI Platform, 3 = BigQuery
- B. 1 = DataProc, 2 = AutoML, 3 = Cloud Bigtable
- C. 1 = BigQuery, 2 = AutoML, 3 = Cloud Functions
- D. 1 = BigQuery, 2 = AI Platform, 3 = Cloud Storage
Correct Answer:
A
Explanation:
Based on the question and the discussion, I agree with the suggested answer A.
Here's a breakdown of the reasoning:
- Data ingestion and processing (1): Dataflow is a fully managed, serverless stream and batch data processing service. It's ideal for reading data from Pub/Sub, performing any necessary transformations, and writing the data to a storage solution. This makes it well-suited for real-time anomaly detection pipelines where you need to process streaming sensor data.
- Anomaly detection (2): AI Platform (now Vertex AI) provides the tools and infrastructure to train and deploy machine learning models. You can deploy your anomaly detection model to Vertex AI and use it to score the data coming from Dataflow in real-time.
- Storage for analytics and visualization (3): BigQuery is a fully managed, serverless data warehouse that is well-suited for storing and analyzing large datasets. It's a good choice for storing the results of your anomaly detection model so that you can perform analytics and create visualizations.
Why the other options are not as suitable:
- Option B: DataProc is suitable for batch processing using Hadoop/Spark, which isn't the best fit for real-time streaming data. AutoML, while useful for some ML tasks, isn't a direct replacement for deploying a custom anomaly detection model and Cloud Bigtable is a NoSQL database, less ideal for analytics compared to BigQuery.
- Option C: While BigQuery is a good choice for storing the results and AutoML could be used to potentially train the model, Cloud Functions are more suitable for event-driven tasks, not for the continuous real-time processing needed in this scenario.
- Option D: While AI Platform is appropriate for hosting the ML model, using Cloud Storage as the primary storage for the results is less suitable for analytics and visualization purposes compared to BigQuery. Cloud Storage is better suited for storing raw data or files.
Therefore, Dataflow -> AI Platform -> BigQuery provides the most complete and efficient solution for this real-time anomaly detection pipeline.
-
Question 2
Your organization wants to make its internal shuttle service route more efficient. The shuttles currently stop at all pick-up points across the city every 30 minutes between 7 am and 10 am. The development team has already built an application on Google Kubernetes Engine that requires users to confirm their presence and shuttle station one day in advance. What approach should you take?
- A. 1. Build a tree-based regression model that predicts how many passengers will be picked up at each shuttle station. 2. Dispatch an appropriately sized shuttle and provide the map with the required stops based on the prediction.
- B. 1. Build a tree-based classification model that predicts whether the shuttle should pick up passengers at each shuttle station. 2. Dispatch an available shuttle and provide the map with the required stops based on the prediction.
- C. 1. Define the optimal route as the shortest route that passes by all shuttle stations with confirmed attendance at the given time under capacity constraints. 2. Dispatch an appropriately sized shuttle and indicate the required stops on the map.
- D. 1. Build a reinforcement learning model with tree-based classification models that predict the presence of passengers at shuttle stops as agents and a reward function around a distance-based metric. 2. Dispatch an appropriately sized shuttle and provide the map with the required stops based on the simulated outcome.
Correct Answer:
C
Explanation:
Based on the question and discussion, I agree with the suggested answer C.
Reasoning:
The problem is fundamentally a route optimization problem with known constraints (confirmed attendance and capacity). Option C directly addresses this by defining the optimal route as the shortest one that serves only the necessary stops while respecting capacity. The key information is that users confirm their presence in advance. This eliminates the need for complex predictive models.
Why other options are not suitable:
- A: This option uses a tree-based regression model to predict the number of passengers. Since the system already collects attendance confirmation, prediction is unnecessary and adds complexity.
- B: Similar to A, this option uses a classification model to predict whether to stop at a station, which is redundant given the pre-confirmation system.
- D: Reinforcement learning is overkill for this problem. It introduces significant complexity and requires extensive training data and computational resources. A simple route optimization algorithm is more efficient and effective.
Therefore, option C provides the most straightforward and efficient solution by leveraging the existing confirmation system to optimize the shuttle route.
Citations:
- Google Kubernetes Engine, https://cloud.google.com/kubernetes-engine
-
Question 3
You were asked to investigate failures of a production line component based on sensor readings. After receiving the dataset, you discover that less than 1% of the readings are positive examples representing failure incidents. You have tried to train several classification models, but none of them converge. How should you resolve the class imbalance problem?
- A. Use the class distribution to generate 10% positive examples.
- B. Use a convolutional neural network with max pooling and softmax activation.
- C. Downsample the data with upweighting to create a sample with 10% positive examples.
- D. Remove negative examples until the numbers of positive and negative examples are equal.
Correct Answer:
C
Explanation:
I agree with the suggested answer. The best approach to resolve a class imbalance problem, especially when dealing with a very low percentage of positive examples, is to balance the dataset through a combination of downsampling and upweighting. Here's a detailed explanation:
Suggested Answer: C. Downsample the data with upweighting to create a sample with 10% positive examples.
Reasoning:
-
Why this approach works: The key issue is that the model struggles to learn from the rare positive examples when they are heavily outnumbered by negative examples. Downsampling reduces the number of negative examples, while upweighting assigns a higher importance to the positive examples during training. This combined strategy helps the model to give more attention to the minority class and improves its ability to correctly classify positive instances.
-
Downsampling: This reduces the number of majority class (negative) examples, preventing the model from being overwhelmed by them.
-
Upweighting: This gives more importance to the minority class (positive) examples during the training process, making the model more sensitive to them. By upweighting, each positive example has a greater impact on the loss function, encouraging the model to learn from them more effectively.
-
Target Percentage (10%): The suggestion of 10% is a reasonable starting point, but the optimal percentage might need to be tuned through experimentation. The goal is to create a balance that allows the model to learn effectively without overfitting to the minority class.
Why the other options are not ideal:
-
A. Use the class distribution to generate 10% positive examples: Simply generating synthetic data without careful consideration can lead to overfitting if the generated data doesn't accurately represent the true distribution of positive examples. While data augmentation techniques like SMOTE can be useful, blindly generating data without a good strategy can be problematic.
-
B. Use a convolutional neural network with max pooling and softmax activation: While CNNs are powerful for certain types of data (e.g., images), using a specific model architecture does not directly address the class imbalance problem. The model will still be biased towards the majority class.
-
D. Remove negative examples until the numbers of positive and negative examples are equal: This may lead to significant information loss, especially if the dataset is already small. Downsampling too aggressively can remove valuable information about the negative class, potentially reducing the model's overall performance and generalizability.
Therefore, downsampling with upweighting provides a balanced and effective method for handling class imbalance in this scenario.
Citations:
- Handling imbalanced datasets, https://developers.google.com/machine-learning/data-prep/transform/imbalanced-data
-
Question 4
You want to rebuild your ML pipeline for structured data on Google Cloud. You are using PySpark to conduct data transformations at scale, but your pipelines are taking over 12 hours to run. To speed up development and pipeline run time, you want to use a serverless tool and SQL syntax. You have already moved your raw data into Cloud Storage. How should you build the pipeline on Google Cloud while meeting the speed and processing requirements?
- A. Use Data Fusion's GUI to build the transformation pipelines, and then write the data into BigQuery.
- B. Convert your PySpark into SparkSQL queries to transform the data, and then run your pipeline on Dataproc to write the data into BigQuery.
- C. Ingest your data into Cloud SQL, convert your PySpark commands into SQL queries to transform the data, and then use federated queries from BigQuery for machine learning.
- D. Ingest your data into BigQuery using BigQuery Load, convert your PySpark commands into BigQuery SQL queries to transform the data, and then write the transformations to a new table.
Correct Answer:
D
Explanation:
The suggested answer is D, which aligns with the requirements outlined in the question. Here's a detailed breakdown:
Reasoning for choosing D:
- The primary requirements are a serverless tool and SQL syntax for data transformation. BigQuery (BQ) perfectly fits this criteria. BigQuery is a fully-managed, serverless data warehouse that allows you to use SQL for querying and transforming data.
- The data is already in Cloud Storage, making BigQuery Load a direct and efficient way to ingest the data.
- Converting PySpark commands to BigQuery SQL queries allows leveraging the power of BigQuery's SQL engine for transformations.
- Writing the transformations to a new table allows for easy management and versioning of the transformed data.
Reasons for not choosing the other answers:
- A: Data Fusion: While Data Fusion provides a GUI for building pipelines, it is not strictly serverless in the same way as BigQuery. It also may not be the most efficient option for large-scale data transformations, especially when SQL can be used directly.
- B: Dataproc: Dataproc is a managed Spark service, but it is not serverless. It requires you to manage clusters, which adds operational overhead. The question specifically asks for a serverless solution.
- C: Cloud SQL: Cloud SQL is a relational database service and not designed for the scale of data transformation described in the question. While it supports SQL, it's not a data warehouse solution like BigQuery, and using federated queries would likely be less performant than performing transformations directly within BigQuery.
In summary, BigQuery offers the best combination of serverless architecture, SQL-based transformations, and scalability, making it the most appropriate solution for the given scenario.
Citations:
- BigQuery Documentation, https://cloud.google.com/bigquery/docs
- Cloud Storage Documentation, https://cloud.google.com/storage/docs
- Data Fusion Documentation, https://cloud.google.com/data-fusion/docs
- Dataproc Documentation, https://cloud.google.com/dataproc/docs
- Cloud SQL Documentation, https://cloud.google.com/sql/docs
-
Question 5
You manage a team of data scientists who use a cloud-based backend system to submit training jobs. This system has become very difficult to administer, and you want to use a managed service instead. The data scientists you work with use many different frameworks, including Keras, PyTorch, theano, Scikit-learn, and custom libraries. What should you do?
- A. Use the AI Platform custom containers feature to receive training jobs using any framework.
- B. Configure Kubeflow to run on Google Kubernetes Engine and receive training jobs through TF Job.
- C. Create a library of VM images on Compute Engine, and publish these images on a centralized repository.
- D. Set up Slurm workload manager to receive jobs that can be scheduled to run on your cloud infrastructure.
Correct Answer:
A
Explanation:
The suggested answer is A. Here's a detailed explanation:
Reasoning:
The question emphasizes the need for a *managed service* that can handle a variety of frameworks (Keras, PyTorch, Scikit-learn, etc.) and custom libraries. AI Platform (now Vertex AI) with its custom containers feature is the most suitable option.
- Custom Containers: This feature allows data scientists to package their training code, dependencies, and frameworks into a Docker container. This provides flexibility and ensures that any framework or library can be used, addressing the diverse needs of the data science team.
- Managed Service: Vertex AI is a managed service, relieving the administrative burden of managing the underlying infrastructure.
- Scalability: Vertex AI provides scalability, allowing training jobs to be run on powerful infrastructure without the overhead of managing that infrastructure.
Why other options are not suitable:
- B. Configure Kubeflow to run on Google Kubernetes Engine and receive training jobs through TF Job: While Kubeflow is a powerful platform for MLOps, configuring and managing it on GKE adds significant administrative overhead, contradicting the requirement for a "managed service." TFJob is also primarily focused on TensorFlow, which doesn't directly address the need to support other frameworks like PyTorch and Scikit-learn without additional configuration.
- C. Create a library of VM images on Compute Engine, and publish these images on a centralized repository: This approach involves managing VM images, which is not a managed service. It places the burden of infrastructure management on the user, which the question seeks to avoid. It also requires manual effort to create and maintain these images.
- D. Set up Slurm workload manager to receive jobs that can be scheduled to run on your cloud infrastructure: Slurm, while a good workload manager, is not a fully managed service in the context of cloud ML training. Setting it up and maintaining it on cloud infrastructure still involves administrative overhead, which the question aims to avoid. Also, it doesn't inherently provide the deep integration with other ML services that Vertex AI offers.
In conclusion, Vertex AI's custom containers offer the best combination of flexibility, support for diverse frameworks, and managed service capabilities.
Therefore, choosing A is the most appropriate choice.
Citations:
- Vertex AI Custom Containers, https://cloud.google.com/vertex-ai/docs/training/create-custom-container
-
Question 6
You work for an online retail company that is creating a visual search engine. You have set up an end-to-end ML pipeline on Google Cloud to classify whether an image contains your company's product. Expecting the release of new products in the near future, you configured a retraining functionality in the pipeline so that new data can be fed into your ML models. You also want to use AI Platform's continuous evaluation service to ensure that the models have high accuracy on your test dataset. What should you do?
- A. Keep the original test dataset unchanged even if newer products are incorporated into retraining.
- B. Extend your test dataset with images of the newer products when they are introduced to retraining.
- C. Replace your test dataset with images of the newer products when they are introduced to retraining.
- D. Update your test dataset with images of the newer products when your evaluation metrics drop below a pre-decided threshold.
Correct Answer:
B
Explanation:
The suggested answer is B: Extend your test dataset with images of the newer products when they are introduced to retraining. I agree with this answer.
Reasoning:
The goal is to ensure the model maintains high accuracy, especially after retraining with new product data. Extending the test dataset with images of the newer products accomplishes this by providing a comprehensive evaluation set that reflects the current state of the model and the data it is trained on. This approach allows for continuous evaluation of the model's ability to classify both older and newer products.
By extending the test dataset, we achieve the following:
- Comprehensive Evaluation: The test set represents the full range of products the model needs to classify.
- Proactive Monitoring: Continuous evaluation with an updated test set allows for early detection of performance degradation related to new products.
- Accuracy Maintenance: Ensures the model maintains high accuracy across all products, both old and new.
Why other options are not suitable:
- A. Keep the original test dataset unchanged even if newer products are incorporated into retraining: This is incorrect because it does not evaluate the model's performance on the newer products. The continuous evaluation service would only provide insights into the model's accuracy on the original products, missing potential issues with the new product classifications.
- C. Replace your test dataset with images of the newer products when they are introduced to retraining: This is incorrect because replacing the test dataset will result in a loss of insight into the model's performance on the original products. It's important to ensure the model continues to perform well on all products, not just the new ones.
- D. Update your test dataset with images of the newer products when your evaluation metrics drop below a pre-decided threshold: This is not ideal because it is reactive rather than proactive. Waiting for the evaluation metrics to drop indicates that the model has already started performing poorly on the new products. A better approach is to proactively include new product images in the test set to continuously monitor performance.
-
Question 7
You need to build classification workflows over several structured datasets currently stored in BigQuery. Because you will be performing the classification several times, you want to complete the following steps without writing code: exploratory data analysis, feature selection, model building, training, and hyperparameter tuning and serving. What should you do?
- A. Configure AutoML Tables to perform the classification task.
- B. Run a BigQuery ML task to perform logistic regression for the classification.
- C. Use AI Platform Notebooks to run the classification model with pandas library.
- D. Use AI Platform to run the classification model job configured for hyperparameter tuning.
Correct Answer:
A
Explanation:
The suggested answer, A, is correct.
The question explicitly requires performing classification tasks "without writing code," including exploratory data analysis, feature selection, model building, training, hyperparameter tuning, and serving. AutoML Tables is specifically designed for this purpose. It allows users to build and deploy machine learning models on structured data without writing any code. It handles many of the complexities of model building automatically, including feature engineering, model selection, and hyperparameter tuning.
Here's a detailed breakdown:
- Reasoning for choosing A: AutoML Tables automates the entire machine learning workflow from data preparation to model deployment without requiring code. This aligns perfectly with the question's requirements.
- Reasoning for not choosing B: BigQuery ML requires writing SQL queries to create and train models, which violates the "without writing code" constraint.
- Reasoning for not choosing C: AI Platform Notebooks (now Vertex AI Workbench) necessitates writing code using libraries like pandas and TensorFlow/PyTorch, making it unsuitable for the no-code requirement.
- Reasoning for not choosing D: AI Platform (now Vertex AI) requires configuration and coding for hyperparameter tuning, which does not meet the no-code criteria.
Therefore, AutoML Tables is the most appropriate solution because it's a no-code platform that covers all the required steps.
- AutoML Tables, https://cloud.google.com/automl-tables
-
Question 8
You work for a public transportation company and need to build a model to estimate delay times for multiple transportation routes. Predictions are served directly to users in an app in real time. Because different seasons and population increases impact the data relevance, you will retrain the model every month. You want to follow Google-recommended best practices. How should you configure the end-to-end architecture of the predictive model?
- A. Configure Kubeflow Pipelines to schedule your multi-step workflow from training to deploying your model.
- B. Use a model trained and deployed on BigQuery ML, and trigger retraining with the scheduled query feature in BigQuery.
- C. Write a Cloud Functions script that launches a training and deploying job on AI Platform that is triggered by Cloud Scheduler.
- D. Use Cloud Composer to programmatically schedule a Dataflow job that executes the workflow from training to deploying your model.
Correct Answer:
A
Explanation:
The suggested answer A is correct.
Reason: Kubeflow Pipelines is the most suitable choice for configuring the end-to-end architecture of the predictive model in this scenario.
- It allows you to schedule a multi-step workflow, encompassing both training and deployment, which aligns with the requirement of retraining the model every month.
- Kubeflow Pipelines are designed for machine learning workflows and integrates well with Google Cloud Platform services, making it a Google-recommended best practice for managing ML pipelines.
- It provides a streamlined and scalable way to manage, automate, and track the entire ML process, from data ingestion to model deployment and monitoring.
Reasons for not choosing other options:
- B. BigQuery ML is a viable option for training and deploying models directly within BigQuery. However, it may not offer the same level of flexibility and control over the entire end-to-end workflow as Kubeflow Pipelines. Also, it might not be the most efficient choice for complex models or workflows that require extensive preprocessing or feature engineering. Moreover, BigQuery ML lacks end-to-end architecture comparing to Kubeflow.
- C. Cloud Functions can be used to trigger training and deployment jobs on AI Platform using Cloud Scheduler. However, this approach may require more manual configuration and management compared to Kubeflow Pipelines, which provides a more integrated and automated solution for managing ML workflows. Also, Cloud Scheduler alone doesn't ensure failure handling during pipeline execution.
- D. Cloud Composer (Apache Airflow) is a good choice for orchestrating data workflows and can be used to schedule Dataflow jobs for training and deploying models. However, Dataflow itself is primarily designed for data processing and transformation, rather than model deployment. While it can be integrated with model deployment services, it may not be the most direct or efficient approach. Also, Dataflow job can't deploy models.
- Citations:
- Kubeflow Documentation, https://www.kubeflow.org/docs/
- Google Cloud AI Platform Documentation, https://cloud.google.com/ai-platform/docs
-
Question 9
You are developing ML models with AI Platform for image segmentation on CT scans. You frequently update your model architectures based on the newest available research papers, and have to rerun training on the same dataset to benchmark their performance. You want to minimize computation costs and manual intervention while having version control for your code. What should you do?
- A. Use Cloud Functions to identify changes to your code in Cloud Storage and trigger a retraining job.
- B. Use the gcloud command-line tool to submit training jobs on AI Platform when you update your code.
- C. Use Cloud Build linked with Cloud Source Repositories to trigger retraining when new code is pushed to the repository.
- D. Create an automated workflow in Cloud Composer that runs daily and looks for changes in code in Cloud Storage using a sensor.
Correct Answer:
C
Explanation:
The suggested answer is C. Here's a detailed explanation:
Reasoning:
- The problem statement emphasizes minimizing computation costs and manual intervention while maintaining version control for the code.
- Option C, using Cloud Build linked with Cloud Source Repositories, perfectly addresses these requirements. Cloud Build provides a CI/CD pipeline that automatically triggers retraining whenever new code is pushed to the repository. This eliminates manual intervention and ensures that the latest code changes are always reflected in the model. Cloud Source Repositories handles version control seamlessly.
- This is aligned with best practices for MLOps, where automation and version control are crucial for efficient model development and deployment.
Why other options are not the best choice:
- Option A (Cloud Functions): While Cloud Functions can trigger retraining, they don't inherently provide version control. It would require extra configurations. Furthermore, Cloud Functions might not be suitable for long-running training jobs due to execution time limits.
- Option B (gcloud command-line tool): This approach necessitates manual intervention to submit training jobs, contradicting the requirement to minimize it. It does not provide an automated CI/CD pipeline.
- Option D (Cloud Composer): Cloud Composer can automate workflows, but it is overkill for this specific scenario. Using a sensor to check for changes in Cloud Storage is less efficient than using a trigger based on code commits in a repository. Also, it lacks the tight integration with version control that Cloud Build provides.
In summary, Cloud Build with Cloud Source Repositories is the most efficient and automated solution, providing version control and minimizing manual intervention, aligning perfectly with the question's requirements.
Therefore, I agree with the suggested answer.
Citations:
- Cloud Build Documentation, https://cloud.google.com/build/docs
- Cloud Source Repositories Documentation, https://cloud.google.com/source-repositories/docs
-
Question 10
Your team needs to build a model that predicts whether images contain a driver's license, passport, or credit card. The data engineering team already built the pipeline and generated a dataset composed of 10,000 images with driver's licenses, 1,000 images with passports, and 1,000 images with credit cards. You now have to train a model with the following label map: [`˜drivers_license', `˜passport', `˜credit_card']. Which loss function should you use?
- A. Categorical hinge
- B. Binary cross-entropy
- C. Categorical cross-entropy
- D. Sparse categorical cross-entropy
Correct Answer:
C
Explanation:
The suggested answer of C, Categorical cross-entropy, is correct.
Reasoning:
The problem is a multi-class classification task where each image can belong to one of the three classes: driver's license, passport, or credit card. The classes are mutually exclusive. Categorical cross-entropy is the appropriate loss function for such problems, especially when the labels are one-hot encoded or represented as a probability distribution. While the question does not explicitly state that the labels are one-hot encoded, categorical cross-entropy handles multi-class classification effectively.
Why other options are not suitable:
-
A. Categorical hinge: Categorical hinge loss, like the multiclass SVM loss, aims to maximize the margin between the correct class and the incorrect classes. It is less common than categorical cross-entropy for image classification problems.
-
B. Binary cross-entropy: Binary cross-entropy is used for binary classification problems (i.e., where there are only two classes). In this case, we have three classes, so binary cross-entropy is not suitable.
-
D. Sparse categorical cross-entropy: Sparse categorical cross-entropy is used when the labels are provided as integers instead of one-hot encoded vectors. While it could potentially work if the labels are integers (e.g., 0 for driver's license, 1 for passport, and 2 for credit card), categorical cross-entropy is generally preferred, and the default assumption is that categorical cross-entropy expects one-hot encoded labels unless specified otherwise. The question does not state that the labels are integers. If the labels are integers, this would be the correct answer.
In summary, the selection of categorical cross-entropy aligns with best practices for multi-class classification scenarios, providing a suitable approach for training the model to differentiate among the three document types.
Citations:
- Cross-Entropy Loss Function, https://machinelearningmastery.com/cross-entropy-for-machine-learning/
- Loss functions, https://www.tensorflow.org/api_docs/python/tf/keras/losses
About This Practice Material
This is independent study material to help you prepare for the Google Professional Machine Learning Engineer (PMLE) exam. It is not affiliated with, endorsed by, or sponsored by Google or any certification body. All product names, certification names, trademarks, and exam codes are the property of their respective owners and are used here for descriptive (nominative) purposes only.
We do not provide real exam questions, brain dumps, or any guarantee of passing. All questions are original practice items compiled from publicly available community discussions and AI-generated explanations, aligned to the publicly available exam objectives.