WGU D603 Machine Learning – Task 1: Classification Data Mining Models |
Random Forest Medical Readmission Analysis, Python Code & Complete 75
Solutions | 2026/2027 Updated
1. Which statement best defines classification in medical readmission analysis at
WGU D603 Task 1?
A) Classification predicts discrete class labels like readmission yes/no 0/1,
supervised learning with labeled data, Random Forest learns mapping from
medical features age, prior admissions, comorbidity to readmission label, goal
maximize accuracy and recall for high-risk patients
B) Regression predicts continuous values like blood pressure
C) Clustering groups unlabeled patients without labels
D) PCA reduces dimensions without predicting labels
Answer: A
Rationale: Option A is correct because classification in medical readmission
predicts discrete labels readmission yes/no 0/1, supervised with labeled data,
Random Forest learns mapping from medical features age, prior admissions,
comorbidity to readmission label, goal maximize accuracy and recall for
high-risk patients. Option B is wrong because regression predicts continuous
values like blood pressure or length of stay, not discrete readmission yes/no.
Option C is wrong because clustering is unsupervised grouping unlabeled
patients without using readmission labels, while Task 1 is supervised
classification. Option D is wrong because PCA is dimensionality reduction to
reduce features, not to predict class labels.
,2. Refer to the Random Forest ensemble diagram below. How does bootstrap
sampling and majority voting predict medical readmission risk?
Figure 2: Refer to diagram for Q2 – Random Forest Medical Readmission
A) Input medical features age gender prior admissions length of stay diagnosis
medications lab results comorbidity index resampled via bootstrap with
replacement 100 times creating 100 bootstrap samples, each sample trains one
decision tree with random feature subset, Tree 1 splits comorbidity >=5, Tree 2
prior admissions >=2, Tree 100 lab abnormal, each tree predicts YES or NO,
majority voting aggregates 72 YES 28 NO final prediction YES high risk 72%
probability, feature importance ranking comorbidity 0.28 prior 0.22
B) Random Forest uses single tree without bootstrap
C) Random Forest uses PCA to predict
D) Majority voting deletes predictions
Answer: A
Rationale: Option A is correct because the diagram shows input medical
features resampled via bootstrap 100 times creating bootstrap samples, each
trains one decision tree with random feature subset, Tree 1 comorbidity >=5,
Tree 2 prior >=2, Tree 100 lab abnormal, each predicts YES/NO, majority
voting 72 YES 28 NO final YES high risk 72% probability, feature importance
comorbidity 0.28 prior 0.22. Option B is wrong because Random Forest uses
,100 trees with bootstrap, not single tree – single tree is high variance and
overfits. Option C is wrong because Random Forest does not use PCA; PCA is
dimensionality reduction, not ensemble voting. Option D is wrong because
majority voting aggregates predictions, not deletes them.
3. Refer to the confusion matrix diagram below. For Kronkers medical data with
850 TN, 120 FP, 80 FN, 150 TP, how do you calculate accuracy, precision, recall
and why FN is most critical?
Figure 3: Refer to diagram for Q3 – Random Forest Medical Readmission
A) Confusion matrix TN 850 correctly predicted no readmission, FP 120 predicted
readmission but not readmitted, FN 80 predicted no readmission but readmitted
critical, TP 150 correctly predicted readmission, Accuracy (TP+TN)/Total =
(150+850)/1200 = 0.833, Precision TP/(TP+FP) = 150/(150+120)=0.555, Recall
TP/(TP+FN)=150/(150+80)=0.652, F1
2*Precision*Recall/(Precision+Recall)=0.60, FN most critical because missed
high-risk patient leads to no intervention and costly readmission
B) Accuracy is TP/FP only
C) FN is not important
D) Confusion matrix same as PCA
Answer: A
, Rationale: Option A is correct because TN 850 correct no readmission, FP 120
false alarm, FN 80 missed readmission critical, TP 150 correct readmission,
Accuracy (TP+TN)/Total 0.833, Precision 0.555, Recall 0.652, F1 0.60, FN
most critical because missing high-risk patient means no post-discharge
intervention leading to preventable readmission and higher cost. Option B is
wrong because accuracy is not TP/FP – accuracy is (TP+TN)/Total, TP/FP is
not a standard metric. Option C is wrong because FN is most important in
medical context – missing a high-risk patient has higher cost than false alarm.
Option D is wrong because confusion matrix evaluates classification
predictions, PCA is dimensionality reduction technique.
4. Refer to the ROC curve and feature importance diagram below. How do you
interpret AUC 0.89 and why prior admissions 0.25 is top feature?
Figure 4: Refer to diagram for Q4 – Random Forest Medical Readmission
A) ROC curve x-axis False Positive Rate y-axis True Positive Rate diagonal
random AUC 0.5, Random Forest curve AUC 0.89 excellent discrimination,
threshold red dot balances TPR 0.78 FPR 0.22, feature importance bar Prior
Admissions 0.25 top predictor, Length of Stay 0.18, Age 0.15, Comorbidity 0.12,
Medications Count 0.10, Prior admissions strongest driver more prior admissions
higher readmission risk
B) AUC 0.89 means 89% accuracy
C) Feature importance means accuracy
D) ROC same as confusion matrix
Answer: A
Rationale: Option A is correct because ROC x-axis FPR y-axis TPR diagonal
random AUC 0.5, Random Forest AUC 0.89 excellent discrimination, threshold
balances TPR 0.78 FPR 0.22, feature importance Prior Admissions 0.25 top,
Random Forest Medical Readmission Analysis, Python Code & Complete 75
Solutions | 2026/2027 Updated
1. Which statement best defines classification in medical readmission analysis at
WGU D603 Task 1?
A) Classification predicts discrete class labels like readmission yes/no 0/1,
supervised learning with labeled data, Random Forest learns mapping from
medical features age, prior admissions, comorbidity to readmission label, goal
maximize accuracy and recall for high-risk patients
B) Regression predicts continuous values like blood pressure
C) Clustering groups unlabeled patients without labels
D) PCA reduces dimensions without predicting labels
Answer: A
Rationale: Option A is correct because classification in medical readmission
predicts discrete labels readmission yes/no 0/1, supervised with labeled data,
Random Forest learns mapping from medical features age, prior admissions,
comorbidity to readmission label, goal maximize accuracy and recall for
high-risk patients. Option B is wrong because regression predicts continuous
values like blood pressure or length of stay, not discrete readmission yes/no.
Option C is wrong because clustering is unsupervised grouping unlabeled
patients without using readmission labels, while Task 1 is supervised
classification. Option D is wrong because PCA is dimensionality reduction to
reduce features, not to predict class labels.
,2. Refer to the Random Forest ensemble diagram below. How does bootstrap
sampling and majority voting predict medical readmission risk?
Figure 2: Refer to diagram for Q2 – Random Forest Medical Readmission
A) Input medical features age gender prior admissions length of stay diagnosis
medications lab results comorbidity index resampled via bootstrap with
replacement 100 times creating 100 bootstrap samples, each sample trains one
decision tree with random feature subset, Tree 1 splits comorbidity >=5, Tree 2
prior admissions >=2, Tree 100 lab abnormal, each tree predicts YES or NO,
majority voting aggregates 72 YES 28 NO final prediction YES high risk 72%
probability, feature importance ranking comorbidity 0.28 prior 0.22
B) Random Forest uses single tree without bootstrap
C) Random Forest uses PCA to predict
D) Majority voting deletes predictions
Answer: A
Rationale: Option A is correct because the diagram shows input medical
features resampled via bootstrap 100 times creating bootstrap samples, each
trains one decision tree with random feature subset, Tree 1 comorbidity >=5,
Tree 2 prior >=2, Tree 100 lab abnormal, each predicts YES/NO, majority
voting 72 YES 28 NO final YES high risk 72% probability, feature importance
comorbidity 0.28 prior 0.22. Option B is wrong because Random Forest uses
,100 trees with bootstrap, not single tree – single tree is high variance and
overfits. Option C is wrong because Random Forest does not use PCA; PCA is
dimensionality reduction, not ensemble voting. Option D is wrong because
majority voting aggregates predictions, not deletes them.
3. Refer to the confusion matrix diagram below. For Kronkers medical data with
850 TN, 120 FP, 80 FN, 150 TP, how do you calculate accuracy, precision, recall
and why FN is most critical?
Figure 3: Refer to diagram for Q3 – Random Forest Medical Readmission
A) Confusion matrix TN 850 correctly predicted no readmission, FP 120 predicted
readmission but not readmitted, FN 80 predicted no readmission but readmitted
critical, TP 150 correctly predicted readmission, Accuracy (TP+TN)/Total =
(150+850)/1200 = 0.833, Precision TP/(TP+FP) = 150/(150+120)=0.555, Recall
TP/(TP+FN)=150/(150+80)=0.652, F1
2*Precision*Recall/(Precision+Recall)=0.60, FN most critical because missed
high-risk patient leads to no intervention and costly readmission
B) Accuracy is TP/FP only
C) FN is not important
D) Confusion matrix same as PCA
Answer: A
, Rationale: Option A is correct because TN 850 correct no readmission, FP 120
false alarm, FN 80 missed readmission critical, TP 150 correct readmission,
Accuracy (TP+TN)/Total 0.833, Precision 0.555, Recall 0.652, F1 0.60, FN
most critical because missing high-risk patient means no post-discharge
intervention leading to preventable readmission and higher cost. Option B is
wrong because accuracy is not TP/FP – accuracy is (TP+TN)/Total, TP/FP is
not a standard metric. Option C is wrong because FN is most important in
medical context – missing a high-risk patient has higher cost than false alarm.
Option D is wrong because confusion matrix evaluates classification
predictions, PCA is dimensionality reduction technique.
4. Refer to the ROC curve and feature importance diagram below. How do you
interpret AUC 0.89 and why prior admissions 0.25 is top feature?
Figure 4: Refer to diagram for Q4 – Random Forest Medical Readmission
A) ROC curve x-axis False Positive Rate y-axis True Positive Rate diagonal
random AUC 0.5, Random Forest curve AUC 0.89 excellent discrimination,
threshold red dot balances TPR 0.78 FPR 0.22, feature importance bar Prior
Admissions 0.25 top predictor, Length of Stay 0.18, Age 0.15, Comorbidity 0.12,
Medications Count 0.10, Prior admissions strongest driver more prior admissions
higher readmission risk
B) AUC 0.89 means 89% accuracy
C) Feature importance means accuracy
D) ROC same as confusion matrix
Answer: A
Rationale: Option A is correct because ROC x-axis FPR y-axis TPR diagonal
random AUC 0.5, Random Forest AUC 0.89 excellent discrimination, threshold
balances TPR 0.78 FPR 0.22, feature importance Prior Admissions 0.25 top,