728x90
๋ฐ˜์‘ํ˜•

Computer Science 99

Random Forest ๊ฐ„.๋‹จ.๋ช….๋ฃŒ

Ensemble ์•™์ƒ๋ธ” ์—ฌ๋Ÿฌ ๊ฐœ์˜ ๋จธ์‹ ๋Ÿฌ๋‹ model์„ ์—ฐ๊ฒฐํ•˜์—ฌ ๊ฐ•๋ ฅํ•œ model์„ ๋งŒ๋“œ๋Š” ๊ธฐ๋ฒ• classifier/regression์— ์ „๋ถ€ ํšจ๊ณผ์  random forest์™€ gradient boosting์€ ๋‘˜๋‹ค model์„ ๊ตฌ์„ฑํ•˜๋Š” ๊ธฐ๋ณธ ์š”์†Œ๋กœ decision tree๋ฅผ ์‚ฌ์šฉํ•œ๋‹ค random forest ์กฐ๊ธˆ์”ฉ ๋‹ค ๋‹ค๋ฅธ ์—ฌ๋Ÿฌ decision tree์˜ ๋ฌถ์Œ ๋žœ๋ค ํฌ๋ ˆ์ŠคํŠธ์˜ ๋“ฑ์žฅ ๋ฐฐ๊ฒฝ : ๊ฐ๊ฐ์˜ tree๋Š” ๋น„๊ต์  ์˜ˆ์ธก์„ ์ž˜ ํ•  ์ˆ˜ ์žˆ์ง€๋งŒ, ๋ฐ์ดํ„ฐ์˜ ์ผ๋ถ€์— overfittingํ•˜๋Š” ๊ฒฝํ–ฅ์„ ๊ฐ€์ง ๋”ฐ๋ผ์„œ, ์ž˜ ์ž‘๋™ํ•˜์ง€๋งŒ ์„œ๋กœ ๋‹ค๋ฅธ ๋ฐฉํ–ฅ์œผ๋กœ overfitting๋œ tree๋ฅผ ๋งŽ์ด ๋งŒ๋“ค๊ณ  ๊ทธ ๊ฒฐ๊ณผ๋ฅผ ํ‰๊ท ๋‚ด๋ฉด overfitting์„ ์ค„์ผ ์ˆ˜ ์žˆ๋‹ค ์ด๋ ‡๊ฒŒ ํ•˜๋ฉด tree model์˜ ์˜ˆ์ธก ์„ฑ๋Šฅ์€ ์œ ์ง€ํ•˜๋˜ overf..

๋‹จ์ˆœ์„ ํ˜•ํšŒ๊ท€ / ๋‹ค์ค‘์„ ํ˜•ํšŒ๊ท€ ๊ฐ„.๋‹จ.๋ช….๋ฃŒ

๋‹จ์ˆœ์„ ํ˜•ํšŒ๊ท€ ํ•˜๋‚˜์˜ ํŠน์„ฑ์„ ์ด์šฉํ•ด์„œ ํƒ€๊ฒŸ ์˜ˆ์ธก y = wx + b y : ์˜ˆ์ธก๊ฐ’ x : ํŠน์„ฑ w : ๊ฐ€์ค‘์น˜/๊ณ„์ˆ˜(coefficient) b : ํŽธํ–ฅ(offset) ์ฃผ์–ด์ง„ sample data๋“ค์„ ์ด์šฉํ•˜์—ฌ ๊ฐ€์žฅ ์ ํ•ฉํ•œ w์™€ b๋ฅผ ์ฐพ์•„์•ผ ํ•จ -> ๋ณดํ†ต ๊ฒฝ์‚ฌํ•˜๊ฐ•๋ฒ•(gradient descent)๋ฅผ ์ด์šฉํ•ด์„œ ์ฐพ๋Š”๋‹ค ๋‹ค์ค‘์„ ํ˜•ํšŒ๊ท€ ์—ฌ๋Ÿฌ ๊ฐœ์˜ ํŠน์„ฑ์„ ์ด์šฉํ•ด์„œ ํƒ€๊ฒŸ ์˜ˆ์ธก y = w0x0 + w1x1 = w2x2 + ... + b ์—ญ์‹œ MSE๋ฅผ ์ตœ์†Œํ™”ํ•˜๋Š” ๊ฐ€์žฅ ์ ํ•ฉํ•œ w๋“ค๊ณผ b๋ฅผ ์ฐพ๋Š” ๊ฒƒ์ด ๋ชฉํ‘œ ๋ฌธ์ œ : ๊ณผ๋Œ€์ ํ•ฉ ๋  ๋•Œ๊ฐ€ ์ข…์ข… ์žˆ๋‹ค => ์ผ๋ฐ˜ํ™” ๋Šฅ๋ ฅ์ด ๋–จ์–ด์ง„๋‹ค ๋ฆฟ์ง€(Ridge)์™€ ๋ผ์˜(Lasso) ๋ฐฉ๋ฒ•์œผ๋กœ ํ•ด๊ฒฐ

