Go言語でオンライン外れ値検出エンジンSmartSifterを実装した/smartsifter_in_golang

 Go言語でオンライン外れ値検出エンジンSmartSifterを実装した/smartsifter_in_golang

Cd3d2cb2dadf5488935fe0ddaea7938a?s=128

monochromegane

March 28, 2018
Tweet

Transcript

  1. ࡾ୐༔հ / Pepabo R&D Institute, GMO Pepabo, Inc. 2018.03.28 Fukuoka.go#10

    GoݴޠͰΦϯϥΠϯ֎Ε஋ݕग़ ΤϯδϯSmartSifterΛ࣮૷ͨ͠
  2. ϓϦϯγύϧΤϯδχΞ ࡾ୐༔հ!NPOPDISPNFHBOF (.0ϖύϘגࣜձࣾϖύϘݚڀॴ IUUQCMPHNPOPDISPNFHBOFDPN

  3. 3

  4. ҟৗݕ஌

  5. ҟৗݕ஌ 5

  6. • ݴ͏·Ͱ΋ͳ͘ਖ਼ৗͷ൓ର • ਖ਼ৗͱ͸͍ͭ΋ͷঢ়ଶɽͭ·Γɼ͍ͭ΋ͷঢ়ଶͰ͸ͳ͍͜ͱɽ • ඞͣ͠΋ෆਖ਼ͱ͸ݶΒͳ͍ • Ͱ͸ɼ͍ͭ΋ͷঢ়ଶͱɼͦ͏Ͱ͸ͳ͍͜ͱΛ੾Γ෼͚Δ৚݅͸Կ͔ɽ
 ·ͨɼͦ΋ͦ΋໌֬ʹ੾Γ෼͚Δ͜ͱ͕Ͱ͖Δͷ͔ 6

    ҟৗݕ஌ʹ͓͚Δɼҟৗͱ͸
  7. • ೖྗσʔλ͔Βσʔλൃੜ෼෍ͷ֬཰ϞσϧΛֶश͠ɼͦͷϞσϧΛجʹɼσʔ λͷҟৗ౓߹͍ɼ·ͨ͸ϞσϧͷҟৗͳมԽ౓߹͍ΛείΞϦϯά͢Δɽ 7 ౷ܭతҟৗݕ஌ ग़య: σʔλϚΠχϯάʹΑΔҟৗݕ஌ (ࢁ੢݈࢘) ೖྗ ֬཰Ϟσϧ

    ݕग़ର৅ ֎Ε஋ݕग़ ଟ࣍ݩϕΫτϧ ಠཱϞσϧ ֎Ε஋ มԽ఺ݕग़ ଟ࣍ݩ࣌ܥྻ ࣌ܥྻϞσϧ ࣌ܥྻͷٸܹͳมԽ σʔλϚΠχϯάʹΑΔҟৗݕ஌ (ࢁ੢݈࢘) ʹ͓͚Δҟৗݕ஌ͷ෼ྨʢൈਮʣ
  8. ҟৗݕ஌ 8 ֎Ε஋ݕग़ ಠཱϞσϧΛԾఆͯ͠ɼ૬ରతʹಛҟ ͳσʔλΛݕग़͢Δ มԽ఺ݕग़ ࣌ܥྻϞσϧΛԾఆͯ͠ɼٸܹͳมԽ Λݕग़͢Δ

  9. ҟৗݕ஌ 9 ֎Ε஋ݕग़ ಠཱϞσϧΛԾఆͯ͠ɼ૬ରతʹಛҟ ͳσʔλΛݕग़͢Δ

  10. ΦϯϥΠϯ֎Ε஋ݕग़Τϯδϯ SmartSifter Proposed by Yamanishi, K., Takeuchi, J., Williams, G.

    et al. (2004)
  11. • ҟৗΛᮢ஋΍ϗϫΠτϦετʹΑͬͯݕग़͢Δݻఆతͳ൑அج४͸ɼط஌ͷൣ ғͰͷ൑அͱͳΔ • ҟৗΛଞͷҰൠతͳσʔλͱҟͳΔ΋ͷͱߟ͑Δ͜ͱͰ͖ΔͳΒ͹ɼະ஌ͷࣄ ৅΋൑அͰ͖ΔͷͰ͸ -> ֎Ε஋ݕग़ • ୯७ͳ౷ܭతͳ֎Ε஋ݕग़ʢϚϋϥϊϏεڑ཭౳ʣͰ͸σʔλͷൃੜػߏ͕ม

    Խ͠ͳ͍͜ͱΛલఏͱ͍ͯ͠Δ 11 ֎Ε஋ݕग़ͱͦͷ՝୊
  12. • ΦϯϥΠϯ֎Ε஋ݕग़Τϯδϯ • ࣌ؒ͝ͱʹมԽ͍ͯ͘͠σʔλൃੜػߏʹରͯ͠దԠతʹֶश͠ɼείΞϦϯ ά͢Δ • ֶशͱείΞϦϯάΛσʔλೖྗ͝ͱʹஞ࣍ΦϯϥΠϯͰߦ͏ 12 SmartSifter On-line

    Unsupervised Outlier Detection Using Finite Mixtures with Discounting Learning Algorithms. Proposed by Yamanishi, K., Takeuchi, J., Williams, G. et al. (2004) Refs: http://cs.fit.edu/~pkc/id/related/yamanishi-kdd00.pdf
  13. SmartSifter 13 ( x , y ) SDLE (Sequentially Discounting

    Laplace Estimation) SDEM (Sequentially Discounting Expectation and Miximizing) or SPDU (Sequentially Discounting Prototype Updating) Log loss or Hellinger score ཭ࢄ஋ϕΫτϧ x ࿈ଓ஋ϕΫτϧ y p( x ) p( y | x ) ※ SDLEʹΑͬͯಉఆ͞Ε֤ͨηϧ͝ͱʹϞσϧ͕ଘࡏ͢Δ p( x ) p ( y | x ) SDEM (Sequentially Discounting Expectation and Miximizing) or SPDU (Sequentially Discounting Prototype Updating) SDEM (Sequentially Discounting Expectation and Miximizing) or SPDU (Sequentially Discounting Prototype Updating) SDEM (Sequentially Discounting Expectation and Miximizing) or SPDU (Sequentially Discounting Prototype Updating) ϞσϧΛߋ৽ ֘౰͢Δηϧʹ֘౰͢ΔϞσϧΛߋ৽ Ψ΢εࠞ߹෼෍ ώετάϥϜີ౓ SL(xt, yt) = log p (t 1) (xt, yt)
  14. SmartSifter 14 Refs: http://cs.fit.edu/~pkc/id/related/yamanishi-kdd00.pdf

  15. Written in Golang !

  16. monochromegane/go-smartsifter 16 https://github.com/monochromegane/smartsifter

  17. monochromegane/go-smartsifter 17 r := 0.1 // Discounting parameter. alpha :=

    1.5 // Hyper parameter for continuous variables. beta := 1.0 // Hyper parameter for categorical variables. cellNum := 0 // Only continuous variables. mixtureNum := 2 // Number of mixtures for GMM. dim := 2 // Number of dimentions for GMM. ss := smartsifter.NewSmartSifter(r, alpha, beta, cellNum, mixtureNum, dim) logLoss := ss.Input(nil, []float64{0.1, 0.2}, true) fmt.Println("Score using logLoss: %f\n", logLoss)
  18. SmartSifter 18

  19. SmartSifter -SDLE 19

  20. SmartSifter - SDEM 20

  21. • ϕΫτϧɼߦྻͷԋࢉ͸ɼgonumΛ࢖༻ • ཭ࢄ஋ϕΫτϧ͸ࠓͷͱ͜ɼ1࣍ݩͷΈ • ϊϯύϥϝτϦοΫͳSPDUͱϔϦϯδϟʔείΞ͸·ͩະ࣮૷ 21 monochromegane/go-smartsifter

  22. • ग़యຊͰ͸ɼૹड৴ͷωοτϫʔΫύέοτ৘ใΛجʹͨ͠ωοτϫʔΫ৵ೖ ݕ஌΍ෆ৹ҩྍσʔλݕग़ͷલॲཧͰɽ • ΧςΰϦΧϧʹ෼཭͠ͳ͕Βσʔλൃੜಛੑ͕ҟͳΔ΋ͷʹ༗ޮͦ͏ • σʔλϕʔεલஈͰςʔϒϧ΍ΧϥϜ͝ͱͷύϥϝλ஋΍ૹड৴ྔͳͲ • ୯ҰWebϦΫΤετ౳ΤϑΟϝϥϧͳঢ়ଶͷڍಈͷࠩҟΛجʹͨ͠ਪન •

    ๨٫܎਺ͳͲͷ࠷దͳϋΠύʔύϥϝʔλͷௐ੔͸ܦݧʹґଘ͢ΔͷͰ͸ɽ • Let’s discussion 22 ΦϯϥΠϯ֎Ε஋ݕग़ɼͲ͏࢖͍͔ͬͯ͘
  23. ݚڀһɺੵۃతʹืूதʂ http://rand.pepabo.com/