์์ฑ 2026. 6. 12.ยท์์ 2026. 6. 12.
- ๋ถ์ผ ํ์
์ ํ์ํ ํต์ฌ concepts
- Supervised learning์ ๊ณต์์ ์ธ ์์
- N๊ฐ์ ์
์ถ๋ ฅ ์ (x1โ,ย y1โ),ย (x2โ,ย y2โ),ย โฆ,ย (xNโ,ย yNโ)์ training set์ด ์ฃผ์ด์ง
- ๊ฐ ์์ ์ ์ ์๋ ํจ์ y=f(x)์ ์ํด ์์ฑ
- ์ค์ ํจ์ f๋ฅผ ๊ทผ์ฌํ๋ ํจ์ h์ ๋ฐ๊ฒฌ
- ํจ์ h: Hypothesis
- ๊ฐ๋ฅํ ํจ์ ์งํฉ์ธ hypothesis space H์์ ๋์ถ
- ์: Hypothesis space๋ 3์ฐจ ๋คํญ์(polynomials)์ ์งํฉ์ผ ์ ์์
- h๋ model class H์์ ๋์ถ๋ model์ด๊ฑฐ๋ function class์์ ๋์ถ๋ ํจ์
- ์ถ๋ ฅ yiโ: Ground truth (๋๋ gold-standard)
- Model์ด ์์ธกํ๋๋ก ์์ฒญ๋ฐ๋ ์ค์ ์ ๋ต
- ๋ฐ์ดํฐ ์์ฑ process์ ๋ํ ์ฌ์ ์ง์ ํ์ฉ
- ์ฌ์ ์ง์์ด ์๋ ๊ฒฝ์ฐ: Exploratory Data Analysis (EDA) ์ํ
- ํต๊ณ์ test ๋ฐ ์๊ฐํ(histograms, scatter plots, box plots ๋ฑ)๋ฅผ ํตํด ๋ฐ์ดํฐ ํ์
๋ฐ ์ ์ ํ hypothesis space์ ๋ํ insight ์ป๊ธฐ
- ๋๋ ์ฌ๋ฌ hypothesis spaces๋ฅผ ์๋ํ๊ณ ๊ฐ์ฅ ์ ์๋ํ๋ ๊ฒ์ ํ๊ฐ

- ์ผ๊ด๋(consistent) hypothesis ๊ธฐ๋: Training set์ ๋ชจ๋ xiโ์ ๋ํด h(xiโ)=yiโ
- Continuous-valued ์ถ๋ ฅ: Ground truth์ ์ ํํ ์ผ์นํ๊ธฐ ์ด๋ ค์. ๋์ h(xiโ)๊ฐ yiโ์ ๊ฐ๊น์ด best-fit ํจ์ ํ์
- Hypothesis์ ์ง์ ํ ์ฒ๋: Training set์ด ์๋, ์์ง ๋ณด์ง ๋ชปํ ์
๋ ฅ(test set)์ ์ฒ๋ฆฌํ๋ ๋ฅ๋ ฅ
- Test set: (xjโ,ย yjโ) ์์ ๋ ๋ฒ์งธ sample๋ก ํ๊ฐ
- h๊ฐ test set์ ์ถ๋ ฅ์ ์ ํํ๊ฒ ์์ธกํ๋ฉด '์ผ๋ฐํ(generalizes well)'๊ฐ ์ ๋์๋ค๊ณ ํจ
- Hypothesis space ๋ถ์ ๋ฐฉ๋ฒ: Bias (๋ฐ์ดํฐ์
๊ณผ ๋ฌด๊ด)์ variance (training set ๊ฐ์ ์ฐจ์ด)
- Bias: ๋ค๋ฅธ training sets์ ๋ํด ํ๊ท ์ ๋์ ๋, ์์ธก hypothesis๊ฐ ๊ธฐ๋๊ฐ์์ ๋ฒ์ด๋๋ ๊ฒฝํฅ
- Bias๋ ์ข
์ข
hypothesis space์ ์ํด ๋ถ๊ณผ๋ ์ ์ฝ์ผ๋ก ์ธํด ๋ฐ์
- ์: ์ ํ ํจ์(linear functions)์ hypothesis space๋ ๊ฐํ bias๋ฅผ ์ ๋ (์ง์ ์ผ๋ก๋ง ๊ตฌ์ฑ)
- Hypothesis๊ฐ ๋ฐ์ดํฐ์์ pattern์ ์ฐพ์ง ๋ชปํ ๋: Underfitting
- Variance: Training data์ ๋ณ๋(fluctuation)์ผ๋ก ์ธํ hypothesis์ ๋ณํ๋
- Low variance: ๋ฐ์ดํฐ์
์ ์์ ์ฐจ์ด๊ฐ hypothesis์ ์์ ์ฐจ์ด๋ก ์ด์ด์ง (์ฒ์ 3๊ฐ ์ด)
- High variance: 12์ฐจ ๋คํญ์(degree-12 polynomials)์ ๋์ variance๋ฅผ ๊ฐ์ง (x์ถ ์ ๋์์ ๋ ํจ์๊ฐ ๋งค์ฐ ๋ค๋ฆ)
- ํจ์๊ฐ ํ๋ จ๋ ํน์ data set์ ๋๋ฌด ์ง์คํ์ฌ, ๋ณด์ง ๋ชปํ ๋ฐ์ดํฐ(unseen data)์์ ์ฑ๋ฅ์ด ์ ํ๋ ๋: Overfitting
- ์ข
์ข
bias-variance tradeoff ๋ฐ์
- ๋ณต์กํ๊ณ low-bias์ธ (training data์ ์ ๋ง๋) hypothesis์, ๋จ์ํ๊ณ low-variance์ธ (์ผ๋ฐํ๊ฐ ๋ ์ ๋ ์ ์๋) hypothesis ๊ฐ์ ์ ํ
- Ockham's razor (์ค์ปด์ ๋ฉด๋๋ )
- 14์ธ๊ธฐ ์๊ตญ ์ฒ ํ์ William of Ockham
- "ํ์ ์์ด (์ค์ฒด์) ๋ณต์์ฑ(plurality)์ ๊ฐ์ ํด์๋ ์ ๋๋ค"๋ ์์น. ์์ฌ์ค๋ฌ์ด ์ค๋ช
์ "๊น์๋ด๋(shave off)" ๋ฐ ์ฌ์ฉ๋จ

