[FAQ] Homework 6 Q4: How do I calculate mean RMSE when selecting max_depth?
Los mantenedores suelen responder en 2 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 1/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 70/100
- Tipo de issue
- Documentación
- Claridad
- Bien especificado
- Estado de actividad
- Activo
Línea de trabajo
La respuesta de preguntas frecuentes ya está redactada en el cuerpo del issue, así que el trabajo consiste en verificarla con el enlace de origen, Homework 6 Pregunta 4 en cohorts/2026/homework/06-trees/homework.md. Ejecuta el fragmento de groupby de pandas para confirmar las medias ilustrativas de 2.2 y 2.3. Está terminado cuando la respuesta quede confirmada como correcta o corregida y la entrada de preguntas frecuentes esté lista para añadirse.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Course
machine-learning-zoomcamp
Question
How do I calculate mean RMSE when selecting max_depth in Homework 6 Q4? Should
I choose the best individual forest, average predictions, or average the RMSE
scores for each depth?
Answer
Average the four validation RMSE scores for each fixed depth, then select
the depth with the lowest mean. Keep the individual RMSE values at full
precision until after calculating the mean.
In the 2026 assignment, each max_depth in [10, 15, 20, 25] is evaluated with
n_estimators in [10, 50, 100, 150], with random_state=1. This produces
16 models, four validation RMSE values per depth, and four depth-level means.
Use the same prepared training and validation data for every model.
For a fixed depth d, the comparison score is:
mean_rmse(d) = (rmse(d, 10) + rmse(d, 50) + rmse(d, 100) + rmse(d, 150)) / 4
Here is a small, runnable example using hypothetical scores and a smaller
grid, not the homework results:
import pandas as pd
scores = pd.DataFrame([
{"max_depth": 2, "n_estimators": 5, "val_rmse": 2.1},
{"max_depth": 2, "n_estimators": 15, "val_rmse": 2.3},
{"max_depth": 3, "n_estimators": 5, "val_rmse": 1.8},
{"max_depth": 3, "n_estimators": 15, "val_rmse": 2.8},
])
mean_rmse = scores.groupby("max_depth")["val_rmse"].mean()
print(mean_rmse.round(6)) # Round only for display.
The illustrative means are 2.2 for depth 2 and 2.3 for depth 3. Although depth 3
contains the best individual model (RMSE 1.8), depth 2 has the lower mean.
Do not replace this calculation with:
- The minimum RMSE for each depth, or the best single depth/size combination.
- The mean of the predictions from several forests; that evaluates a different
ensemble model. - The square root of the mean of the four MSE values; the square root is
nonlinear, so this generally differs from the arithmetic mean of four RMSEs.
If depth-level means tie, report the tie and follow any explicit assignment or
maintainer guidance. The example above intentionally has a unique minimum.
Source: 2026 Homework 6, Question 4.
Checklist
- I have searched existing FAQs and this question is not already answered
- The answer provides accurate, helpful information
- I have included any relevant code examples or links
- Lenguaje dominante
- Python
- Estrellas
- 8
- Forks
- 20
- Merge medio
- 6 d 15 h
- PR fusionados (30 d)
- 7
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de DataTalksClub/faq
-
Fixing ValueError: feature_names must not contain [, ], or < in XGBoostPosiblemente ocupada @github-actions la tomó hace 4 días. Abiertofaq-proposal
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
DataTalksClub/faq#536 · 1 comentario ·
Los mantenedores suelen responder en 2 días
-
How to fix uv warning: VIRTUAL_ENV does not match the project environment pathPosiblemente ocupada @github-actions la tomó hace 4 días. Abiertofaq-proposal
Dificultad 1/5 Menos de una hora Aptitud para principiantes 82/100
DataTalksClub/faq#534 · 1 comentario ·
Los mantenedores suelen responder en 2 días
-
Fixing ValueError: This solver needs samples of at least 2 classes in Logistic RegressionPosiblemente ocupada @github-actions la tomó hace 4 días. Abiertofaq-proposal
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
DataTalksClub/faq#532 · 1 comentario ·
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 60/100
DataTalksClub/faq#531 ·
Los mantenedores suelen responder en 2 días
-
[FAQ] omework 5 (2026): Why does `/predict` return 200 OK for `"Paid_Ads"`, `"tiktok"` or a negative count, and how do I reject bad input?Posiblemente ocupada @github-actions la tomó hace 5 días. Abiertofaq-proposal
Dificultad 1/5 Menos de una hora Aptitud para principiantes 72/100
DataTalksClub/faq#524 · 1 comentario ·
Los mantenedores suelen responder en 2 días
Todos los issues de DataTalksClub/faq
Issues similares
-
Backend issue lists report in-patch warnings and out-of-patch errors as not publishablePosiblemente ocupada @RaphaelFakhri la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
mozilla/code-review#3794 ·
Los mantenedores suelen responder en 1 día
-
[oblt-aw][autodoc] Update docs that still describe the security registry as emptyPosiblemente ocupada @github-actions la tomó hoy. Abierto
Dificultad 1/5 1-3 horas Aptitud para principiantes 85/100
Los mantenedores suelen responder en 1 día
-
[Bug] adb backup script reports "Done" & exits 0 when the backup failsPosiblemente ocupada @bhattmanthan la tomó hoy. Abiertorequest-issue-assignment
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
OWASP/mastg#4034 · 5 comentarios ·
Los mantenedores suelen responder en 1 día
-
agent-ui bug p2
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
amd/gaia#6580 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
correction metadata
Dificultad 1/5 Menos de una hora Aptitud para principiantes 72/100
acl-org/acl-anthology#10768 · 1 comentario ·
Los mantenedores suelen responder en 1 día