Supplied for this practice
These objects are prepared afresh before your editor runs.
group_sizes- Supplied
group_sizes; its definition below specifies the values and role.group_sizes = pd.Series([300, 150, 50], index=['group 0', 'group 1', 'group 2'])
Outputs you create
rmse_difference- Requested result described in the task and deliverables.
minority_missed- Requested result described in the task and deliverables.
group_proportions- Requested result described in the task and deliverables.
unsampled- Requested result described in the task and deliverables.
omitted_from_display- Requested result described in the task and deliverables.
wine_rmse | minority_actual | minority_caught | profile_rows | population_rows | retained_variance | shown_variance |
|---|---|---|---|---|---|---|
| 0.8 | 10 | 2 | 500 | 569 | 0.9 | 0.65 |
| 0.81 | 10 | 2 | 500 | 569 | 0.9 | 0.65 |
- Check the five cases below.
- Write a short report for each case.
- Wine: candidate A has CV RMSE 0.8.
- Candidate B has CV RMSE 0.81.
- Fold variation is 0.1.
- Penguins: classifier accuracy is .95.
- Recall for the minority class is .2.
- K-Means: k=3 has silhouette .51. k=4 has silhouette .52.
- Their group sizes are very different.
- Ward: the profiles use a 500-row sample.
- The report claims they describe all 569 rows.
- PCA: seven axes keep 90% of the variance.
- The picture shows only two axes.
- For each case, name the task.
- Explain what the evidence supports.
- State one limitation.
rmse_differenceminority_missedgroup_proportionsunsampledomitted_from_displayHints
Think: The wine score gap is small relative to the stated fold variation of .1. Minority errors, group sizes, sample scope and display retention answer different questions; they cannot form one accuracy leaderboard.
Tools: Choose and Explain Models checkpoint: use the supplied wine_rmse, minority_actual, minority_caught, profile_rows, population_rows, retained_variance, shown_variance columns and the pandas or model operations introduced in this lesson.
Approach: Compute rmse_difference, minority_missed, group_proportions, unsampled, omitted_from_display from the supplied evidence. Preserve the requested labels and row order, then inspect the values before checking.
Explained solution
rmse_difference = df['wine_rmse'].iloc[1]-df['wine_rmse'].iloc[0]
minority_missed = df['minority_actual'].iloc[0]-df['minority_caught'].iloc[0]
group_proportions = group_sizes/group_sizes.sum()
unsampled = df['population_rows'].iloc[0]-df['profile_rows'].iloc[0]
omitted_from_display = df['retained_variance'].iloc[0]-df['shown_variance'].iloc[0]
print(rmse_difference)
print(minority_missed)
print(group_proportions)
print(unsampled)
print(omitted_from_display)
The wine score gap is small relative to the stated fold variation of .1. Minority errors, group sizes, sample scope and display retention answer different questions; they cannot form one accuracy leaderboard.