[์šด์˜์ฒด์ œ] ๋ฉ”๋ชจ๋ฆฌ ๊ตฌ์กฐ

๋ฉ”๋ชจ๋ฆฌ ๊ตฌ์กฐ : program์„ ์‹คํ–‰์‹œํ‚ค๋ฉด ์šด์˜์ฒด์ œ๋Š” ์šฐ๋ฆฌ๊ฐ€ ์‹คํ–‰์‹œํ‚จ program์„ ์œ„ํ•ด ๋ฉ”๋ชจ๋ฆฌ ๊ณต๊ฐ„์„ ํ• ๋‹นํ•ด์คŒ. ์ฆ‰ os๋Š” program์„ ์‹คํ–‰์‹œํ‚ค๊ธฐ ์œ„ํ•œ ๋ฉ”๋ชจ๋ฆฌ ๊ณต๊ฐ„์„ ์ œ๊ณต ํ• ๋‹น๋˜๋Š” ๋ฉ”๋ชจ๋ฆฌ ๊ณต๊ฐ„์€ stack, heap, data ์˜์—ญ์œผ๋กœ ๋‚˜๋ˆ ์ง ์ด๋Ÿฌํ•œ ๋ฉ”๋ชจ๋ฆฌ ๊ณต๊ฐ„์ด ์–ด๋– ํ•œ ์šฉ๋„๋กœ, ์–ธ์ œ, ์–ด๋””์„œ ํ• ๋‹น๋˜๋Š”๊ฐ€ ํ• ๋‹น ์‹œ๊ธฐ: ํ”„๋กœ๊ทธ๋žจ์ด ์‹คํ–‰๋ ๋•Œ๋งˆ๋‹ค ํ• ๋‹น ์žฅ์†Œ: main memory (RAM) ํ• ๋‹น ์šฉ๋„: program ์‹คํ–‰ ์‹œ ํ•„์š”ํ•œ ๋ฉ”๋ชจ๋ฆฌ ๊ณต๊ฐ„(์ง€์—ญ/์ „์—ญ๋ณ€์ˆ˜ ์„ ์–ธ์„ ์œ„ํ•ด) ํ• ๋‹น ๋ฐ์ดํ„ฐ ์˜์—ญ : ์ „์—ญ๋ณ€์ˆ˜์™€ static ๋ณ€์ˆ˜๊ฐ€ ํ• ๋‹น๋˜๋Š” ์˜์—ญ ํ”„๋กœ๊ทธ๋žจ์ด ์‹œ์ž‘๊ณผ ๋™์‹œ์— ํ• ๋‹น๋˜๊ณ  program์ด ์ข…๋ฃŒ๋˜๋ฉด ๋ฉ”๋ชจ๋ฆฌ์—์„œ ์†Œ๋ฉธ๋จ #include int a=10; // data ์˜์—ญ์— ํ• ๋‹น int b=20; // prog..

[์šด์˜์ฒด์ œ] process vs thread

