[FAQ] Homework 6 Q4: How do I calculate mean RMSE when selecting max_depth?
I maintainer di solito rispondono entro 2 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 1/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 70/100
- Tipo di issue
- Documentazione
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Ambito
- documentation, machine-learning
Direzione di ricerca
La risposta delle FAQ è già redatta nel corpo dell'issue, quindi il lavoro consiste nel verificarla con il link di origine, Homework 6 Domanda 4 in cohorts/2026/homework/06-trees/homework.md. Esegui lo snippet groupby di pandas per confermare le medie illustrative di 2.2 e 2.3. È completato quando la risposta è confermata come corretta o corretta, e la voce delle FAQ è pronta per essere aggiunta.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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
- Lingua principale
- Python
- Stelle
- 8
- Fork
- 20
- Merge medio
- 6g 15h
- PR unite (30g)
- 7
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di DataTalksClub/faq
-
Fixing ValueError: feature_names must not contain [, ], or < in XGBoostForse già presa @github-actions l’ha presa 3 giorni fa. Apertafaq-proposal
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
DataTalksClub/faq#536 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
-
How to fix uv warning: VIRTUAL_ENV does not match the project environment pathForse già presa @github-actions l’ha presa 3 giorni fa. Apertafaq-proposal
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 82/100
DataTalksClub/faq#534 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
-
Fixing ValueError: This solver needs samples of at least 2 classes in Logistic RegressionForse già presa @github-actions l’ha presa 3 giorni fa. Apertafaq-proposal
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
DataTalksClub/faq#532 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 60/100
DataTalksClub/faq#531 ·
I maintainer di solito rispondono entro 2 giorni
-
[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?Forse già presa @github-actions l’ha presa 5 giorni fa. Apertafaq-proposal
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 72/100
DataTalksClub/faq#524 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
Tutte le issue di DataTalksClub/faq
Issue simili
-
ci-rerun: collect.py fails a whole pr-babysit cycle on one transient GitHub 5xx and never retriesApertafollow-up
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
-
Built-in QUBO fallback applies bitwise xor to floating binary statesForse già presa @iloveeyjafjalla l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
qboson/kaiwu-pytorch-plugin#1702 ·
I maintainer di solito rispondono entro 3 giorni
-
bug v2
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
modelcontextprotocol/python-sdk#3811 ·
I maintainer di solito rispondono entro 1 giorno
-
cost:cheap practicality:seen-in-the-wild severity:medium
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
fairagro/m4.2_advanced_middleware_api#620 ·
I maintainer di solito rispondono entro 1 giorno