Where linear shines
Linear models are excellent when the relationship between features and target is roughly additive after sensible transformations, when the dataset is small to medium, when interpretability is required, and when the team needs to ship a stable artifact that does not need a GPU.
Where linear breaks
- Strong interactions — the effect of feature A depends on feature B. Add interaction terms or switch to trees.
- Non-monotone relationships — y goes up then down with X. Bin the feature, use a spline, or switch to trees.
- Heteroscedastic noise — variance of the residuals depends on prediction. Try log-target, weighted regression, or quantile regression.
- High-cardinality categoricals — one-hot explodes. Use target encoding or trees.
The honest upgrade path
When linear breaks, do not jump straight to a deep neural net. The middle ground is gradient boosted trees. They handle interactions, non-monotonicity, missingness, and high cardinality, while still being fast to train and interpret.
회귀분석 강의에서 반드시 짚고 넘어가야 할 함정 있잖아. 만약 데이터가 범죄발생수(target), 연도, 인구수, 교회수 라고 하자. 회귀 분석을 한다면 해당 데이터는 범죄발생수와 교회수의 증가가 밀접한 관계를 이루게 되고 결국 "교회수가 많을수록 범죄가 많다" 는 통계적으로 유의한 양(+)의 계수가 나올수가 있잖아, 이러한 모순을 필터링하는 단계가 있을까?