D682 | Artificial Intelligence Optimization for Computer Scientists
WGU D682
Artificial Intelligence Optimization for Computer
Scientists
Task 2 - AI Model Optimization
Baseline comparison, optimization experiments, Python implementation, GitLab structure, and
validation evidence
PRACTICE DATASET NOTICE
This Task 2 reference continues the fully populated synthetic dataset from Task 1. The dataset and
all reported metric values are practice results generated for this resource. They are not presented
as WGU-supplied data or official WGU evaluation results.
2026/2027 Updated
Professional D682 Task 2 reference - complete worked optimization example
D682 Task 2 - AI Model Optimization | Page 1
, D682 | Artificial Intelligence Optimization for Computer Scientists
Document Purpose and Alignment
D682 emphasizes implementing and optimizing artificial intelligence solutions through research,
testing, performance measurement, predictive interpretation, and adaptation. WGU’s public course
description specifically identifies optimization for enhanced performance and efficiency as a central
competency. Current student completion reports also describe Task 2 as the stage in which the Task 1
model is deliberately improved and compared against its original baseline.
This reference therefore treats optimization as an experimental process rather than as a single
unexplained model replacement. The Task 1 Random Forest is reproduced with the same dataset,
target, train/test split, and random seed. Four optimization experiments are then measured under the
same conditions. The final recommendation is based on held-out predictive performance and
documented trade-offs.
Alignment limitation
The authenticated September 2026 Task 2 prompt and private WGU rubric are not publicly
available. This document does not claim to reproduce private rubric language verbatim. It follows
the strongest publicly corroborated D682 Task 2 pattern and clearly separates the synthetic
practice data from WGU course resources.
Contents
1. Task 1 Baseline Carried Forward
2. Optimization Objective and Experimental Controls
3. Optimization Technique 1 - Hyperparameter Search
4. Optimization Technique 2 - Complexity Control
5. Optimization Technique 3 - Gradient Boosting
6. Optimization Technique 4 - Voting Ensemble
7. Results and Model Selection
8. Validation, Trade-offs, and Interpretation
9. GitLab and Submission Structure
10. Conclusion
References
Appendix A - Complete Python Implementation
Appendix B - requirements.txt and Run Instructions
Appendix C - Practice Dataset and Data Dictionary
Appendix D - Suggested Commit Evidence
1. Task 1 Baseline Carried Forward
Task 2 begins with the unoptimized model produced in Task 1. Recreating that baseline is essential
because an optimization claim is meaningful only when the improved model is measured against the
same reference under the same conditions. The baseline is a scikit-learn RandomForestRegressor
using default model-complexity settings with random_state=42. The practice dataset contains 200
D682 Task 2 - AI Model Optimization | Page 2
, D682 | Artificial Intelligence Optimization for Computer Scientists
observations, ten predictors, and the continuous target healthRiskScore. The same 80/20 train/test
split from Task 1 is preserved.
Baseline component Value
Dataset D682_Task2_Practice_Dataset.csv - synthetic practice data
Rows 200 complete observations
Predictors 10 numeric environmental/community-health features
Target healthRiskScore
Split 80% training / 20% testing
Random seed 42
Baseline estimator RandomForestRegressor(random_state=42)
Baseline RMSE 2.7455
Baseline MAE 1.9523
Baseline R² 0.7960
The baseline already explains a substantial portion of the held-out variation, but the residual error
remains large enough to justify optimization. Task 2 therefore attempts to reduce RMSE and MAE
while increasing R² without changing the evaluation split.
2. Optimization Objective and Experimental Controls
The primary optimization objective is predictive generalization on unseen data. RMSE is used as the
leading selection metric because it penalizes larger prediction errors more heavily. MAE is retained
as a complementary measure of typical absolute error, and R² measures the fraction of held-out
target variance explained by the model. No optimization decision is made from training performance
alone.
2.1 Controlled experimental conditions
The same 200-row synthetic practice dataset is used for every experiment.
The same target variable, healthRiskScore, is used throughout.
The same 80/20 split and random_state=42 are retained so that test-set comparisons remain
consistent.
The final test set is not used to fit model parameters. Cross-validation is performed only on the
training partition during hyperparameter search.
Each experiment is documented separately so the effect of the optimization choice remains
interpretable.
Scikit-learn recommends parameter searches such as RandomizedSearchCV when estimator
performance depends strongly on hyperparameters, and its documentation notes that Random
Forest parameters such as n_estimators and max_depth materially affect model behavior. Random
Forest documentation also warns that fully grown trees can become large, making tree-size controls
relevant to regularization and efficiency.
D682 Task 2 - AI Model Optimization | Page 3
WGU D682
Artificial Intelligence Optimization for Computer
Scientists
Task 2 - AI Model Optimization
Baseline comparison, optimization experiments, Python implementation, GitLab structure, and
validation evidence
PRACTICE DATASET NOTICE
This Task 2 reference continues the fully populated synthetic dataset from Task 1. The dataset and
all reported metric values are practice results generated for this resource. They are not presented
as WGU-supplied data or official WGU evaluation results.
2026/2027 Updated
Professional D682 Task 2 reference - complete worked optimization example
D682 Task 2 - AI Model Optimization | Page 1
, D682 | Artificial Intelligence Optimization for Computer Scientists
Document Purpose and Alignment
D682 emphasizes implementing and optimizing artificial intelligence solutions through research,
testing, performance measurement, predictive interpretation, and adaptation. WGU’s public course
description specifically identifies optimization for enhanced performance and efficiency as a central
competency. Current student completion reports also describe Task 2 as the stage in which the Task 1
model is deliberately improved and compared against its original baseline.
This reference therefore treats optimization as an experimental process rather than as a single
unexplained model replacement. The Task 1 Random Forest is reproduced with the same dataset,
target, train/test split, and random seed. Four optimization experiments are then measured under the
same conditions. The final recommendation is based on held-out predictive performance and
documented trade-offs.
Alignment limitation
The authenticated September 2026 Task 2 prompt and private WGU rubric are not publicly
available. This document does not claim to reproduce private rubric language verbatim. It follows
the strongest publicly corroborated D682 Task 2 pattern and clearly separates the synthetic
practice data from WGU course resources.
Contents
1. Task 1 Baseline Carried Forward
2. Optimization Objective and Experimental Controls
3. Optimization Technique 1 - Hyperparameter Search
4. Optimization Technique 2 - Complexity Control
5. Optimization Technique 3 - Gradient Boosting
6. Optimization Technique 4 - Voting Ensemble
7. Results and Model Selection
8. Validation, Trade-offs, and Interpretation
9. GitLab and Submission Structure
10. Conclusion
References
Appendix A - Complete Python Implementation
Appendix B - requirements.txt and Run Instructions
Appendix C - Practice Dataset and Data Dictionary
Appendix D - Suggested Commit Evidence
1. Task 1 Baseline Carried Forward
Task 2 begins with the unoptimized model produced in Task 1. Recreating that baseline is essential
because an optimization claim is meaningful only when the improved model is measured against the
same reference under the same conditions. The baseline is a scikit-learn RandomForestRegressor
using default model-complexity settings with random_state=42. The practice dataset contains 200
D682 Task 2 - AI Model Optimization | Page 2
, D682 | Artificial Intelligence Optimization for Computer Scientists
observations, ten predictors, and the continuous target healthRiskScore. The same 80/20 train/test
split from Task 1 is preserved.
Baseline component Value
Dataset D682_Task2_Practice_Dataset.csv - synthetic practice data
Rows 200 complete observations
Predictors 10 numeric environmental/community-health features
Target healthRiskScore
Split 80% training / 20% testing
Random seed 42
Baseline estimator RandomForestRegressor(random_state=42)
Baseline RMSE 2.7455
Baseline MAE 1.9523
Baseline R² 0.7960
The baseline already explains a substantial portion of the held-out variation, but the residual error
remains large enough to justify optimization. Task 2 therefore attempts to reduce RMSE and MAE
while increasing R² without changing the evaluation split.
2. Optimization Objective and Experimental Controls
The primary optimization objective is predictive generalization on unseen data. RMSE is used as the
leading selection metric because it penalizes larger prediction errors more heavily. MAE is retained
as a complementary measure of typical absolute error, and R² measures the fraction of held-out
target variance explained by the model. No optimization decision is made from training performance
alone.
2.1 Controlled experimental conditions
The same 200-row synthetic practice dataset is used for every experiment.
The same target variable, healthRiskScore, is used throughout.
The same 80/20 split and random_state=42 are retained so that test-set comparisons remain
consistent.
The final test set is not used to fit model parameters. Cross-validation is performed only on the
training partition during hyperparameter search.
Each experiment is documented separately so the effect of the optimization choice remains
interpretable.
Scikit-learn recommends parameter searches such as RandomizedSearchCV when estimator
performance depends strongly on hyperparameters, and its documentation notes that Random
Forest parameters such as n_estimators and max_depth materially affect model behavior. Random
Forest documentation also warns that fully grown trees can become large, making tree-size controls
relevant to regularization and efficiency.
D682 Task 2 - AI Model Optimization | Page 3