ํ”„๋กœ์„ธ์Šค์™€ ์Šค๋ ˆ๋“œ process and thread ์šด์˜์ฒด์ œ ์œ ํ˜• ๋‹ค์ค‘ ํ”„๋กœ๊ทธ๋ž˜๋ฐ ์‹œ์Šคํ…œ (multi programming) cpu๊ฐ€ ์ˆ˜ํ–‰ํ•  ์ž‘์—…์„ ํ•ญ์ƒ ๊ฐ€์ง€๋„๋ก ํ•˜์—ฌ cpu ์ด์šฉ๋ฅ  ์ฆ์ง„ ์šด์˜์ฒด์ œ๋Š” ๋ฉ”๋ชจ๋ฆฌ์— ์žˆ๋Š” ์ž‘์—… ์ค‘์—์„œ ํ•˜๋‚˜๋ฅผ ํƒํ•˜์—ฌ ์‹คํ–‰ํ•œ๋‹ค. multi programming์ด ์•„๋‹Œ ์‹œ์Šคํ…œ์—์„œ๋Š” ์ด ์ž‘์—…์€ ํ‚ค๋ณด๋“œ์—์„œ ๋ช…๋ น์„ ์ž…๋ ฅํ•˜๊ฑฐ๋‚˜, ์ž…์ถœ๋ ฅ ์กฐ์ž‘์ด ๋๋‚˜๋Š” ๊ฒƒ๊ณผ ๊ฐ™์€ ์–ด๋–ค์ผ์„ ๊ธฐ๋‹ค๋ ค์•ผํ•  ํ•„์š”๊ฐ€ ์žˆ์„ ์ˆ˜ ์žˆ๋Š”๋ฐ ์ด๋•Œ cpu๊ฐ€ ์œ ํœด์ƒํƒœ์— ๋†“์ด๊ฒŒ ๋œ๋‹ค. ํ•˜์ง€๋งŒ, multi programming system์—์„œ๋Š” ์šด์˜์ฒด์ œ๊ฐ€ ๊ฐ„๋‹จํžˆ ๋‹ค๋ฅธ ์ž‘์—…์œผ๋กœ ์ „ํ™˜ํ•˜์—ฌ ๊ทธ๊ฒƒ์„ ์ˆ˜ํ–‰ํ•˜๋„๋ก ํ•œ๋‹ค. ์•ž์˜ ์ž‘์—…์ด ๋๋‚˜๋ฉด ์ด ์ž‘์—…์€ cpu๋ฅผ ๋‹ค์‹œ ์ฐจ์ง€ํ•˜๊ฒŒ ๋œ๋‹ค. ๋”ฐ๋ผ์„œ ์ˆ˜ํ–‰๋  ์ž‘์—…์ด ๊ธฐ์–ต์žฅ์น˜์— ์ ์žฌ๋˜์–ด ์žˆ์œผ๋ฉด cpu๋Š” ์‰ฌ์ง€ ์•Š๋Š”๋‹ค..

[์šด์˜์ฒด์ œ] kernel vs shell ์ฐจ์ด

kernel๊ณผ shell์˜ ์ฐจ์ด kernel = core, ํ•ต์‹ฌ shell = ๊ป๋ฐ๊ธฐ ์šฐ๋ฆฌ๊ฐ€ terminal์— ls๋ผ๊ณ  ์ž…๋ ฅํ•˜๋ฉด ์šฐ๋ฆฌ๊ฐ€ ์ž…๋ ฅํ•œ ๋ช…๋ น์€ shell์—๊ฒŒ ๋ช…๋ น์„ ํ•œ๊ฒƒ. ๊ทธ๋Ÿผ shell์€ ์ด๊ฒƒ์„ ํ•ด์„ํ•ด์„œ kernel์ด ์ดํ•ดํ•  ์ˆ˜ ์žˆ๋„๋ก kernel์—๊ฒŒ ์ „๋‹ฌ ๊ทธ๋Ÿผ kernel์€ hardware๋ฅผ ์ œ์–ดํ•ด์„œ ์ผ์„ ์ˆ˜ํ–‰ํ•˜๋„๋ก ํ•จ hardware๋Š” ์ฒ˜๋ฆฌ๊ฒฐ๊ณผ๋ฅผ ๋‹ค์‹œ kernel์—๊ฒŒ, kernel์€ ๋‹ค์‹œ shell์—๊ฒŒ ์•Œ๋ ค์คŒ ๊ทธ๋Ÿผ shell์ด ์‹คํ–‰๋œ ๊ฒฐ๊ณผ๋ฅผ ์šฐ๋ฆฌ์—๊ฒŒ ๋ณด์—ฌ์ฃผ๋Š” ๊ฒƒ. ๊ทธ๊ฒƒ์ด ๋ฐ”๋กœ ls๋ฅผ enterํ–ˆ์„ ๋•Œ์˜ ๊ฒฐ๊ณผ์ธ ๋ชฉ๋ก๋“ค์„ ์—ด๊ฑฐํ•ด์ฃผ๋Š” ๊ฒƒ kernel๊ณผ shell์„ ์™œ ๋ถ„๋ฆฌํ•˜๋Š”๊ฐ€? - ์‚ฌ์šฉ์ž๊ฐ€ ๋” ํŽธ๋ฆฌํ•˜๊ฒŒ kernel์„ ์ œ์–ดํ•  ์ˆ˜ ์žˆ๋„๋ก ํ•˜๊ธฐ ์œ„ํ•ด์„œ shell๊ณผ kernel์„ ๋ถ„๋ฆฌํ•œ๋‹ค.

