728x90
๋ฐ˜์‘ํ˜•

Computer Science 103

[swift] debugging์„ ์œ„ํ•ด view์—์„œ print๋ฌธ ์ฐ๋Š”๋ฒ•

์ถœ์ฒ˜ https://www.swiftbysundell.com/articles/building-swiftui-debugging-utilities/ Building SwiftUI debugging utilities | Swift by Sundell When working on any kind of app or system, it’s almost guaranteed that we’ll need to debug our code at one point or another. For example in order to reproduce a bug that’s been reported to us by either a tester or a user, to track down a race conditi www.swiftb..

[swift] @State, @ObservedObject, @EnvironmentObject ์ฐจ์ด!! (+@Binding)

references : https://pxxxsxzy.tistory.com/35 SwiftUI @State, @ObservedObject, @EnvironmentObject โญ๏ธ ๋ณธ๊ฒฉ์ ์œผ๋กœ SwiftUI๋ฅผ ๊ณต๋ถ€ํ•˜๊ธฐ ์ „ ๊ผญ ๊ธฐ์–ตํ•ด์•ผ ํ•  ์  โญ๏ธ ์šฐ๋ฆฌ๋Š” ๋”์ด์ƒ view์— ์ง์ ‘ ์ ‘๊ทผํ•ด์„œ view๋ฅผ ๋ฐ”๊พธ์ง€ ์•Š๋Š”๋‹ค. ๋Œ€์‹  view์˜ state๋ฅผ ๋ณ€๊ฒฝํ•ด์„œ ๊ทธ ๋ณ€๊ฒฝ๋œ state๊ฐ€ ๊ฒฐ๊ณผ๋ฅผ ์ขŒ์šฐํ•˜๋„๋ก ํ•œ๋‹ค. pxxxsxzy.tistory.com https://www.hackingwithswift.com/quick-start/swiftui/whats-the-difference-between-observedobject-state-and-environmentobject What’s the difference between @..

[swift] keyboard๋”ฐ๋ผ ๊ฐ™์ด ์˜ฌ๋ผ๊ฐ€๋Š” view ๋ฌธ์ œ (disable move up with keyboard)

https://stackoverflow.com/questions/65605917/how-do-you-prevent-swiftui-from-autoresizing-view-when-keyboard-appears How do you prevent SwiftUI from autoresizing view when keyboard appears I have a TextField in my iOS app, and it is positioned such that I don't want it to move when the keyboard appears. However, the view is autoresizing when the keyboard appears. Is there a way to pr... stackove..

[swift] GeometryReader

GeometryReader https://developer.apple.com/documentation/swiftui/geometryreader GeometryReader๋Š” SwiftUI ์—์„œ View๊ฐ€ ํฌํ•จ๋œ ๋ถ€๋ชจ๋ทฐ(์ปจํ…Œ์ด๋„ˆ)์˜ ํฌ๊ธฐ๋ฅผ ๊ธฐ์ค€์œผ๋กœ View์˜ frame ์กฐ์ ˆํ•˜๋Š” ๋ฐฉ๋ฒ•

[swift] xcode๊ฐ€ ๋‚ด ๊ธฐ๊ธฐ๋ฅผ ๋ชป ์ฐพ์„ ๋•Œ

