1. Learn
  2. /
  3. Courses
  4. /
  5. Tidyverse で学ぶ Machine Learning

Connected

Exercise

最良モデルの構築と評価

交差検証により、gapminder のすべての特徴量を使って life_expectancy を予測する最良のモデルを特定できました。モデルを選んだら、保持しておいた独立データ集合(testing_data)を使って、新しいデータに対するこのモデルの性能を見積もることができます。

ここでは、すべての training_data を使ってこのモデルを構築し、testing_data を使って評価します。

Instructions

100 XP
  • すべての訓練データを使って、ranger() で最良のモデル(mtry = 4)を構築し、best_model に代入します。
  • testing_data から life_expectancy 列を抽出して、test_actual に代入します。
  • best_model を使って testing データで life_expectancy を予測し、test_predicted に代入します。
  • test_actual と test_predicted のベクトルを使って MAE を計算します。