linear가 빛나는 곳
Linear model이 적절한 transformation 후 feature와 target 사이 관계가 대략 additive일 때, dataset이 small to medium일 때, interpretability가 필요할 때, GPU 안 필요한 안정 artifact를 ship 해야 할 때 탁월.
linear가 깨지는 곳
- Strong interaction — A의 효과가 B에 의존. interaction term 추가하거나 tree로.
- Non-monotone 관계 — y가 X와 함께 올라갔다 내려가. feature를 binning, spline 사용, 또는 tree로.
- Heteroscedastic noise — residual 분산이 prediction에 의존. log-target, weighted regression, 또는 quantile regression 시도.
- High-cardinality categorical — one-hot이 폭발. target encoding이나 tree.
정직한 upgrade path
linear가 깨졌을 때 deep neural net으로 바로 점프하지 마. 중간 지대는 gradient boosted tree야. interaction, non-monotonicity, missingness, high cardinality 다 처리하면서도 train 빠르고 interpret 가능.
회귀분석 강의에서 반드시 짚고 넘어가야 할 함정 있잖아. 만약 데이터가 범죄발생수(target), 연도, 인구수, 교회수 라고 하자. 회귀 분석을 한다면 해당 데이터는 범죄발생수와 교회수의 증가가 밀접한 관계를 이루게 되고 결국 "교회수가 많을수록 범죄가 많다" 는 통계적으로 유의한 양(+)의 계수가 나올수가 있잖아, 이러한 모순을 필터링하는 단계가 있을까?