๋ฐ˜์‘ํ˜•

๋จธ์‹ ๋Ÿฌ๋‹ 12

[๋จธ์‹ ๋Ÿฌ๋‹2] Polynomial Regression python

์ง‘ ์‚ฌ์ด์ฆˆ์— ๋”ฐ๋ฅธ ๊ฐ€๊ฒฉ์„ ์˜ˆ์ธกํ•˜๋Š” One Variable Regression์„ ์ƒ๊ฐํ•ด๋ณด์ž. ๋ฐ์ดํ„ฐ์˜ ๋ถ„ํฌ๋ฅผ ๋ณด๋ฉด, ์˜ˆ์ธกํ•˜๋ ค๋Š” ์ง์„ ๊ฐ’์ด ์•ˆ ๋‚˜ํƒ€๋‚  ์ˆ˜๋„ ์žˆ๋‹ค. (์‚ฌ์ด์ฆˆ์™€ ๊ฐ€๊ฒฉ์ด ๋น„๋ก€ํ•˜์ง€ ์•Š์Œ) ์ด๋•Œ, ๋ณ€์ˆ˜๊ฐ’์„ ๊ทธ๋Œ€๋กœ ๊ณฑํ•˜๋Š”๊ฒƒ์ด ์•„๋‹Œ ๋ฃจํŠธx๋‚˜ x์˜ ๊ฑฐ๋“ญ์ œ๊ณฑ, sinx ๋“ฑ x๋ฅผ ๋ณ€ํ™˜ํ•œ ๊ฐ’์„ ์ƒˆ๋กœ์šด ์นผ๋Ÿผ์œผ๋กœ ์ถ”๊ฐ€ํ•˜์—ฌ ์˜ˆ์ธก๋ชจ๋ธ์„ ์ƒ์„ฑํ•  ์ˆ˜ ์žˆ๋‹ค. ์ด๋ฅผ ๋‹ค์ค‘ํšŒ๊ท€ํ•˜๋ฉด ๋œ๋‹ค.(lost function, gradient descent ์ˆ˜ํ–‰ํ•˜๋ฉด ๋จ) ํŒŒ์ด์ฌ์—์„œ ์‚ฌ์ดํ‚ท๋Ÿฐ์˜ PolynomialFeatures๋ฅผ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋‹ค. from sklearn.preprocessing import PolynomialFeatures https://scikit-learn.org/stable/modules/generated/sklearn.p..

[๋จธ์‹ ๋Ÿฌ๋‹1] ์„ ํ˜•ํšŒ๊ท€ Linear Regression , gradient descent pyhton

๊ณผ๊ฑฐ ๋ฐ์ดํ„ฐ ๊ธฐ๋ฐ˜์œผ๋กœ, ์ž…๋ ฅ ์ฃผ์–ด์กŒ์„ ๋•Œ ์ถœ๋ ฅ(์˜ˆ์ธก๊ฐ’)์ด ๋‚˜์™€์•ผ ํ•œ๋‹ค. ์˜ˆ์ธกํ•˜๊ณ ์ž ํ•˜๋Š” ๋ณ€์ˆ˜ = target variable(ํƒ€๊ฒŸ ๋ณ€์ˆ˜) ํƒ€๊ฒŸ ๋ณ€์ˆ˜๊ฐ€ ์‹ค์ˆ˜์ด๋ฉด = regression problem, ํƒ€๊ฒŸ ๋ณ€์ˆ˜๊ฐ€ ์นดํ…Œ๊ณ ๋ฆฌ ๋ณ€์ˆ˜์ด๋ฉด = classification (๋Œ€ํ‘œ์ ์ธ ๋ฐฉ๋ฒ•๋ก : ๋กœ์ง€์Šคํ‹ฑ ํšŒ๊ท€) ์ด ๋‘˜์€ supervised learning(์ง€๋„ ํ•™์Šต)์ด๋‹ค. unsupervised learning(๋น„์ง€๋„ ํ•™์Šต)์—๋Š” clustring(k-means) ๋“ฑ์ด ์žˆ๋‹ค. ์„ ํ˜•ํšŒ๊ท€ Linear Regression - ์ข…์† ๋ณ€์ˆ˜ ๐‘ฆ์™€ ํ•œ๊ฐœ ์ด์ƒ์˜ ๋…๋ฆฝ ๋ณ€์ˆ˜ ๐‘‹์™€์˜ ์„ ํ˜• ๊ด€๊ณ„๋ฅผ ๋ชจ๋ธ๋ง(=1์ฐจ๋กœ ์ด๋ฃจ์–ด์ง„ ์ง์„ ์„ ๊ตฌํ•œ๋‹ค)ํ•˜๋Š” ๋ฐฉ๋ฒ•๋ก  - ์ตœ์ ์˜ ์ง์„ ์„ ์ฐพ์•„ ๋…๋ฆฝ ๋ณ€์ˆ˜์™€ ์ข…์† ๋ณ€์ˆ˜ ์‚ฌ์ด์˜ ๊ด€๊ณ„๋ฅผ ๋„์ถœํ•˜๋Š” ๊ณผ์ • ๋…๋ฆฝ ๋ณ€์ˆ˜= ์ž…๋ ฅ ๊ฐ’..

๋ฐ˜์‘ํ˜•