7  分類問題に挑戦

コード
library(dplyr)

Attaching package: 'dplyr'
The following objects are masked from 'package:stats':

    filter, lag
The following objects are masked from 'package:base':

    intersect, setdiff, setequal, union

7.1 ロジスティック回帰

7.2 主成分分析

コード
subset(df_zoo, select = c(body_length_cm, weight_kg)) |> 
  dplyr::filter(!is.na(body_length_cm)) |> 
  prcomp(scale. = TRUE)
Standard deviations (1, .., p=2):
[1] 1.3577273 0.3956975

Rotation (n x k) = (2 x 2):
                     PC1        PC2
body_length_cm 0.7071068 -0.7071068
weight_kg      0.7071068  0.7071068

7.3 クラスタリング