以 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
___