[Linear Classification] part 4 - 3

2023. 1. 19. 11:00
๐Ÿง‘๐Ÿป‍๐Ÿ’ป์šฉ์–ด ์ •๋ฆฌ

multiclass classification
One-VS-All
One Hot Encoding

Multiclass Classification

 

  • image recognition

 

-> binary classification์—์„œ์˜ ๋ฌธ์ œ์™€ ๊ฐ™์ด, n์ฐจ์›, signal space์—์„œ ์ž…๋ ฅ feature๋ฅผ plotting ํ›„, ์ด ์ž…๋ ฅ feature๋“ค์„ ์ ์ ˆํ•˜๊ฒŒ ๊ตฌ๋ถ„ํ•  ์ˆ˜ ์žˆ๋Š” hyper plane์„ ํ•™์Šตํ•˜๋ฉด์„œ ์–ป๊ฒŒ ๋ฉ๋‹ˆ๋‹ค.

 

 

 

์–ด๋–ค model์—์„œ๋Š” multiclass classification๋ฌธ์ œ์—์„œ ๋ฐ”๋กœ class id ๊ฐ’์„ ์ถœ๋ ฅํ•˜๋Š” ๊ฒฝ์šฐ๋“ค๋„ ์žˆ์ง€๋งŒ,

 

๋ณดํ†ต์€ binary classification ๋ฌธ์ œ๋ฅผ multiclass classification ๋ฌธ์ œ๋กœ ํ™•์žฅ์„ ํ•˜๋Š” ๊ฒฝ์šฐ๋„ ์šฐ๋ฆฌ๊ฐ€ ์ƒ๊ฐํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

 

์ด๊ฒƒ์„

 

One-VS-All

 

์ด๋ผ๋Š” ๊ฒƒ์œผ๋กœ ์ดํ•ดํ•  ์ˆ˜๊ฐ€ ์žˆ์Šต๋‹ˆ๋‹ค.

 

 

๋ช‡ ๊ฐœ์˜ hyper plane์„ ๊ทธ๋ ค์„œ multiclass classification ๋ฌธ์ œ๋ฅผ binary classification model๋กœ ํ•˜์—ฌ๊ธˆ ํ’€ ์ˆ˜ ์žˆ๊ฒŒ ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

 

์ด๋ ‡๊ฒŒ ์–ป๊ฒŒ๋œ Score ๊ฐ’๋“ค์˜ sigmoid ํ•จ์ˆ˜๋ฅผ ์‚ฌ์šฉํ•˜๊ฒŒ ๋˜๋ฉด, ํ™•๋ฅ  ๊ฐ’์œผ๋กœ ๋งคํ•‘ํ•˜๊ฒŒ ๋ฉ๋‹ˆ๋‹ค.

 

One Hot Encoding

 

์„ ์‚ฌ์šฉํ•˜๋ฉด,

 

๋‘ ๊ฐœ์˜ ์„œ๋กœ ๋‹ค๋ฅธ ํ‘œ ์‚ฌ์ด์— ๊ฑฐ๋ฆฌ๋ฅผ ๊ฐ€๊น๊ฒŒ ํ•˜๋ฉด์„œ ํ•™์Šตํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

 

์ด๋Š” ํ•ด๋‹นํ•˜๋Š” ์œ„์น˜์— 1์„ signalingํ•จ์œผ๋กœ์จ label์˜ ์ •๋ณด๋ฅผ ๊ธฐ๋กํ•˜๋Š” ๊ฒƒ์„ ๋งํ•ฉ๋‹ˆ๋‹ค.

 

ex) [1, 0, 0] , [0, 1, 0], [0, 0, 1], ...

 

์ด๋ ‡๊ฒŒ One Hot Encoding๋œ label ๊ฐ’๊ณผ ์šฐ๋ฆฌ์˜ sigmoid model์ด ์ถœ๋ ฅํ•˜๋Š” ํ™•๋ฅ  ๊ฐ’์„ ์„œ๋กœ ๊ฐ„์— ๋น„๊ตํ•˜์—ฌ loss function์„ ํ†ตํ•ด error๋ฅผ ๊ณ„์‚ฐํ•จ์œผ๋กœ์จ ํ•™์Šต์„ ํ•  ์ˆ˜๊ฐ€ ์žˆ๊ฒŒ ๋ฉ๋‹ˆ๋‹ค.

 

 

Linear Classification model์˜ ์žฅ์  ?
  • ๊ฐ„๋‹จํ•˜๋‹ค // ์‰ฝ๊ฒŒ ๊ตฌํ˜„ํ•  ์ˆ˜ ์žˆ๊ณ  ์‰ฝ๊ฒŒ testํ•  ์ˆ˜ ์žˆ๋‹ค.
  • ์ฒ˜์Œ์— ์‹œ๋„ํ•˜๊ธฐ์— ์ ํ•ฉํ•จ
  • ํ•ด์„ ๊ฐ€๋Šฅ์„ฑ์ด ๋†’๋‹ค.

 

'Artificial Intelligence' ์นดํ…Œ๊ณ ๋ฆฌ์˜ ๋‹ค๋ฅธ ๊ธ€

[Advanced Classification] part 5 - 2  (0) 2023.01.19
[Advanced Classification] part 5 - 1  (0) 2023.01.19
[Linear Classification] part 4 - 2  (0) 2023.01.19
[Linear Classification] part 4 - 1  (2) 2023.01.19
[Parameter] part 3 - 2  (0) 2023.01.16

BELATED ARTICLES

more