C.W.K.
Stream
Lesson 02 of 10 · published

Classical ML vs Deep Learning

~22 min · classical-ml, tradeoffs, baselines

Level 0Curious
0 XP0/73 lessons0/11 achievements
0/120 XP to next level120 XP to go0% complete

이름은 같지만 다른 일

Classical ML — logistic regression, gradient-boosted tree, SVM, random forest — 는 구조화된 tabular data, 적당한 dataset 크기, 잘 설계된 column 몇 개에 신호가 몰려 있는 문제에서 강력해. 빠르게 train 되고, 해석 쉽고, 노트북에서 돌아. XGBoost 와 LightGBM 이 Kaggle tabular 대회 대부분을 여전히 이긴다는 건 옛날 얘기 아니야.

Deep learning 은 신호가 raw, high-dimensional, redundant data — pixel, waveform, character stream — 에 묻혀 있고, 충분한 data 또는 좋은 pretrained backbone 이 있을 때 강해. 비용도 진짜야: GPU, careful initialization, normalization, regularization, 그리고 shape 디버깅에 몇 시간 쓸 각오.

팁: Dataset 이 column 수백 개 row 수십만 개짜리 CSV 안에 들어가면, 첫 수는 gradient boosting 이지 neural network 가 아냐. 강력한 baseline 이 plateau 친 다음에 escalate 해.

Baseline reflex

Deep learning project 의 가장 흔한 실패는 baseline 을 건너뛰는 거야. 팀이 transformer 3 주 튜닝했는데, 사실 잘 튜닝된 LightGBM 이 20 분 만에 같은 정확도 찍는 tabular dataset 인 거지. 비용은 compute 만이 아니야 — 어떤 knob 이 중요한지에 대한 잘못된 멘탈 모델이 더 비싸. Baseline 은 deep learning 이 얼마나 여유 가 있는지 알려줘.

올바른 결정의 모양

Deep learning 은 다음 중 둘 이상이 참일 때 reach 해: input 이 raw 하고 high-dimensional, label 과의 관계가 non-linear/compositional, 충분한 data 또는 강한 pretrained model 이 있고, training/serving 비용 감당 가능. 그게 아니면 classical ML 이 어른의 선택이야.

원칙: 항상 멍청한 baseline 부터 train 해. 이겨야 할 숫자는 0 이 아니라 같은 split 에서 가장 단순한 합리적 model 이 찍은 점수야.

Code

Baseline first, escalate later·python
from sklearn.dummy import DummyClassifier
from sklearn.linear_model import LogisticRegression
from sklearn.metrics import f1_score
import lightgbm as lgb

dummy = DummyClassifier(strategy="most_frequent").fit(X_train, y_train)
print("dummy f1:", f1_score(y_val, dummy.predict(X_val), average="macro"))

lr = LogisticRegression(max_iter=1000).fit(X_train, y_train)
print("lr f1:   ", f1_score(y_val, lr.predict(X_val), average="macro"))

gbm = lgb.LGBMClassifier(n_estimators=500).fit(X_train, y_train)
print("lgbm f1: ", f1_score(y_val, gbm.predict(X_val), average="macro"))
# Only escalate to a neural network if the gap to the ceiling
# justifies the engineering cost.

External links

Exercise

본인이 다뤄본 dataset 하나 가져와. Dummy baseline, linear baseline, gradient-boosted baseline 의 점수를 적어. 셋 다 모르면 deep learning 이 도움이 될지 아직 모르는 거야.

Progress

Progress is local-only — sign in to sync across devices.
이 페이지에서 버그를 발견하셨거나 피드백이 있으세요?문제 신고

댓글 0

🔔 답글 알림 (로그인 필요)
로그인댓글을 남기려면 로그인해 주세요.

아직 댓글이 없어요. 첫 댓글을 남겨보세요.