๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ

numpy
3

ํŒŒ์ด์ฌ ๊ธฐ๋ณธ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ ์‚ผ๋Œ€์žฅ ; Numpy Pandas Matplotlib ๋”๋ณด๊ธฐ๊ธฐ๋ณธ์ ์ธ python ๊ฐœ๋…์„ ์•Œ๊ณ  ์žˆ๋‹ค๋Š” ์ „์ œ ํ•˜, ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๋“ค์„ ๊ฐ„๋‹จํ•˜๊ฒŒ ์‚ฌ์šฉํ•˜๋Š” ๊ฒƒ๋“ค ์œ„์ฃผ๋กœ ๊ธฐ์–ตํ•˜๊ธฐ ์œ„ํ•ด ์ž‘์„ฑํ•˜๋Š” ๊ธ€์ž„์„ ์ฐธ๊ณ  ๋ถ€ํƒ๋“œ๋ฆฝ๋‹ˆ๋‹ค Pandas : ๋ฐ์ดํ„ฐ ํ”„๋ ˆ์ž„ ์ฝ๊ธฐ  pandas๋กœ ํŒŒ์ผ ์–ด๋–ป๊ฒŒ ์ฝ๋‚˜์š”? ๊ฐœ์ธ data/track_XY.txt ๋ฅผ ์‚ฌ์šฉ. ( ๊นƒํ—ˆ๋ธŒ์— ์žˆ๊ธดํ•œ๋ฐ ์ถ”ํ›„ ๊ณต๊ฐœ. ๋‹น์žฅ์€ ๋น„์Šทํ•˜๊ฒŒ ์ƒ๊ธด๋†ˆ ์ฐพ์œผ๋ฉด ๋˜๊ฒ ์๋‹ˆ๋‹ค )๋งˆ์ง€๋ง‰์— ์š”์•ฝ์œผ๋กœ ํ”„๋ฆฐํŠธํ•ด์ค˜์„œ ๊ฒฐ๊ณผ๊นŒ์ง€ ํ™•์ธํ•œ๋‹ค., ํ‘œ์ค€\ttab\s+ํ•˜๋‚˜ ์ด์ƒ์˜ ๊ณต๋ฐฑ''txt ํŒŒ์ผ์—์„œ ์ฃผ๋กœ ์‚ฌ์šฉr'\s+'column์ด space๋กœ ๊ตฌ๋ถ„๋˜์–ด ์žˆ๋Š” ๊ฒฝ์šฐ import pandas as pd# ํŒŒ์ผ ์ฝ๊ธฐtrack_data = "data/track_XY.txt"df = pd.read_table(track_data, .. 2024. 12. 3.
[Math] ํ–‰๋ ฌ์„ ์•Œ์•„๋ณด์ž ๋”๋ณด๊ธฐ๊ธฐ์กด ๋ถ€์บ  ๋•Œ ๋…ธ์…˜์— ๊ฐœ์ธ์ ์œผ๋กœ ์ •๋ฆฌํ•œ ๊ฒƒ์„ ๊ณต๋ถ€ํ•  ๊ฒธ ์ž‘์„ฑํ•œ ๊ธ€์ž…๋‹ˆ๋‹ค.๊ฐœ์ธ์ ์œผ๋กœ ํ•ด์„ํ•ด์„œ ์ž‘์„ฑํ•ฉ๋‹ˆ๋‹ค. (ํ‹€๋ฆด ์ˆ˜ ์žˆ์Œ. ์ •์ •์š”์ฒญ ์š”๋งใ…‹)** ๊ฐ•์˜์ž๋ฃŒ๋ฅผ ์‚ฌ์šฉํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค **** ์ƒ์—…์  ์ด์šฉ์„ ๊ธˆ์ง€ํ•ฉ๋‹ˆ๋‹ค **Today's Keywordํ–‰๋ ฌ ๊ณฑ์…ˆ, ํ–‰๋ ฌ ๋‚ด์ , ํ–‰x์—ดy, ํ–‰๋ ฌ๋ฒกํ„ฐ๋ฅผ ์›์†Œ๋กœ ๊ฐ€์ง€๋Š” 2์ฐจ์› ๋ฐฐ์—ดํ–‰๋ฒกํ„ฐ(row), ์—ด๋ฒกํ„ฐ(column)๋ฒกํ„ฐ๊ฐ€ ๊ณต๊ฐ„์—์„œ ํ•œ ์ ์„ ์˜๋ฏธํ•œ๋‹ค๋ฉด, ํ–‰๋ ฌ์€ ์—ฌ๋Ÿฌ ์ ๋“ค์„ ๋‚˜ํƒ€๋ƒ„. ๊ฐ™์€ ๋ชจ์–‘์ด๋ฉด๋ง์…ˆ, ๋บ„์…ˆ์„ฑ๋ถ„๊ณฑ (๊ฐ ์ธ๋ฑ์Šค ์œ„์น˜๋ผ๋ฆฌ ๊ณฑํ•˜๊ธฐ) X * Y = (Xij Yij)์Šค์นผ๋ผ๊ณฑ aX = aXijvector ๊ณต๊ฐ„์—์„œ ์‚ฌ์šฉ๋˜๋Š” ์—ฐ์‚ฐ์ž operator๋กœ ์ดํ•ด. ํ–‰๋ ฌ๊ณฑ์œผ๋กœ ๋ฒกํ„ฐ๋ฅผ ๋‹ค๋ฅธ ์ฐจ์› ๋ณด๋‚ด๋ฒ„๋ฆฌ๊ธฐ.ํŒจํ„ด์„ ์ถ”์ถœํ•  ์ˆ˜ ์žˆ๊ณ , ๋ฐ์ดํ„ฐ๋ฅผ ์••์ถ•ํ•  ์ˆ˜๋„ ์žˆ์Œ. ๋ชจ๋“  ์„ ํ˜•๋ณ€ํ™˜ linea.. 2024. 12. 2.
[Math] ๋ฒกํ„ฐ๋ฅผ ์•Œ์•„๋ณด์ž ๋”๋ณด๊ธฐ๊ธฐ์กด ๋ถ€์บ  ๋•Œ ๋…ธ์…˜์— ๊ฐœ์ธ์ ์œผ๋กœ ์ •๋ฆฌํ•œ ๊ฒƒ์„ ๊ณต๋ถ€ํ•  ๊ฒธ ์ž‘์„ฑํ•œ ๊ธ€์ž…๋‹ˆ๋‹ค.๊ฐœ์ธ์ ์œผ๋กœ ํ•ด์„ํ•ด์„œ ์ž‘์„ฑํ•ฉ๋‹ˆ๋‹ค. (ํ‹€๋ฆด ์ˆ˜ ์žˆ์Œ. ์ •์ •์š”์ฒญ ์š”๋งใ…‹)** ๊ฐ•์˜์ž๋ฃŒ๋ฅผ ์‚ฌ์šฉํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค **** ์ƒ์—…์  ์ด์šฉ์„ ๊ธˆ์ง€ํ•ฉ๋‹ˆ๋‹ค **Today's Keyword๋ฒกํ„ฐ, Norm, L1-norm, L2-norm, ๋‚ด์ , ์ •์‚ฌ์˜๋ฒกํ„ฐ๊ณต๊ฐ„์—์„œ ํ•œ ์ . ์›์ ์œผ๋กœ๋ถ€ํ„ฐ ์ƒ๋Œ€์  ์œ„์น˜ ํ‘œํ˜„์Šค์นผ๋ผ ๊ณฑ ํ•˜๋ฉด ๊ธธ์ด๋งŒ ๋ณ€ํ•จ.์ˆซ์ž๋ฅผ ์›์†Œ๋กœ ๊ฐ€์ง€๋Š” ๋ฆฌ์ŠคํŠธ, ๋ฐฐ์—ด๊ฐ™์€ ๋ชจ์–‘์ด๋ฉด ์„ฑ๋ถ„๊ณฑ Hadamard product๋ฒกํ„ฐ์˜ ๋ง์…ˆ == ๋‹ค๋ฅธ ๋ฒกํ„ฐ๋กœ๋ถ€ํ„ฐ ์ƒ๋Œ€์  ์ด๋™Norm = ์›์ ์—์„œ ๋ถ€ํ„ฐ์˜ ๊ฑฐ๋ฆฌ๋…ธ๋ฆ„์˜ ์ข…๋ฅ˜๋”ฐ๋ผ ๋‹ค๋ฆ„ -> ๊ธฐํ•˜ํ•™์  ์„ฑ์งˆ๋„ ๋‹ฌ๋ผ์งL1 norm - ๋ณ€ํ™”๋Ÿ‰์˜ ์ ˆ๋Œ€๊ฐ’ ๋ชจ๋‘ ๋”ํ•ด !for Robust ํ•™์Šต, Lasso ํšŒ๊ท€L2 norm - ํ”ผํƒ€๊ณ ๋ผ์Šค ์ •๋ฆฌ.. 2024. 11. 22.
๋ฐ˜์‘ํ˜•

์ตœ๊ทผ๋Œ“๊ธ€

์ตœ๊ทผ๊ธ€

skin by ยฉ 2024 ttutta