AI0-001 Machine Learning and Deep Learning Practice Question
Exhibit
Refer to the exhibit.
JSON config:
{
"layers": [
{"type": "Dense", "units": 128, "activation": "relu"},
{"type": "Dense", "units": 64, "activation": "relu"},
{"type": "Dense", "units": 10, "activation": "softmax"}
],
"optimizer": "adam",
"loss": "mean_squared_error",
"metrics": ["accuracy"]
}The exhibit shows a model configuration for a classification task with 10 classes. What is wrong with this setup?
⚠ Common exam trap
The AI0-001 exam often tests the misconception that MSE can be used as a generic loss function for any task, but in classification, crossentropy is specifically designed to handle probability distributions and one-hot encoding.
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
✓
The loss function should be categorical crossentropy, not mean squared error
In a multi-class classification task with 10 classes, the correct loss function is categorical crossentropy because it measures the dissimilarity between the true probability distribution and the predicted probability distribution. Mean squared error (MSE) is designed for regression tasks and penalizes errors in a way that is not suitable for classification probabilities, leading to poor gradient behavior and slower convergence.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
The loss function should be categorical crossentropy, not mean squared error
Why this is correct
Mean squared error suits regression, penalising numeric distance between continuous outputs. For 10-class classification, categorical crossentropy compares predicted probability distributions against one-hot labels, giving the correct gradient signal; MSE on softmax outputs produces weak, misleading updates.
- ✗
The metric should be precision, not accuracy
Why it's wrong here
Accuracy is a valid metric for balanced 10-class classification, so replacing it with precision does not fix the configuration. Precision is tempting because it suits imbalanced binary detection, but here the actual fault lies in the output layer's activation or node count, not the metric.
- ✗
The activation should be sigmoid in hidden layers
Why it's wrong here
Sigmoid in hidden layers saturates gradients and is not the configuration error for a 10-class task. It is tempting because sigmoid suits binary output, yet multi-class classification requires softmax on the output layer with ten nodes, which is the actual defect.
- ✗
The optimizer should be SGD, not Adam
Why it's wrong here
Adam is a sound optimiser for multi-class classification, so switching to SGD does not correct the setup. SGD is tempting for fine-tuning or when memory is constrained, but the genuine fault is the output layer's activation and unit count, not the optimiser choice.
About these practice questions
One of 962 original AI0-001 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
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.