モデル検証

Rで学ぶ実験計画法

Joanne Xiong

Data Scientist

モデリング前のEDA

  • 関心変数ごとの結果の平均と分散
lendingclub %>% summarise(median(loan_amnt),
                          mean(int_rate), 
                          mean(annual_inc))

lendingclub %>% group_by(verification_status) %>% summarise(mean(funded_amnt), var(funded_amnt))
# A tibble: 3 x 3
verification_status `mean(funded_amnt)` `var(funded_amnt)`
<chr>                             <dbl>              <dbl>
1 Not Verified                   114.15          349.41953
2 Source Verified                156.14          723.53265
3 Verified                       166.08          848.54561
Rで学ぶ実験計画法

モデリング前のEDA(続き)

  • 結果(y軸)を関心変数(x軸)別に示す箱ひげ図
ggplot(data = lendingclub,
       aes(x = verification_status, y = funded_amnt)) +
    geom_boxplot()
Rで学ぶ実験計画法

融資額を審査ステータス別に示した箱ひげ図

Rで学ぶ実験計画法

モデリング後のモデル検証

  • 残差プロット
  • 正規性のQQプロット
  • ANOVAの前提条件の検定
    • 等分散性
  • ANOVAのノンパラメトリック代替手法を試す
Rで学ぶ実験計画法

融資額モデルのモデル検証プロット

Rで学ぶ実験計画法

練習しましょう!

Rで学ぶ実験計画法

Preparing Video For Download...