モデル性能の評価
どのアプローチが最適か(全データでの単一モデルか、住宅の築年数カテゴリごとのモデルか)を確かめるために、いくつかの指標を計算します。ここでは、各モデルについて決定係数と残差標準誤差を比較します。
価格とコンビニの店舗数の関係を表す4つのモデル(mdl_all_ages、mdl_0_to_15、mdl_15_to_30、mdl_30_to_45)が用意されています。dplyr と broom は読み込まれています。
この演習はコースの一部です
Rで学ぶ中級回帰分析
実践的なインタラクティブ演習
このサンプルコードを完成させて、この演習に挑戦してみましょう。
# Get the coeff. of determination for mdl_all_ages
___
# Get the coeff. of determination for mdl_0_to_15
___
# Get the coeff. of determination for mdl_15_to_30
___
# Get the coeff. of determination for mdl_30_to_45
___