[FAQ] Homework 6 Q4: How do I calculate mean RMSE when selecting max_depth?
メンテナーはふだん 2 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 1/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 70/100
- issue の種類
- ドキュメント
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
調査の方向性
FAQの回答はissue本文にすでに下書きされているので、作業は元のリンク先、cohorts/2026/homework/06-trees/homework.md の Homework 6 Question 4 と照らし合わせて確認することです。pandas のgroupbyスニペットを実行し、例示用の平均値2.2と2.3が正しいか確かめてください。回答が正確と確認されるか修正され、FAQの項目を追加できる状態になれば完了です。
索引モデルが issue の本文から書いたものです。
説明
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
- 主要言語
- Python
- スター
- 8
- フォーク
- 20
- 平均マージ
- 3日 14時間
- マージ済み PR(30日)
- 3
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
DataTalksClub/faq のほかの issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 86/100
DataTalksClub/faq#550 ·
メンテナーはふだん 2 日以内に返信
-
Fixing ValueError: feature_names must not contain [, ], or < in XGBoost対応中かも @github-actions が 7 日前に担当しました。 オープンfaq-proposal
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
DataTalksClub/faq#536 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
-
How to fix uv warning: VIRTUAL_ENV does not match the project environment path対応中かも @github-actions が 7 日前に担当しました。 オープンfaq-proposal
難易度 1/5 1時間未満 初心者へのやさしさ 82/100
DataTalksClub/faq#534 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
-
Fixing ValueError: This solver needs samples of at least 2 classes in Logistic Regression対応中かも @github-actions が 7 日前に担当しました。 オープンfaq-proposal
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
DataTalksClub/faq#532 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 60/100
DataTalksClub/faq#531 ·
メンテナーはふだん 2 日以内に返信
DataTalksClub/faq の issue をすべて見る
似ている issue
-
docs size:S
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信
-
documentation
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
strawberry-graphql/strawberry#4794 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
dataforgoodfr/cetolog#21 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
btclib-org/btclib#2932 ·
メンテナーはふだん 1 日以内に返信