Outputs you create
answer- The requested result, with the values, labels and row order described by this task.
material_code |
|---|
| 0 |
| 1 |
| 2 |
| 3 |
- Make the unfitted four-class-task network with hidden widths 16 then 8.
- Store its
hidden_layer_sizesinanswer; the number of output classes is learned from labels during fit.
answerHints
Think: The tuple lists only hidden-layer widths. Classification output classes follow the fitted material labels; numeric category codes do not turn those labels into a regression quantity.
Tools: Shared network retrieval: use the supplied material_code columns and the pandas or model operations introduced in this lesson.
Approach: Compute answer from the supplied evidence. Preserve the requested labels and row order, then inspect the values before checking.
Explained solution
from sklearn.neural_network import MLPClassifier
model = MLPClassifier(hidden_layer_sizes=(16,8), random_state=42)
answer = model.hidden_layer_sizes
print(answer)
The tuple lists only hidden-layer widths. Classification output classes follow the fitted material labels; numeric category codes do not turn those labels into a regression quantity.