K-means Clustering ๊ฐ„.๋‹จ.๋ช….๋ฃŒ

์•Œ๊ณ ๋ฆฌ์ฆ˜ : 1) cluster์˜ ๊ฐœ์ˆ˜ k๋ฅผ ์ง€์ • k๊ฐœ์˜ ์ดˆ๊ธฐ ํ‰๊ท ๊ฐ’ ์ง€์ • 2) ์„ ํƒœํ•œ k๊ฐœ์˜ cluster ์ค‘์‹ฌ๊ณผ ๊ฐœ๋ณ„ ๋ฐ์ดํ„ฐ ์‚ฌ์ด์˜ ๊ฑฐ๋ฆฌ ๊ณ„์‚ฐ ๊ฐœ๋ณ„ ๋ฐ์ดํ„ฐ๋Š” ๊ฐ€์žฅ ๊ฐ€๊น๊ฒŒ ์žˆ๋Š” cluster์˜ ์ค‘์‹ฌ์„ ๊ทธ ๋ฐ์ดํ„ฐ๊ฐ€ ์†Œ์†๋˜๋Š” cluster๋กœ ํ• ๋‹น 3) ํด๋Ÿฌ์Šคํ„ฐ์— ์†ํ•˜๊ฒŒ ๋œ ๋ฐ์ดํ„ฐ๋“ค์˜ ํ‰๊ท ๊ฐ’์„ ์ƒˆ๋กœ์šด ํด๋Ÿฌ์Šคํ„ฐ์˜ ์ค‘์‹ฌ์œผ๋กœ ๋‘  4) 2~3๋‹จ๊ณ„๋ฅผ ์•Œ๊ณ ๋ฆฌ์ฆ˜์ด ์ˆ˜๋ ดํ•  ๋•Œ๊นŒ์ง€ ๋ฐ˜๋ณต (ํด๋Ÿฌ์Šคํ„ฐ์˜ ์ค‘์‹ฌ์ด ๋”์ด์ƒ ๋ณ€ํ•˜์ง€ ์•Š์„ ๋•Œ๊นŒ์ง€) ์ถœ์ฒ˜ : m.blog.naver.com/PostView.nhn?blogId=samsjang&logNo=221016339218&proxyReferer=https:%2F%2Fwww.google.com%2F [30ํŽธ] k-means ํด๋Ÿฌ์Šคํ„ฐ๋ง ์šฐ๋ฆฌ๋Š” ์—ฌํƒœ๊นŒ์ง€ ๋‹ต์ด ์ด๋ฏธ ์ œ์‹œ๋˜์–ด ์žˆ๋Š” ๋ฐ์ดํ„ฐ๋ฅผ ์ด์šฉํ•˜..

ํŒŒ์ด์ฌ ๊ฐ€์ƒํ™˜๊ฒฝ ๋งŒ๋“ค๊ธฐ (python)

