開始使用免費開始

以 tidy 方式擷取模型統計量

在這個練習中,你將使用 tidy()glance() 函式,以 tidy 的方式從 algeria_model 擷取資訊。

對於線性模型,tidy() 會擷取模型係數,而 glance() 會回傳模型統計量,例如 R 平方($R^2$)。

本練習屬於課程

Tidyverse 的 Machine Learning

檢視課程

練習說明

  • 使用 tidy()algeria_model 的係數資訊擷取為 tidy 的資料框。
  • 使用 glance() 擷取 algeria_model 的模型統計量。

動手互動練習

試著完成這個範例程式碼,體驗一下這個練習。

library(broom)

# Extract the coefficients of the algeria_model as a data frame
___

# Extract the statistics of the algeria_model as a data frame
___
編輯並執行程式碼