1. ML ๊ธฐ๋ฒ ๊ตฌ๋ถ
๐๐ฝโ๏ธ ๋ต์ด ์ฃผ์ด์ ธ ์๋ Supervised Learning
๐ ๐ฝ ๋ต์ด ์ฃผ์ด์ ธ ์์ง ์์ UnSupervised Learning
→ Simple Linear Regression(๋จ์์ ํํ๊ท)์ ๋ต์ด ์ฃผ์ด์ ธ ์๋ Dependent variable & Independent variable ๊ฐ์ ๊ด๊ณ๋ฅผ ๋ํ๋ด์ค๋ค.
→ ๋ฐ๋ผ์ Simple Linear Regression์ ์ง๋ํ์ต(Supervised Learning)์ ์ผ์ข !
2. Supervised Learning
→ ์ง๋ํ์ต์ ํ๋จ ๊ทธ๋ฆผ๊ณผ ๊ฐ์ model ์ ์ฐจ๋ฅผ ๋ฐ๋ผ๊ฐ๋ค.
(์ ๊ทธ๋ฆผ ์ค๋ช !) - 1-2-3-4-5 ์์ ์ ๋ฐ๋ผ๊ฐ๊ธฐ
โ test, docu, image์ ๊ฐ์ ๋ค์ํ format์ data์์ ํน์ง vector(X)๋ฅผ ๋ฝ์์จ๋ค
โก labelingํ labels data(y)๋ฅผ ๊ฐ์ ธ์จ๋ค
'A supervised learning algorithm makes the distinction between the raw observed data X with shape (n_samples, n_features) and some label given to the model while training by some teacher. In scikit-learn this array is often noted y and has generally the shape (n_samples,).'
→ ์ฌ๊ธฐ์ y์ ์ข ๋ฅ์ ๋ฐ๋ผ supervised learning์ ๋ค๋ฅธ ์ด๋ฆ์ ๊ฐ์ง๋ค..!
'If y has values in a fixed set of categorical outcomes (represented by integers) the task to predict y is called classification. If y has floating point values (e.g. to represent a price, a temperature, a size...), the task to predict y is called regression.'
- ์ฆ ๋ฒ์ฃผํ๋ก ํํ๋๋ (๋จ, ์ ์๋ก discretazied๋! ์๋ฅผ ๋ค๋ฉด 0๊ณผ 1๋ก) ๋ถ๋ฅ & float๋ก ํํ๋๋ ํ๊ท๋ก ๋๋จ!
โ classification vs. regression โ
property | classification | regression |
output type | discrete (class labels) | continuous (number) |
what to find? | decision boundary | "best fit line(it might not be line)" |
evaluation metrics | accuracy | sum of squared error / r squared |
→ classification์ผ๋ก discrete๋ data๋ฅผ ๋ฌถ๊ณ , regression์ผ๋ก continuousํ result์ ๋์๋๋ line์ ๋ง๋ ๋ค
โข ์ฃผ์ด์ง ํน์ง vector & label data๋ฅผ ๊ธฐ๋ฐ์ผ๋ก ML ์๊ณ ๋ฆฌ์ฆ ์์ฑ! fit(X,y)
(์ฆ, ํน์ง vector๋ฅผ ๊ฐ์ง๊ณ labels ๋์์ ๊ฒฐ๊ณผ๋ก ๋์ค๋ ์๊ณ ๋ฆฌ์ฆ์ fitting ์ํจ๋ค!)
model.fit(X,y)
→ ์ฆ, ์ฐ๋ฆฌ๋ ๋จธ์ ๋ฌ๋์ ํตํด ์ฃผ์ด์ง data์ ๋ต์ ๊ฐ์ง๊ณ ๊ด๋ จ rule์ ์ฐพ์๋ด๋ ๊ฒ์ด๋ผ๊ณ ๋งํ ์ ์๋ค ๐๐ฝ
'A machine-learning system is trained rather than explicitly programmed. It’s presented with many examples relevant to a task, and it finds statistical structure in these examples that eventually allows the system to come up with rules for automating the task. For instance, if you wished to automate the task of tagging your vacation pictures, you could present a machine-learning system with many examples of pictures already tagged by humans, and the system would learn statistical rules for associating specific pictures to specific tags.'
โฃ ์ ๊ทธ๋ ๊ฒ ํด์ ๋ง๋ค์ด์ง ML algorithm์ ๊ธฐ๋ฐ์ผ๋ก ์ด์ ์๋ก์ด feature vector, ์ฆ X๊ฐ ๋ค์ด์์ ๋ ML algorithm์ ์ํด ๋ง๋ค์ด์ง predicted model์ ๊ธฐ๋ฐ์ผ๋ก ๊ธฐ๋๋๋ expected label์ ๋ง๋ค๋ฉด ๋!
โค... ์ฐ๋ฆฌ๋ ์์ผ๋ก ๋ณต์กํ ์ฌ๋ฌ Supervised Learning ๊ธฐ๋ฒ์ ๋ฐฐ์ธ ๊ฒ์ด๋ค! - ๊ฐ ๊ธฐ๋ฒ๋ณ ์ถํ ํฌ์คํ ์ฐธ์กฐ ๐๐ฝ
โ classification / regression model ์ข ๋ฅ (ํ๋จ ์ฐธ์กฐ)
3. Regression / Linear Regression
* Supervised Learning์ ๋ํด ๋ฐฐ์ ๋ค. ์ด์ ๊ทธ ์ค ํ ๊ธฐ๋ฒ์ธ 'Regression ๊ธฐ๋ฒ'์ ๋ํด์ ๋ฐฐ์๋ณด์
Q. Regression์ด๋?
'Regression is the task of predicting the value of a continuously varying variable (e.g. a price, a temperature, a conversion rate...) given some input variables (a.k.a. the features, “predictors” or “regressors”).'
→ continuousํ๊ฒ ๋ณํ๋ ์ง์์ ์ธ ๋ณ์๋ฅผ ์์ธกํ ๋ ์ฐ์ด๋ ๊ธฐ๋ฒ์ด Regression!
→ ์ฆ, ๊ทธ ๋ป์ categorical ํ ๋ณ์๋ฅผ ์์ธกํ ๋๋ regression ๊ธฐ๋ฒ์ด ์ฐ์ด์ง ์๋๋ค๋ ์
Q. Linear Regression์ด๋?
๐ Regression์ธ๋ฐ ์์ธกํ๋ model์ด line์ ํํ๋ก ๋ํ๋๋ regression
- line์ ํํ๋ก regression๋์ด ์๋ linear regression ์ -
1> independent variable → dependent variable์ ์ํฅ์ ์ค๋ค
2>
- positive relationship) independent variable ๊ฐ์ด ์ฆ๊ฐํ๋ฉด์ dependent variable ๊ฐ๋ ์ฆ๊ฐ!
- negative relationship) independent variable ๊ฐ์ด ์ฆ๊ฐํ๋ฉด์ dependent variable ๊ฐ์ด ๊ฐ์!
3>
- Simple Linear Regression) feature๊ฐ 1๊ฐ์ด๊ณ target์ด 1๊ฐ
- Multiple Linear Regression) feature๊ฐ 2๊ฐ ์ด์์ด๊ณ target์ด 1๊ฐ
๐ ์ด์ ์ ์ฒด์ ์ธ ๊ฐ์์ ๋ํด์ ์์์ผ๋ ์ข ๋ฅ๋ณ Regression์ ๋ํด ์ถํ ํฌ์คํ ์ผ๋ก ์์ธํ ์์๋ณด์ ๐
์๋ ๐
** ์ถ์ฒ1) https://www.youtube.com/watch?v=G_0W912qmGc
** ์ถ์ฒ2) https://www.youtube.com/watch?v=zPG4NjIkCjc
** ์ถ์ฒ4) https://livebook.manning.com/book/deep-learning-with-python/chapter-1/19
'Machine Learning > Models (with codes)' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
(L2 Regularization) โ Ridge Regression (w/scikit-learn) (0) | 2022.04.20 |
---|---|
(L2 Regularization) โ Ridge Regression (concepts) (0) | 2022.04.19 |
Multiple Linear Regression Model (concepts+w/code) (0) | 2022.04.17 |
Simple Linear Regression Model (w/scikit-learn) (0) | 2022.04.16 |
Simple Linear Regression (concepts) (0) | 2022.04.14 |
๋๊ธ