- Machine learning์ ๋ชฉํ: ๋ฏธ๋์ ์์(future examples)์ ์ต์ ์ผ๋ก ๋ง๋ hypothesis ์ ํ
- "๋ฏธ๋์ ์์"์ "์ต์ ์ ์ ํฉ(optimal fit)"์ด๋ ๋ฌด์์ธ๊ฐ?
- ๊ฐ์ 1: ๋ฏธ๋์ ์์๊ฐ ๊ณผ๊ฑฐ์ ๊ฐ์ ๊ฒ (Stationarity assumption)
- ๊ฐ ์์ Ejโ๋ ๋์ผํ ์ฌ์ ํ๋ฅ ๋ถํฌ(prior probability distribution)๋ฅผ ๊ฐ์ง:
P(Ejโ)=P(Ej+1โ)=P(Ej+2โ)=โฆ
- ๊ฐ ์์๋ ์ด์ ์์์ ๋
๋ฆฝ์ (independent):
P(Ejโ)=P(EjโโฃEjโ1โ,ย Ejโ2โ,ย โฆ)
- ์ด ๋ ๋ฐฉ์ ์์ ๋ง์กฑํ๋ ์์: Independent and identically distributed (๋
๋ฆฝ ํญ๋ฑ ๋ถํฌ) ๋๋ i.i.d.
- Optimal fit ์ ์: Error rate (์ค์ฐจ์จ)๋ฅผ ์ต์ํํ๋ hypothesis
- Error rate: (x,ย y) ์์์ ๋ํด h(x)๎ =y์ธ ๋น์จ
- (์ถํ: "๊ฑฐ์" ์ ๋ต์ธ ๋ต๋ณ์ ๋ถ๋ถ ์ ์(partial credit) ํ์ฉ)
- Test set์ ํตํด hypothesis์ error rate ์ถ์
- Hypothesis๊ฐ test ์ ์ test ์ ๋ต์ ๋ณด๋ ๊ฒ์ cheating (๋ถ์ ํ์)
- ๊ฐ์ฅ ๊ฐ๋จํ ๋ฐฉ์ง๋ฒ: ์์๋ฅผ ๋ set์ผ๋ก ๋ถ๋ฆฌ
- Training set: Hypothesis ์์ฑ์ฉ
- Test set: Hypothesis ํ๊ฐ์ฉ
- ๋จ์ผ hypothesis ์์ฑ ์: Training/test set ๋ถ๋ฆฌ๋ก ์ถฉ๋ถ
- ์ฌ๋ฌ hypothesis ์์ฑ ์ (์: ๋ ML model ๋น๊ต, model ๋ด ์ค์ ์กฐ์ ): ๋ถ์ถฉ๋ถ
- Hyperparameters: ๊ฐ๋ณ model์ด ์๋ model class์ parameters
- ์ฐ๊ตฌ์๊ฐ KNN classifier์ hyperparameter๋ฅผ ๋ฐ๊ฟ๊ฐ๋ฉฐ test set error rate๋ฅผ ์ธก์ ํ๋ ๊ฒฝ์ฐ:
- ๊ฐ๋ณ hypothesis๋ test set์ ๋ณด์ง ์์์ง๋ง, ์ฐ๊ตฌ์๋ฅผ ํตํด ์ ์ฒด process๊ฐ test set์ "์ฟ๋ด"
- ํด๊ฒฐ์ฑ
: Training, experimenting, hyperparameter-tuning, re-training ๋ฑ์ด ๋ชจ๋ ๋๋ ๋๊น์ง test set์ ์์ ํ ๋ถ๋ฆฌ(hold out)
- 3๊ฐ์ data set ํ์
- Training set: ํ๋ณด models ํ๋ จ
- Validation set (development set ๋๋ dev set): ํ๋ณด models ํ๊ฐ ๋ฐ ์ต์ ์ฑ
์ ํ
- Test set: ์ต์ข
model์ ํธํฅ ์๋(unbiased) ์ต์ข
ํ๊ฐ
- K-fold cross-validation
- 3๊ฐ set์ ๋ง๋ค๊ธฐ์ data๊ฐ ์ถฉ๋ถํ์ง ์์ ๋ ์ฌ์ฉ
- Data๋ฅผ k๊ฐ์ ๋์ผํ subset์ผ๋ก ๋ถ๋ฆฌ
- k ๋ผ์ด๋์ ํ์ต ์ํ: ๋งค ๋ผ์ด๋๋ง๋ค 1/k์ validation set์ผ๋ก, ๋๋จธ์ง๋ training set์ผ๋ก ์ฌ์ฉ
- ๋ง์ด ์ฐ์ด๋ k ๊ฐ: 5, 10
- (Cross-validation ์ฌ์ฉ ์์๋) ์ฌ์ ํ ๋ณ๋์ test set ํ์

