- A
Undersample the majority class to balance the dataset
Why wrong: Undersampling discards valuable data and may reduce model performance.
- B
Oversample the minority class using synthetic image generation
Why wrong: Oversampling can cause overfitting, especially with limited positive samples.
- C
Assign higher class weights to the positive class in the loss function
Class weights force the model to focus on the minority class, improving recall.
- D
Replace the CNN with a transformer-based architecture
Why wrong: Changing architecture does not directly address class imbalance.
Handling Class Imbalance in Machine Learning
This AI0-001 practice question tests your understanding of machine learning and deep learning. Read the scenario carefully and evaluate each option against the stated constraints before committing to an answer. After answering, compare your reasoning against the explanation and wrong-answer breakdown below. Once you have made your selection, read the full explanation to reinforce the concept and understand why each distractor is designed to mislead on exam day.
A healthcare startup is developing a deep learning model to detect diabetic retinopathy from retinal fundus images. The dataset contains 50,000 images, but only 5% are labeled as positive for the disease. The team uses a convolutional neural network (CNN) with a final sigmoid layer and binary cross-entropy loss. After training for 20 epochs, the model achieves 95% accuracy on the test set, but the recall for the positive class is only 10%. The team suspects the model is biased toward the negative class due to class imbalance. The data is stored in a secure environment, and no additional labeled data can be obtained. The team has access to the following techniques: oversampling the minority class, undersampling the majority class, using class weights in the loss function, applying data augmentation, and using a different architecture. Which course of action is most likely to improve recall for the positive class while maintaining reasonable overall performance?
Clue words in this question
Noticing these words before you look at the options changes how you read each choice.
Clue:
"most likely"Why it matters: Probability qualifier — the question wants the most probable cause or outcome, not a guaranteed one. Eliminate low-probability options.
Quick Answer
The answer is assigning higher class weights to the positive class in the loss function. This technique directly increases the penalty for misclassifying the minority positive samples during backpropagation, forcing the CNN to learn more discriminative features for diabetic retinopathy without altering the original dataset distribution—a critical constraint when no additional labeled data can be obtained. On the CompTIA AI+ AI0-001 exam, this scenario tests your understanding that class imbalance handling techniques like weighting preserve the natural data distribution while improving recall, unlike oversampling or undersampling which risk overfitting or information loss. A common trap is assuming data augmentation alone solves imbalance, but it does not address the gradient dominance of the majority class. For the exam, remember: weights adjust loss, not data—think of it as turning up the volume on minority mistakes.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
Assign higher class weights to the positive class in the loss function
Assigning higher class weights to the positive class in the loss function directly penalizes misclassifications of the minority class during training. This forces the model to pay more attention to positive samples without altering the dataset distribution, which is critical when no additional labeled data can be obtained and the data is in a secure environment. It improves recall by increasing the gradient contribution from positive samples, while maintaining overall performance because the model still sees the original data distribution.
Key principle: Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Undersample the majority class to balance the dataset
Why it's wrong here
Undersampling discards valuable data and may reduce model performance.
- ✗
Oversample the minority class using synthetic image generation
Why it's wrong here
Oversampling can cause overfitting, especially with limited positive samples.
- ✓
Assign higher class weights to the positive class in the loss function
Why this is correct
Class weights force the model to focus on the minority class, improving recall.
Clue confirmation
The clue word "most likely" in the question point toward this answer.
Related concept
Read the scenario before looking for a memorised answer.
- ✗
Replace the CNN with a transformer-based architecture
Why it's wrong here
Changing architecture does not directly address class imbalance.
Common exam traps
Common exam trap: answer the scenario, not the keyword
The trap here is that candidates often choose oversampling (Option B) as the default solution for class imbalance, but fail to recognize that synthetic image generation for medical images can introduce unrealistic patterns and is not a standard or safe technique, whereas class weights are a lightweight, data-preserving approach that directly addresses the loss function.
Detailed technical explanation
How to think about this question
Class weighting works by multiplying the binary cross-entropy loss for each positive sample by a weight factor (e.g., weight = number of negative samples / number of positive samples). This effectively increases the loss contribution from positive misclassifications, making the optimizer prioritize learning features that distinguish the minority class. In practice, weights can be computed as inverse class frequencies or using a heuristic like the 'balanced' mode in scikit-learn, and they do not require modifying the dataset or generating synthetic data.
KKey Concepts to Remember
- Read the scenario before looking for a memorised answer.
- Find the constraint that changes the correct option.
- Eliminate answers that are true in general but not in this case.
TExam Day Tips
- Watch for words such as best, first, most likely and least administrative effort.
- Review why wrong options are wrong, not only why the correct option is correct.
Key takeaway
Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.
Real-world example
How this comes up in practice
A practitioner preparing for the AI0-001 exam encounters this exact type of scenario on the job. The correct answer here is not the most general option — it is the best answer for the specific constraint described. Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option. Real exam questions reward reading the full scenario before eliminating options, because the constraint defines which answer fits.
Quick reference
OSI Model Reference
| Layer | Name | PDU | Key Protocols / Devices |
|---|---|---|---|
| 7 | Application | Data | HTTP, HTTPS, DNS, SMTP, FTP, SSH |
| 6 | Presentation | Data | TLS / SSL, JPEG, ASCII encoding |
| 5 | Session | Data | NetBIOS, RPC, SIP |
| 4 | Transport | Segment / Datagram | TCP, UDP |
| 3 | Network | Packet | IP, ICMP, OSPF — Routers |
| 2 | Data Link | Frame | Ethernet, Wi-Fi, PPP — Switches, Bridges |
| 1 | Physical | Bits | Cables, NICs, Hubs, Repeaters |
What to study next
Got this wrong? Here's your next step.
Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.
- →
Machine Learning and Deep Learning — study guide chapter
Learn the concepts, then practise the questions
- →
Machine Learning and Deep Learning practice questions
Targeted practice on this topic area only
- →
All AI0-001 questions
1,000 questions across all exam domains
- →
CompTIA AI+ AI0-001 study guide
Full concept coverage aligned to exam objectives
- →
AI0-001 practice test guide
How to use practice tests most effectively before exam day
Related practice questions
Related AI0-001 practice-question pages
Use these pages to review the topic behind this question. This is how one missed question becomes focused revision.
AI Infrastructure and Technologies practice questions
Practise AI0-001 questions linked to AI Infrastructure and Technologies.
AI Security practice questions
Practise AI0-001 questions linked to AI Security.
AI Concepts and Foundations practice questions
Practise AI0-001 questions linked to AI Concepts and Foundations.
AI Concepts and Techniques practice questions
Practise AI0-001 questions linked to AI Concepts and Techniques.
Machine Learning and Deep Learning practice questions
Practise AI0-001 questions linked to Machine Learning and Deep Learning.
AI Models and Data Engineering practice questions
Practise AI0-001 questions linked to AI Models and Data Engineering.
Implementing AI Solutions practice questions
Practise AI0-001 questions linked to Implementing AI Solutions.
AI Implementation and Operations practice questions
Practise AI0-001 questions linked to AI Implementation and Operations.
AI Security, Ethics and Governance practice questions
Practise AI0-001 questions linked to AI Security, Ethics and Governance.
AI Governance and Ethics practice questions
Practise AI0-001 questions linked to AI Governance and Ethics.
CompTIA A+ hardware practice questions
Practise AI0-001 questions linked to CompTIA A+ hardware.
CompTIA A+ mobile devices practice questions
Practise AI0-001 questions linked to CompTIA A+ mobile devices.
Practice this exam
Start a free AI0-001 practice session
Short sessions build daily habit. Longer sessions build exam-day stamina. Try a timed session to simulate real conditions.
FAQ
Questions learners often ask
What does this AI0-001 question test?
Machine Learning and Deep Learning — This question tests Machine Learning and Deep Learning — Read the scenario before looking for a memorised answer..
What is the correct answer to this question?
The correct answer is: Assign higher class weights to the positive class in the loss function — Assigning higher class weights to the positive class in the loss function directly penalizes misclassifications of the minority class during training. This forces the model to pay more attention to positive samples without altering the dataset distribution, which is critical when no additional labeled data can be obtained and the data is in a secure environment. It improves recall by increasing the gradient contribution from positive samples, while maintaining overall performance because the model still sees the original data distribution.
What should I do if I get this AI0-001 question wrong?
Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.
Are there clue words in this question I should notice?
Yes — watch for: "most likely". Probability qualifier — the question wants the most probable cause or outcome, not a guaranteed one. Eliminate low-probability options.
What is the key concept behind this question?
Read the scenario before looking for a memorised answer.
About these practice questions
Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →
Same concept, more angles
2 more ways this is tested on AI0-001
These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.
Variation 1. A fraud detection model is trained on a dataset where only 0.1% of transactions are fraudulent. The model achieves 99.9% accuracy but fails to catch most frauds. Which metric should the team prioritize, and which technique could help?
hard- A.Mean Squared Error; use L2 regularization
- B.F1 score; use principal component analysis
- C.Accuracy; collect more data
- ✓ D.Precision-Recall AUC; use oversampling like SMOTE
Why D: The dataset is highly imbalanced (0.1% fraud), so 99.9% accuracy is misleading because a model that predicts 'not fraud' for every transaction achieves it. Precision-Recall AUC focuses on the positive class (fraud) and is robust to class imbalance, unlike accuracy or ROC-AUC. Oversampling like SMOTE generates synthetic fraud samples to balance the dataset, helping the model learn the minority class patterns.
Variation 2. A financial institution uses a deep learning model for fraud detection. The model is a feedforward neural network with three hidden layers. It was trained on a balanced dataset of 100,000 transactions. During deployment, the model achieves high accuracy on the test set but the fraud detection rate (true positive rate) is only 40% while the false positive rate is 0.1%. The business requires a true positive rate of at least 80%. Which of the following actions is most likely to achieve the required true positive rate while minimizing the increase in false positives?
hard- A.Increase the number of hidden layers to five to capture more complex patterns
- B.Use synthetic minority oversampling (SMOTE) to rebalance the training set
- ✓ C.Change the threshold for classifying a transaction as fraud from the default 0.5 to a lower value
- D.Add L2 regularization to reduce overfitting
Why C: Option A (increase hidden layers) may capture more complexity but does not directly increase TPR and could overfit. Option B (SMOTE) rebalances the training set, but the dataset is already balanced, so this is unlikely to improve TPR. Option D (L2 regularization) reduces overfitting but increases bias, which could lower TPR. Option C (change threshold) is the most direct approach: lowering the classification threshold increases the true positive rate, and by tuning, it can achieve 80% TPR with a minimal increase in false positives.
Keep practising
More AI0-001 practice questions
- A data science team uses a CI/CD pipeline for ML models. They need to ensure that each model version is traceable back t…
- A company is deploying a large language model for customer support. They want to reduce the number of off-topic or nonse…
- A data scientist fine-tunes a large language model for a legal document summarization task. After fine-tuning, the model…
- A team is designing an AI system for autonomous driving. They need to decide between an end-to-end deep learning approac…
- A team is using Kubeflow to orchestrate ML workflows on Kubernetes. They need to ensure reproducibility, track experimen…
- A healthcare organization deploys an AI system to analyze medical images and detect anomalies. During a routine audit, t…
Last reviewed: Jun 24, 2026
This AI0-001 practice question is part of Courseiva's free CompTIA certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the AI0-001 exam.
Question Discussion
Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.
Sign in to join the discussion.