Even though this one does not address the specific problem of the OP, it might be a solution for other people finding this question. In some circumstances, Xcode will not recognise (won't even see) a connected device that was previously recognised, even though there were no changes in Mac OS/iOS/Xcode versions. This seems to happen if you connect the device while the Mac and/or the device are lo..

[Xcode] Preview crashed ํ˜„์ƒ

๋‚˜๋Š” swift ์ž…๋ฌธ์ž๋‹ค swfit์–ธ์–ด๋ฅผ ์‚ฌ์šฉํ•˜๋ ค๋ฉด ๋ฐ˜๋“œ์‹œ xcode์—์„œ ์จ์•ผํ•œ๋‹ค (๋‹ค๋“ค ์•Œ์ฃ ?) ์ด๋Ÿฐ ์ž…๋ฌธ์ž์—๊ฒŒ preview๊ฐ€ ์ž๊พธ ์‹œ๋ จ์„ ์ค€๋‹ค ๋‚จ๋“ค์ด ํ•˜๋Š”๊ฑฐ ๋ณด๋‹ˆ๊นŒ preview๋ฅผ ํ†ตํ•ด์„œ dynamicํ•˜๊ฒŒ ์ฝ”๋”ฉํ•˜๊ณ  uiํ™•์ธํ•˜๋˜๋ฐ ๋‚˜๋Š” ๋ญ ํ™”๋ฉด ํด๋ฆญ๋งŒ ํ•˜๋ฉด ์ž๊พธ preview crashed ํ•˜๋ฉด์„œ ๋นจ๊ฐ„ ์—‘์Šค๊ฐ€ ๋œฌ๋‹ค ใ… ใ… ใ…  ๊ฒฐ๊ตญ ์—๋Ÿฌ๋ฅผ ๊ณ ์ณ๋ณด๊ธฐ๋กœ..! preview์ฐฝ ์ƒ๋‹จ์— ๋ณด๋ฉด preview crashed์— ๋Œ€ํ•œ ์„ค๋ช…์„ ํ•ด์ค€๋‹ค. ํ•„์ž์˜ ๊ฒฝ์šฐ๋Š” ์•„๋ž˜์™€ ๊ฐ™์ด ๋–ด๋‹ค ์ผ๋‹จ ํ•ด๊ฒฐ์„ ํ•˜๊ณ  ์‹ถ์—ˆ๊ธฐ ๋–„๋ฌธ์— Diagnostics๋ฅผ ํด๋ฆญํ•ด๋ดค๋‹ค HumanReadableNSError: Unable to boot device due to insufficient system resources. Please see Simula..

Computer Science 2021.06.04

[Machine Learning] LightGBM์ด๋ž€? โœ” ์„ค๋ช… ๋ฐ ์žฅ๋‹จ์ 

๐Ÿ“Œ Remind LightGBM์— ๋“ค์–ด๊ฐ€๊ธฐ์ „์— ๋ณต์Šต ๊ฒธ reminding์„ ํ•ด๋ณด์ž. Light GBM์˜ GBM์€ Gradient Boosting Model๋กœ, tree๋ฅผ ๊ธฐ๋ฐ˜์œผ๋กœ ํ•˜๋Š” ํ•™์Šต ์•Œ๊ณ ๋ฆฌ์ฆ˜์ด๋‹ค. ์ด GBM์˜ ํ•™์Šต๋ฐฉ์‹์„ ์‰ฝ๊ฒŒ๋งํ•˜๋ฉด, ํ‹€๋ฆฐ๋ถ€๋ถ„์— ๊ฐ€์ค‘์น˜๋ฅผ ๋”ํ•˜๋ฉด์„œ ์ง„ํ–‰ํ•œ๋‹ค๊ณ  ํ•  ์ˆ˜ ์žˆ๋‹ค. Gradient Boosting์—์„œ Boosting์€ ์—ฌ๋Ÿฌ๊ฐœ์˜ tree๋ฅผ ๋งŒ๋“ค๋˜, ๊ธฐ์กด์— ์žˆ๋Š” ๋ชจ๋ธ(tree)๋ฅผ ์กฐ๊ธˆ์”ฉ ๋ฐœ์ „์‹œ์ผœ์„œ ๋งˆ์ง€๋ง‰์— ์ด๋ฅผ ํ•ฉํ•˜๋Š” ๊ฐœ๋…์œผ๋กœ, Random Forest์˜ Bagging๊ธฐ๋ฒ•๊ณผ ๋‹ค๋ฅธ ๋ฐฉ๋ฒ•์ด๋‹ค. Boostingํ•˜๋Š” ๋ฐฉ์‹์—๋„ ํฌ๊ฒŒ 2๊ฐ€์ง€๊ฐ€ ์žˆ๋‹ค. 1. AdaBoost์™€ ๊ฐ™์ด ์ค‘์š”ํ•œ ๋ฐ์ดํ„ฐ(์ผ๋ฐ˜์ ์œผ๋กœ ๋ชจ๋ธ์ด ํ‹€๋ฆฐ ๋ฐ์ดํ„ฐ)์— ๋Œ€ํ•ด weight๋ฅผ ์ฃผ๋Š” ๋ฐฉ์‹ 2. GBDT์™€ ๊ฐ™์ด loss fun..

[Machine Learning] ๋จธ์‹ ๋Ÿฌ๋‹, ๋ชจ๋ธ์˜ ํŽธํ–ฅ(bias)๊ณผ ๋ถ„์‚ฐ(variance) : trade-off ๊ด€๊ณ„

๋จธ์‹ ๋Ÿฌ๋‹์—์„œ ํŽธํ–ฅ๊ณผ ๋ถ„์‚ฐ์€ ์–ธ์ œ ์“ฐ์ด๋Š” ์šฉ์–ด์ธ๊ฐ€? Supervised Learning(์ง€๋„ํ•™์Šต)์— ๋Œ€ํ•ด์„œ ๊ฐ„๋‹จํžˆ ์„ค๋ช…ํ•ด๋ณด์ž๋ฉด ์‚ฌ๋žŒ์ด ์ •ํ•ด์ค€ ์ •๋‹ต์ด ์žˆ๊ณ , ์šฐ๋ฆฌ์˜ ๋ชจ๋ธ์€ ๊ทธ ์ •๋‹ต์„ ์ž˜ ๋งž์ถ”๋Š” ๋ฐฉํ–ฅ์œผ๋กœ ํ•™์Šต(training)์„ ํ•œ๋‹ค. ์ด๋•Œ, ํ•™์Šต์„ ํ•˜๋ฉด์„œ ๋ชจ๋ธ์ด ๋‚ด๋†“๋Š” ์˜ˆ์ธก๊ฐ’๋“ค์˜ ๊ฒฝํ–ฅ์„ ํ‘œํ˜„ํ•˜๊ธฐ์œ„ํ•ด ํŽธํ–ฅ๊ณผ ๋ถ„์‚ฐ์ด๋ผ๋Š” ์šฉ์–ด๋ฅผ ์‚ฌ์šฉํ•œ๋‹ค. ์‰ฝ๊ฒŒ ๋งํ•˜์ž๋ฉด, ๋‹ค์Œ๊ณผ ๊ฐ™๋‹ค A. ์˜ˆ์ธก๊ฐ’๊ณผ ์ •๋‹ต ๊ฐ„์˜ ๊ด€๊ณ„๋ฅผ "ํŽธํ–ฅ"์œผ๋กœ ํ‘œํ˜„ (bias : model์˜ output๊ณผ ์‹ค์ œ๊ฐ’ ์‚ฌ์ด์˜ ์ œ๊ณฑ error, ์ •ํ™•๋„์™€ ๋น„์Šทํ•œ ๊ฐœ๋…) B. ์˜ˆ์ธก๊ฐ’๋ผ๋ฆฌ์˜ ๊ด€๊ณ„๋ฅผ "๋ถ„์‚ฐ"์œผ๋กœ ํ‘œํ˜„ (variance : model์ด ๊ฐ๊ธฐ ๋‹ค๋ฅธ train set์— ๋Œ€ํ•˜์—ฌ ์„ฑ๋Šฅ์˜ ๋ณ€ํ™”์ •๋„๊ฐ€ ๊ธ‰ํ•˜๊ฒŒ ๋ณ€ํ•˜๋Š”์ง€, ์•ˆ์ •์ ์œผ๋กœ ๋ณ€ํ•˜๋Š”์ง€๋ฅผ ๋‚˜ํƒ€๋‚ด๋Š” ์ฒ™๋„) [๋”ฅ๋Ÿฌ๋‹] Bia..

[๊ฐœ๋ฐœ์šฉ์–ด] pilot ์ด๋ž€?

Pilot ์›์‹œ ํ”„๋กœ๊ทธ๋žจ์ด๋‚˜ ์‹œํ—˜ ํ”„๋กœ๊ทธ๋žจ ๋“ฑ์„ ์‹œํ—˜ํ•˜๋Š” ์ผ ์ฆ‰, ํ”„๋กœ๊ทธ๋žจ์„ ์‹ค์ œ๋กœ ์šด์šฉํ•˜๊ธฐ ์ „์— ์˜ค๋ฅ˜, ๋˜๋Š” ๋ถ€์กฑํ•œ ์ ์„ ์ฐพ๊ธฐ ์œ„ํ•˜์—ฌ ์‹ค์ œ ์ƒํ™ฉ๊ณผ ์œ ์‚ฌํ•œ ์กฐ๊ฑด์—์„œ ์‹œํ—˜๊ฐ€๋™ํ•˜๋Š” ํ–‰์œ„ ๊ทธ๋ ‡๊ธฐ์— ์ƒˆ๋กœ์šด ์„œ๋น„์Šค ์ถœ์‹œ ์ „์— ๋งŽ์ด ์‚ฌ์šฉ๋จ ๋น„์Šทํ•˜๊ฒŒ ์‹œ๋ฒ”ํ…Œ์ŠคํŠธ ํ†ตํ•ฉํ…Œ์ŠคํŠธ ๋‹จ๊ณ„์˜ SW ๊ฒฐํ•จ์ธก์ •ํ…Œ์ŠคํŠธ ํ’ˆ์งˆ ๊ฒ€์ฆ ๋ผ๊ณ  ๋ณผ ์ˆ˜ ์žˆ๋‹ค reference : m.blog.naver.com/PostView.nhn?blogId=musalyh&logNo=220990847736&proxyReferer=https:%2F%2Fwww.google.com%2F

๋ฌธ์„œ์œ ์‚ฌ๋„

๋ฌธ์„œ์œ ์‚ฌ๋„ 0. Base ์˜ˆ๋ฅผ ๋“ค์–ด ๋‹ค์Œ๊ณผ ๊ฐ™์ด ๋ฌธ์„œ๊ฐ€ ์žˆ๊ณ , ๋ฌธ์„œ๋ฅผ feature space์— ๋†“๋Š”๋‹ค๊ณ  ์ƒ๊ฐํ•ด๋ณด์ž ๊ฐ•์•„์ง€ ๊ท€์—ฝ๋‹ค ๋งค์šฐ ๊ฐ•์•„์ง€๊ฐ€ ๊ท€์—ฝ๋‹ค 1 1 0 ๊ฐ•์•„์ง€๊ฐ€ ๋งค์šฐ ๊ท€์—ฝ๋‹ค 1 1 1 ๊ณ ์–‘์ด๊ฐ€ ๋งค์šฐ ๊ท€์—ฝ๋‹ค 0 1 1 ๊ฐ ๋‹จ์–ด ‘๊ฐ•์•„์ง€’, ‘๊ณ ์–‘์ด’, ‘๋งค์šฐ’๋ฅผ ์ถ•์œผ๋กœ ํ•˜๋Š” ํŠน์„ฑ๊ณต๊ฐ„(feature space)์—์„œ ๋‹ค์Œ ๋ฌธ์„œ๋“ค์„ ํ•˜๋‚˜์˜ ์ขŒํ‘œ๋กœ ์ƒ๊ฐํ•  ์ˆ˜ ์žˆ์Œ ‘๊ฐ•์•„์ง€๊ฐ€ ๊ท€์—ฝ๋‹ค’ --> (1,1,0) ‘๊ฐ•์•„์ง€๊ฐ€ ๋งค์šฐ ๊ท€์—ฝ๋‹ค’ --> (1,1,1) ‘๊ณ ์–‘์ด๊ฐ€ ๋งค์šฐ ๊ท€์—ฝ๋‹ค’ --> (0,1,1) ๋‘ ๋‹จ์–ด ํ˜น์€ ๋ฌธ์žฅ์ด ์ฃผ์–ด์กŒ์„ ๋•Œ, ์œ ์‚ฌ๋„๋ฅผ ์ธก์ •ํ•˜๋Š” ๋ฐฉ๋ฒ•์€ ์—ฌ๋Ÿฌ๊ฐ€์ง€๊ฐ€ ์žˆ๋‹ค cosine similarity jaccard similarity euclidean distance manhattan distance..

[Window10 ๋‹จ์ถ•ํ‚ค] ์œˆ๋„์šฐ10 ์œ ์šฉํ•œ ๋‹จ์ถ•ํ‚ค ๐Ÿ•น

[๊ฐ€์ƒ ๋ฐ์Šคํฌํ†ฑ]Win + Tab : ์œˆ๋„ 10์˜ ํ…Œ์Šคํฌ ๋ฐ”(Task bar)๋ฅผ ์—ฝ๋‹ˆ๋‹ค.Win + Ctrl + D : ๊ฐ€์ƒ ๋ฐ์Šคํฌํ†ฑ(Virture Desktop)์„ ํ•˜๋‚˜ ๋งŒ๋“ญ๋‹ˆ๋‹ค.Win + Ctrl + F4 : ํ˜„์žฌ์˜ ๊ฐ€์ƒ ๋ฐ์Šคํฌํ†ฑ์„ ๋‹ซ์Šต๋‹ˆ๋‹ค.Win + Ctrl + ์ขŒ์šฐ ๋ฐฉํ–ฅํ‚ค : ๋‹ค๋ฅธ ๊ฐ€์ƒ ๋ฐ์Šคํฌํ†ฑ ํ™”๋ฉด์œผ๋กœ ์ด๋™ํ•ฉ๋‹ˆ๋‹ค. [๋“€์–ผ๋ชจ๋‹ˆํ„ฐ]Win + P : ํ”„๋กœ์ ํŠธ, ๋“€์–ผ๋ชจ๋‹ˆํ„ฐ ์„ค์ •์ฐฝWin + Shift + ์ขŒ/์šฐ ๋ฐฉํ–ฅํ‚ค : ํ˜„์žฌ ์ฐฝ์„ ํ™•์žฅ๋œ ํ™”๋ฉด์œผ๋กœ ์ด๋™์‹œํ‚ฌ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ํ”„๋กœ์ ํ„ฐ๋‚˜ ๋“€์–ผ ๋ชจ๋‹ˆํ„ฐ ๊ตฌ์„ฑ์œผ๋กœ ํ™”๋ฉด์„ ํ™•์žฅํ–ˆ์„ ๋•Œ ์‚ฌ์šฉํ•˜๋ฉด ์ข‹์Šต๋‹ˆ๋‹ค. [์œˆ๋„์šฐ Sanp, ์ž‘์—…์ „ํ™˜]Win + ์ขŒ/์šฐ ๋ฐฉํ–ฅํ‚ค : ์‚ฌ์šฉ์ค‘์ธ ์ฐฝ์„ ์ขŒ์šฐ๋กœ ์ด๋™ ์‹œํ‚ต๋‹ˆ๋‹ค.Win + Tab : ์œˆ๋„์šฐ ์ž‘์—…๋ณด๊ธฐ๋ฅผ ์‹คํ–‰ํ•ฉ๋‹ˆ๋‹ค. (์—ด๋ ค์žˆ๋Š” ๋ชจ๋“  ์ฐฝ์„ ..

[python list] ํŒŒ์ด์ฌ ๋ฆฌ์ŠคํŠธ ์•ˆ ๋ฆฌ์ŠคํŠธ ํŽผ์น˜๊ธฐ_how to flatten a list of lists in python

#ํŒŒ์ด์ฌ ๋ฆฌ์ŠคํŠธ ํŽผ์น˜๊ธฐ #ํŒŒ์ด์ฌ 2d ๋ฆฌ์ŠคํŠธ ํŽผ์น˜๊ธฐ #python 2d list flatten #python nested list flatten ๋‹ค์Œ๊ณผ ๊ฐ™์ด 2D list๋ฅผ 1D list๋กœ ์ „ํ™˜ํ•˜๋Š” ๋ฐฉ์‹์„ 'flattening'์ด๋ผ๊ณ  ํ•œ๋‹ค 1. itertools์˜ chain ํ•จ์ˆ˜ ์‚ฌ์šฉํ•˜๊ธฐ import itertools List_2D = [['a','b','c'],[1,2,3],['d',4,'e']] #List to be flattened List_flat = list(itertools.chain(*List_2D)) print("Original List:",List_2D) print("Flattened List:",List_flat) # print๋ฌธ ์ถœ๋ ฅ๊ฒฐ๊ณผ # Original List: [['a', 'b..

Computer Science 2021.04.22
728x90
๋ฐ˜์‘ํ˜•