#python ๊ฐ€์ƒํ™˜๊ฒฝ ๋งŒ๋“ค๊ธฐ #๊ฐ€์ƒํ™˜๊ฒฝ์— jupyter notebook์„ค์น˜ #ํŒŒ์ด์ฌ ๊ฐ€์ƒํ™˜๊ฒฝ์— ์ฅฌํ”ผํ„ฐ๋…ธํŠธ๋ถ ์„ค์น˜ 1. ๊ฐ€์ƒํ™˜๊ฒฝ ๋งŒ๋“ค๊ธฐpython3 -m venv ๊ฐ€์ƒํ™˜๊ฒฝ_์ด๋ฆ„ 2. ๊ฐ€์ƒํ™˜๊ฒฝ ํ™œ์„ฑํ™”source ๊ฐ€์ƒํ™˜๊ฒฝ_์ด๋ฆ„/bin/activate pip ๋กœ ํŒจํ‚ค์ง€ ๊ด€๋ฆฌpip ๋ผ๋Š” ํ”„๋กœ๊ทธ๋žจ์„ ์‚ฌ์šฉํ•˜์—ฌ ํŒจํ‚ค์ง€๋ฅผ ์„ค์น˜, ์—…๊ทธ๋ ˆ์ด๋“œ ๋ฐ ์ œ๊ฑฐํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.pip ๋Š” "search", "install", "uninstall", "freeze" ๋“ฑ ๋งŽ์€ ๋ถ€์† ๋ช…๋ น์„ ๊ฐ–๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค ์ฐธ๊ณ  :https://docs.python.org/ko/3/tutorial/venv.html jupyter notebook ์— ๊ฐ€์ƒํ™˜๊ฒฝ ์ถ”๊ฐ€(์ฐธ๊ณ ) https://medium.com/@5eo1ab/jupyter-notebook์—-๊ฐ€์ƒํ™˜๊ฒฝ-..

HTML/CSS font color name, HEX code, RGB

color ์ด๋ฆ„, hex code, RGB ์ฝ”๋“œ๊ฐ€ ๋‚˜์—ด๋˜์–ด ์žˆ์Šต๋‹ˆ๋‹ค. CSS color codes CSS color codes and names. Red colors Orange colors Yellow colors Green colors Cyan colors Blue colors Purple colors Pink colors White colors Gray colors Brown colors CSS color Red colors Color HTML / CSS Color Name Hex Code #RRGGBB Decimal Code (R,G,B) lightsalmon #FFA07A rgb(255,160,122) salmon #FA8072 rgb(250,128,114) darksalmon #E9967A r..

๋จธ์‹ ๋Ÿฌ๋‹/AI์—์„œ ์‚ฌ์šฉ๋˜๋Š” "Ground Truth" ๋œป

๋จธ์‹ ๋Ÿฌ๋‹์— ๊ด€๋ จํ•œ ๊ธ€์„ ์ฝ๋‹ค๋ณด๋ฉด "ground-truth"๋ผ๋Š” ์šฉ์–ด๋ฅผ ๋งŽ์ด ์ ‘ํ•˜๊ฒŒ ๋œ๋‹ค. "ground-truth"๋Š” ๊ธฐ์ƒํ•™์—์„œ ์œ ๋ž˜ํ•˜์˜€์œผ๋ฉฐ, ์–ด๋Š ํ•œ ์žฅ์†Œ์—์„œ ์ˆ˜์ง‘๋œ ์ •๋ณด๋ฅผ ์˜๋ฏธํ•˜๋Š” ์šฉ์–ด๋กœ ์‚ฌ์šฉ๋˜์—ˆ๋‹ค๊ณ  ํ•œ๋‹ค. ๊ทธ๋ ‡๋‹ค๋ฉด machine learning/AI์˜ ๋ฌธ๋งฅ์—์„œ ์‚ฌ์šฉ๋˜๋Š” "ground-truth"์˜ ๋œป์€ ๋ฌด์—‡์ธ๊ฐ€. What is ground truth? Ground truth isn't true. It's an ideal expected result. It might involve hand-labeling example datapoints to collect desirable answer data for training your system. For example, a set of images mig..

728x90
๋ฐ˜์‘ํ˜•