WGU D682 Task 1 EXAM Artificial
Intelligence Optimization for Computer
Scientists | Complete PA Solution, Python AI
Model, GitLab, RMSE & R² | 2026/2027
Updated
Practice Question Bank & Answer Rationale
THIS PACK CONTAINS
98 exam-style multiple-choice questions. Each question includes the correct answer and a complete rationale
for focused revision.
COVERAGE
This exam assesses the practical and theoretical competencies required to complete WGU D682 Task 1:
building, optimizing, and evaluating an AI regression model in Python, managing the solution in GitLab, and
reporting model performance using RMSE and R². It emphasizes reproducible workflows, optimization
techniques, and professional documentation standards expected of computer scientists.
STUDY GUIDE
Recommended duration: 3 hours. Passing target: 80% (Competency-based; minimum passing score varies
by rubric).
HIGHP - Page 1 of 33
,1. A data scientist trains a linear regression model and obtains R² = 0.92 on the training
set but R² = 0.41 on the test set. Which action best addresses this discrepancy?
[ ] A. Increase the learning rate and retrain the model.
[ ] B. Apply regularization (e.g., Ridge/Lasso) or reduce model complexity.
[ ] C. Add more polynomial features to capture additional variance.
[ ] D. Report the training R² as the model's final performance metric.
CORRECT: B. Apply regularization (e.g., Ridge/Lasso) or reduce model complexity.
The large gap between training and test R² indicates overfitting; regularization or reducing complexity
improves generalization. Increasing learning rate (A) is irrelevant for closed-form linear regression and may
worsen instability. Adding polynomial features (C) increases overfitting risk. Reporting training R² (D) is
methodologically invalid and misleading.
2. Which GitLab workflow best supports reproducible AI optimization experiments for a
D682 Task 1 submission?
[ ] A. Commit all code directly to the main branch without branches or tags.
[ ] B. Use feature branches, merge requests, and tag the final submission commit.
[ ] C. Store only the final notebook and omit the dataset and environment files.
[ ] D. Email the code to the evaluator instead of using the repository.
CORRECT: B. Use feature branches, merge requests, and tag the final submission commit.
Feature branches, merge requests, and tags provide traceability, peer review, and a clear submission
snapshot, which are core GitLab best practices. Direct commits to main (A) lack review and rollback safety.
Omitting data/environment (C) breaks reproducibility. Emailing code (D) bypasses the required GitLab
workflow.
3. A model's RMSE is 12.5 on a target variable whose standard deviation is 50. Which
interpretation is most appropriate?
[ ] A. The model explains 25% of the variance in the target.
[ ] B. The model's typical prediction error is about 25% of the target's variability.
[ ] C. The model is unusable because RMSE exceeds 10.
[ ] D. RMSE cannot be interpreted without knowing R².
CORRECT: B. The model's typical prediction error is about 25% of the target's variability.
RMSE relative to the target's standard deviation (12.5/50 = 0.25) indicates the typical error is roughly 25% of
the target's spread, a useful normalized error measure. Option A confuses RMSE with R². Option C applies
an arbitrary threshold. Option D is false; RMSE is interpretable in the target's units.
HIGHP - Page 2 of 33
,4. In Python, which scikit-learn class is most appropriate for performing an exhaustive
search over a specified hyperparameter grid with cross-validation?
[ ] A. GridSearchCV
[ ] B. train_test_split
[ ] C. StandardScaler
[ ] D. Pipeline
CORRECT: A. GridSearchCV
GridSearchCV exhaustively searches a hyperparameter grid and evaluates each combination using
cross-validation. train_test_split (B) only partitions data. StandardScaler (C) is for feature scaling. Pipeline (D)
chains preprocessing and estimators but does not perform the search itself.
5. A regression model yields R² = 0.85 and RMSE = 4.2 on the test set. Which statement is
most accurate?
[ ] A. The model explains 85% of the variance in the target and has an average prediction error of 4.2
units.
[ ] B. The model's predictions are correct 85% of the time.
[ ] C. RMSE = 4.2 means 4.2% of predictions are errors.
[ ] D. R² = 0.85 guarantees the model will generalize to any future data.
CORRECT: A. The model explains 85% of the variance in the target and has an average prediction
error of 4.2 units.
R² represents the proportion of variance explained (85%), and RMSE is the average magnitude of prediction
error in the target's units (4.2). Option B misinterprets R² as accuracy. Option C misinterprets RMSE as a
percentage. Option D overstates generalization guarantees.
6. Which technique is most appropriate for handling missing values in a numerical feature
before training a regression model in a scikit-learn pipeline?
[ ] A. SimpleImputer with strategy='mean' or 'median'
[ ] B. OneHotEncoder
[ ] C. LabelEncoder
[ ] D. PolynomialFeatures
CORRECT: A. SimpleImputer with strategy='mean' or 'median'
SimpleImputer replaces missing numerical values using mean, median, or other strategies. OneHotEncoder
(B) is for categorical variables. LabelEncoder (C) encodes categorical labels. PolynomialFeatures (D)
generates interaction terms, not imputation.
HIGHP - Page 3 of 33
, 7. When optimizing an AI model, why is it important to set a random_state in functions like
train_test_split and model initialization?
[ ] A. It speeds up model training significantly.
[ ] B. It ensures reproducibility of results across runs.
[ ] C. It prevents overfitting automatically.
[ ] D. It increases the R² score.
CORRECT: B. It ensures reproducibility of results across runs.
Setting random_state makes random operations deterministic, ensuring the same split and initialization
across runs for reproducibility. It does not speed up training (A), prevent overfitting (C), or artificially boost R²
(D).
8. A team notices that adding more features to a linear regression model decreases test
R² while training R² continues to rise. What is the most likely cause?
[ ] A. Underfitting due to too few features.
[ ] B. Overfitting due to increased model complexity.
[ ] C. Data leakage from the test set.
[ ] D. Incorrect RMSE calculation.
CORRECT: B. Overfitting due to increased model complexity.
Rising training R² with falling test R² is the classic signature of overfitting as model complexity increases.
Underfitting (A) would show low training R². Data leakage (C) typically inflates test performance. RMSE
miscalculation (D) would not cause this pattern.
9. Which GitLab feature allows a data scientist to automatically run tests and validate code
whenever changes are pushed?
[ ] A. GitLab CI/CD pipelines
[ ] B. GitLab Issues
[ ] C. GitLab Wiki
[ ] D. GitLab Snippets
CORRECT: A. GitLab CI/CD pipelines
GitLab CI/CD pipelines execute automated jobs (e.g., tests, linting) on code changes. Issues (B) track tasks.
Wiki (C) hosts documentation. Snippets (D) share small code fragments. Only pipelines provide automated
validation.
10. In a GitLab CI pipeline for an ML project, which configuration best ensures the
model-training job only runs after the unit-test job passes on merge requests?
[ ] A. Use `needs: [unit_test]` in the training job and restrict its `rules` to merge request pipelines.
[ ] B. Set `when: always` on the training job so it executes regardless of prior stage results.
HIGHP - Page 4 of 33
Intelligence Optimization for Computer
Scientists | Complete PA Solution, Python AI
Model, GitLab, RMSE & R² | 2026/2027
Updated
Practice Question Bank & Answer Rationale
THIS PACK CONTAINS
98 exam-style multiple-choice questions. Each question includes the correct answer and a complete rationale
for focused revision.
COVERAGE
This exam assesses the practical and theoretical competencies required to complete WGU D682 Task 1:
building, optimizing, and evaluating an AI regression model in Python, managing the solution in GitLab, and
reporting model performance using RMSE and R². It emphasizes reproducible workflows, optimization
techniques, and professional documentation standards expected of computer scientists.
STUDY GUIDE
Recommended duration: 3 hours. Passing target: 80% (Competency-based; minimum passing score varies
by rubric).
HIGHP - Page 1 of 33
,1. A data scientist trains a linear regression model and obtains R² = 0.92 on the training
set but R² = 0.41 on the test set. Which action best addresses this discrepancy?
[ ] A. Increase the learning rate and retrain the model.
[ ] B. Apply regularization (e.g., Ridge/Lasso) or reduce model complexity.
[ ] C. Add more polynomial features to capture additional variance.
[ ] D. Report the training R² as the model's final performance metric.
CORRECT: B. Apply regularization (e.g., Ridge/Lasso) or reduce model complexity.
The large gap between training and test R² indicates overfitting; regularization or reducing complexity
improves generalization. Increasing learning rate (A) is irrelevant for closed-form linear regression and may
worsen instability. Adding polynomial features (C) increases overfitting risk. Reporting training R² (D) is
methodologically invalid and misleading.
2. Which GitLab workflow best supports reproducible AI optimization experiments for a
D682 Task 1 submission?
[ ] A. Commit all code directly to the main branch without branches or tags.
[ ] B. Use feature branches, merge requests, and tag the final submission commit.
[ ] C. Store only the final notebook and omit the dataset and environment files.
[ ] D. Email the code to the evaluator instead of using the repository.
CORRECT: B. Use feature branches, merge requests, and tag the final submission commit.
Feature branches, merge requests, and tags provide traceability, peer review, and a clear submission
snapshot, which are core GitLab best practices. Direct commits to main (A) lack review and rollback safety.
Omitting data/environment (C) breaks reproducibility. Emailing code (D) bypasses the required GitLab
workflow.
3. A model's RMSE is 12.5 on a target variable whose standard deviation is 50. Which
interpretation is most appropriate?
[ ] A. The model explains 25% of the variance in the target.
[ ] B. The model's typical prediction error is about 25% of the target's variability.
[ ] C. The model is unusable because RMSE exceeds 10.
[ ] D. RMSE cannot be interpreted without knowing R².
CORRECT: B. The model's typical prediction error is about 25% of the target's variability.
RMSE relative to the target's standard deviation (12.5/50 = 0.25) indicates the typical error is roughly 25% of
the target's spread, a useful normalized error measure. Option A confuses RMSE with R². Option C applies
an arbitrary threshold. Option D is false; RMSE is interpretable in the target's units.
HIGHP - Page 2 of 33
,4. In Python, which scikit-learn class is most appropriate for performing an exhaustive
search over a specified hyperparameter grid with cross-validation?
[ ] A. GridSearchCV
[ ] B. train_test_split
[ ] C. StandardScaler
[ ] D. Pipeline
CORRECT: A. GridSearchCV
GridSearchCV exhaustively searches a hyperparameter grid and evaluates each combination using
cross-validation. train_test_split (B) only partitions data. StandardScaler (C) is for feature scaling. Pipeline (D)
chains preprocessing and estimators but does not perform the search itself.
5. A regression model yields R² = 0.85 and RMSE = 4.2 on the test set. Which statement is
most accurate?
[ ] A. The model explains 85% of the variance in the target and has an average prediction error of 4.2
units.
[ ] B. The model's predictions are correct 85% of the time.
[ ] C. RMSE = 4.2 means 4.2% of predictions are errors.
[ ] D. R² = 0.85 guarantees the model will generalize to any future data.
CORRECT: A. The model explains 85% of the variance in the target and has an average prediction
error of 4.2 units.
R² represents the proportion of variance explained (85%), and RMSE is the average magnitude of prediction
error in the target's units (4.2). Option B misinterprets R² as accuracy. Option C misinterprets RMSE as a
percentage. Option D overstates generalization guarantees.
6. Which technique is most appropriate for handling missing values in a numerical feature
before training a regression model in a scikit-learn pipeline?
[ ] A. SimpleImputer with strategy='mean' or 'median'
[ ] B. OneHotEncoder
[ ] C. LabelEncoder
[ ] D. PolynomialFeatures
CORRECT: A. SimpleImputer with strategy='mean' or 'median'
SimpleImputer replaces missing numerical values using mean, median, or other strategies. OneHotEncoder
(B) is for categorical variables. LabelEncoder (C) encodes categorical labels. PolynomialFeatures (D)
generates interaction terms, not imputation.
HIGHP - Page 3 of 33
, 7. When optimizing an AI model, why is it important to set a random_state in functions like
train_test_split and model initialization?
[ ] A. It speeds up model training significantly.
[ ] B. It ensures reproducibility of results across runs.
[ ] C. It prevents overfitting automatically.
[ ] D. It increases the R² score.
CORRECT: B. It ensures reproducibility of results across runs.
Setting random_state makes random operations deterministic, ensuring the same split and initialization
across runs for reproducibility. It does not speed up training (A), prevent overfitting (C), or artificially boost R²
(D).
8. A team notices that adding more features to a linear regression model decreases test
R² while training R² continues to rise. What is the most likely cause?
[ ] A. Underfitting due to too few features.
[ ] B. Overfitting due to increased model complexity.
[ ] C. Data leakage from the test set.
[ ] D. Incorrect RMSE calculation.
CORRECT: B. Overfitting due to increased model complexity.
Rising training R² with falling test R² is the classic signature of overfitting as model complexity increases.
Underfitting (A) would show low training R². Data leakage (C) typically inflates test performance. RMSE
miscalculation (D) would not cause this pattern.
9. Which GitLab feature allows a data scientist to automatically run tests and validate code
whenever changes are pushed?
[ ] A. GitLab CI/CD pipelines
[ ] B. GitLab Issues
[ ] C. GitLab Wiki
[ ] D. GitLab Snippets
CORRECT: A. GitLab CI/CD pipelines
GitLab CI/CD pipelines execute automated jobs (e.g., tests, linting) on code changes. Issues (B) track tasks.
Wiki (C) hosts documentation. Snippets (D) share small code fragments. Only pipelines provide automated
validation.
10. In a GitLab CI pipeline for an ML project, which configuration best ensures the
model-training job only runs after the unit-test job passes on merge requests?
[ ] A. Use `needs: [unit_test]` in the training job and restrict its `rules` to merge request pipelines.
[ ] B. Set `when: always` on the training job so it executes regardless of prior stage results.
HIGHP - Page 4 of 33