- ์์: ์ ํ ํจ์(linear function)๋ data set์ underfit, ๊ณ ์ฐจ ๋คํญ์(high-degree polynomial)์ overfit
- ์ข์ hypothesis๋ฅผ ์ฐพ๋ ์์
์ 2๊ฐ์ ํ์ ์์
์ผ๋ก ๊ฐ์ฃผ ๊ฐ๋ฅ
- Model (class) selection (hypothesis space ์ ํ): ์ข์ hypothesis space ์ ํ
- Optimization (๋๋ training): ํด๋น space ๋ด์์ ์ต์์ hypothesis ํ์
- Model selection์ ์ผ๋ถ๋ ์ง์ (qualitative)์ด๊ณ ์ฃผ๊ด์ (subjective)
- ์: ๋ฌธ์ ์ ๋ํ ์ง์์ ๋ฐํ์ผ๋ก decision trees ๋์ polynomials ์ ํ
- Model selection์ ์ผ๋ถ๋ ์์ (quantitative)์ด๊ณ ๊ฒฝํ์ (empirical)
- ์: Polynomials class ๋ด์์, validation data set ์ฑ๋ฅ์ ๊ธฐ๋ฐํ์ฌ
Degree = 2 ์ ํ


- Model complexity๊ฐ ์ฆ๊ฐํจ์ ๋ฐ๋ผ training set error๋ ๋จ์กฐ๋กญ๊ฒ(monotonically) ๊ฐ์
- ๋ง์ model class์์ complexity๊ฐ ์ฆ๊ฐํ๋ฉด training set error๊ฐ 0์ ๋๋ฌ
- (a) U์ํ validation-error ๊ณก์
- (b) Validation error๊ฐ (์ฝ๊ฐ์ ๋ณ๋๊ณผ ํจ๊ป) ์ง์์ ์ผ๋ก ๊ฐ์ ์์
- ์ด๋ ์๋ก ๋ค๋ฅธ model class๊ฐ ์ด๊ณผ ์ฉ๋(excess capacity)์ ์ด๋ป๊ฒ ํ์ฉํ๋์ง, ๊ทธ๋ฆฌ๊ณ ๊ทธ๊ฒ์ด ๋น๋ฉดํ ๋ฌธ์ ์ ์ผ๋ง๋ ์ ์ผ์นํ๋์ง์ ๋ฐ๋ผ ๋ฌ๋ผ์ง