Upgrade to Pro — share decks privately, control downloads, hide ads and more …

BigQueryとPythonではじめるプロ野球選手の成績予測(もしくは成績占い) / Baseball Player Performance Prediction using BigQuery and Python

BigQueryとPythonではじめるプロ野球選手の成績予測(もしくは成績占い) / Baseball Player Performance Prediction using BigQuery and Python

Baseball Play Study mini 2022/5/27 登壇資料

Shinichi Nakagawa

May 27, 2022
Tweet

More Decks by Shinichi Nakagawa

Other Decks in Research

Transcript

  1. ಥવͰ͕͢”੒੷”઎ͬͯ΋͍͍Ͱ͔͢?
    Shinichi Nakagawa@shinyorke


    Baseball Play Study mini 2022/05/27

    View full-size slide

  2. ຊ೔ͷςʔϚʮ໺ٿͱAIͱٕज़ʯ
    • ໺ٿAIΛ࡞ΔͨΊͷηΠόʔϝτϦΫεͱΞϧΰϦζϜ


    • ໺ٿAIΛࢧ͑Δٕज़ - PythonͱGoogle CloudΛఴ͑ͯ


    • ໺ٿAIͰ઎͍·͢, ʮਪ͠ͷબखͷ5೥ઌʯ


    ΍͖͏ͷਓ޻஌ೳΛ࡞ͬͨͷͰҰॹʹ༡΅͏ͥ⽁ʢཁ໿ʣ

    View full-size slide

  3. ࠓճͷ઎͍͸ʮଧऀͷ੒੷ʯͰ͢
    ౤खVer.΋ແ͘͸ͳ͍Ͱ͕͢, ݁Ռ͕ඍົͩͬͨͷͰଧऀͷΈͰ΍Β͍͖ͤͯͨͩ·͢🙏

    View full-size slide

  4. Who am I ?ʢ͓લ୭Αʣ
    • Shinichi Nakagawaʢத઒ ৳Ұʣ


    • େ఍ͷSNSͰʮshinyorkeʢ͠ΜΑʔ͘ʣʯͱ໊৐͍ͬͯ·͢


    • ΞΫηϯνϡΞגࣜձࣾϚωʔδϟʔʢຊۀʣ


    • ຊۀͷํͰ͸ʮGoogle Cloudڧ͍ϚϯʯతͳཱͪҐஔͰ

    ιϦϡʔγϣϯΞʔΩςΫτʢSRE/DevOpsपΓʣ


    • ݸਓ׆ಈ͸ʮ໺ੜͷ໺ٿσʔλαΠΤϯςΟετʯͱͯ͠

    ໺ٿʹؔ͢ΔσʔλαΠΤϯεͱΤϯδχΞϦϯάΛ͍ͯ͠·͢

    ʢ͔ͭ, ຊۀͰ΋ػցֶशΤϯδχΞɾσʔλαΠΤϯςΟετܦݧ͋Γʣ


    • ๺ւಓ೔ຊϋϜϑΝΠλʔζ&ΦʔΫϥϯυɾΞεϨνοΫεͷϑΝϯ⽁

    View full-size slide

  5. ຊ೔ͷଧॱ
    • ໺ٿAIΛ࡞ΔͨΊͷηΠόʔϝτϦΫεೖ໳


    • ໺ٿAIΛ࣮૷͢Δ - Google CloudΛఴ͑ͯ


    • ಥવͰ͕͢”੒੷”઎ͬͯ΋͍͍Ͱ͔͢⽁ - ໺ٿAIͰ

    View full-size slide

  6. ໺ٿAIΛ࡞ΔͨΊͷηΠόʔϝτϦΫεೖ໳

    View full-size slide

  7. ໺ٿAIΛࢧ͑ΔηΠόʔϝτϦΫε
    • ηΠόʔϝτϦΫε #ͱ͸


    • ηΠόʔϝτϦΫεͷ͖΄Μ


    • ʮͦͬ͘Γ͞Μʯ͔Β੒੷༧ଌ - PECOTAϞσϧ


    • shinyorke’s੒੷༧ଌϞσϧʮzobristʯվΊʮkenshiʯ


    શ෦࿩͢ͱ3.34͔͔࣌ؒΔͷͰࠓ೔͸֓ཁͷΈ঺հ🐯

    View full-size slide

  8. ηΠόʔϝτϦΫε #ͱ͸
    • ໺ٿʹ͓͍ͯൃੜ͢ΔσʔλΛ౷ܭֶతͳΞϓϩʔνͰ෼ੳΛߦ͍,

    ʮબखͷೳྗʯʮνʔϜͷڧ͞ʯͳͲந৅తͳ֓೦ΛఆྔతʹࢦඪԽ͠,

    νʔϜɾબखɾϑΝϯʹ໾ཱͯΔͨΊͷՊֶతͳΞϓϩʔνɾߟ͑ํͷ͜ͱ.


    • Ҏલ͸੒੷σʔλ͕ओྲྀ͕ͩͬͨ, ʮελοτΩϟετʯʮτϥοΫϚϯʯͱ͍ͬ
    ͨ, ܭଌػثτϥοΩϯάσʔλΛ༻͍ͯߦ͏ͷ͕ࠓͷτϨϯυ


    • ͳ͓, ੒੷σʔλͷΈͰ΋े෼͗͢Δ͙Β͍໘ന͍ࣄ͕ग़དྷ·͢

    ʢ㲈τϥοΩϯάσʔλ͸໺ٿɾٕज़ڞʹઐ໳஌͕ࣝ໰ΘΕΔ&೉қ౓ߴ͍ʣ

    View full-size slide

  9. ηΠόʔϝτϦΫεͷ͖΄Μ
    • ηΠόʔϝτϦΫε͸γϯϓϧͳ࢛ଇԋࢉ͓Αͼ౷ܭͰߦ͏ࣄ͕Ͱ͖Δ


    • Α͘஌ΒΕ͍ͯΔʮOPSʯʮWHIPSʯͳͲ,

    ਺ࣜͦͷ΋ͷ͸ి୎΍ExcelͰܭࢉ͕Մೳʢ㲈ϓϩάϥϛϯάෆཁʣ


    • Ұํ, ʮWARʯʮRCʯͳͲͷࢦඪ͸ܭࢉׂ͕ͱෳࡶ, ExcelͰग़དྷͳ͘΋ແ͍͕,

    ϓϩάϥϛϯά΍SQL, ػցֶशͳͲͰॲཧͨ͠΄͏͕ྑ͍ύλʔϯ΋ଘࡏ͢Δ.


    • ੒੷༧ଌ͸ʮಛ௃ྔΤϯδχΞϦϯάʯͱͯ͠ѻ͏ͱ࣮ݱ͢Δ͜ͱ͕Ͱ͖Δʂ

    ʢͱ͍͏ͷ͕͜ͷൃදͷٕज़తͳςʔϚͰ͢ʣ

    View full-size slide

  10. ໺ٿσʔλΛಛ௃ྔʹม׵͢Δ
    ಛ௃ྔʢ㲈਺஋ʣʹม׵ɾ୯ҐΛἧ͑Δ஍ಓͳ࡞ۀ͕ඞཁ


    • ਺஋ -> ਺஋


    • ͦͷ··࢖͑ΔϞϊ͕ଟ͍. ྫ͑͹҆ଧ, ࢛ٿ, ࡾৼͳͲ.


    • Θ͔Γ΍͍͢୯Ґʹਖ਼نԽɾεέʔϦϯά͢Δ. RC, wRAA, wOBAͳͲͷηΠόʔϝτϦΫεࢦඪ.


    • ਺஋Ҏ֎ͷσʔλ -> ਺஋


    • ར͖࿹΍ଧ੮ͷࠨӈ, ఱવࣳ or ਓ޻ࣳ, ໺֎ or υʔϜ or େࣗવʢॴ୔ͱ͸ݴ͍ͬͯͳ͍ʣ?


    • ਺஋Ͱ͸ແ͍σʔλΛಛ௃ྔʹ͢ΔͨΊͷॲཧ͕ඞཁʢΧςΰϦʔʹ͢ΔͳͲʣ

    View full-size slide

  11. ϓϩ໺ٿબखͷ੒੷Λ઎͏ٕज़
    • ੒੷༧ଌͦͷ΋ͷ͸ηΠόʔϝτϦΫεᴈ໌ظ͔Β͋Δఆ൪ωλͰ,

    ΞϝϦΧʹ͸ϑΝϯ޲͚ͷ੒੷༧ଌαΠτ͕͋Δ͙Β͍ͷ੝Γ্͕Γ.


    • τϥοΩϯάσʔλ͕ओྲྀͷࠓͰ΋બखͷ݈߁؅ཧ΍ύϑΥʔϚϯε
    ଌఆͳͲΛ௨ͯ͡কདྷͷύϑΥʔϚϯεΛ༧ଌ͢Δ͜ͱ΋.

    ※੒੷༧ଌͷݱ৔׆༻, ͱ΋ݴ͑ΔʢPlayer’s Developmentʣ


    • ݹయత͔ͭ୅දతͳ੒੷༧ଌϞσϧͱͯ͠, PECOTAʢϖίλʣ͕༗໊.

    View full-size slide

  12. PECOTA - ࠷΋౷ܭతͳ੒੷༧ଌϞσϧ
    • 2003೥ʢ19೥લʣʹϦϦʔεͨ͠MLBͷ੒੷༧ଌϞσϧ


    • ʮաڈͷࣅ͍ͯΔબखͷ੒੷ʯ͔Β༧ଌ੒੷Λࢉग़

    ͳ͓۩ମతͳख๏ɾ਺ࣜ͸ඇެ։ʢߟ͑ํ͸ͪΒ΄Βॻ͍ͯ͋Δʣ


    • ޙʹ2008೥ถࠃେ౷ྖબڍͷউऀΛ49/50भతதͤͨ͞

    ౷ܭֶऀωΠτɾγϧόʔ͕։ൃ


    ※ؾʹͳΔํ͸ʮγάφϧ&ϊΠζʯͱ͍͏ॻ੶ΛಡΜͰ͍ͩ͘͞

    View full-size slide

  13. ʮͦͬ͘Γ͞ΜʯΛ୳͢ࣄͰ੒੷Λ༧ଌͰ͖Δ!?
    աڈϝδϟʔϦʔάͰσϏϡʔͨ͠બख͸2021೥·Ͱʹ20, 370ਓ͍ΔʢLahman’s Baseball Databaseௐ΂ʣ


    ͜Ε͚͍ͩΕ͹, ʮੲͷ͋ͷਓͬΆ͍ʯ͙Β͍͸ग़ͤΔͷͰ͸ͳ͔Ζ͏͔???

    View full-size slide

  14. shinyorke’s༧ଌϞσϧʮkenshiʯര஀
    • աڈʢؚΉݱ໾ʣʹଘࡏͨ͠໺ٿબखͷ੒੷Λݩʹ, ʮࣅ͍ͯΔબखΛΫϥελϦϯάʯ

    Ͱ͖ͨΒ༧ଌ੒੷࡞ΕΔͷͰ͸? -> ࣮͸PECOTA΋͜ͷΞϓϩʔνʢ࠷ॳظ͸ʣ


    • ηΠόʔϝτϦΫεͰʮྨࣅੑείΞʯͱ͍͏ࣅ͍ͯΔબखΛಋ͘਺͕ࣜ͋Δ͕,

    ࢒೦ͳ͕Βܽ఺͕ଟ͍ʢ௨ࢉ੒੷ͰΫϥελϦϯά͢ΔͨΊ, όΠΞε͕ڧ͘ग़Δʣ


    • ʮ͋Δಛ௃ྔΛݩʹΫϥελϦϯάʯ͸ಛ௃ྔΤϯδχΞϦϯά͕ಘҙͳλεΫ

    ػցֶशతͳΞϓϩʔνͰߦ͚ΔͷͰ͸?આ -> Ͱ͖ͨ🙌


    • ϝδϟʔϦʔά൛AIʮzobristʯΛ։ൃ -> ͍͍ײͩͬͨ͡ͷͰ೔ຊϓϩ໺ٿ൛Λ࡞੒ˡࠓ͜͜


    ͜͏ͯ͠, shinyorke’sϓϩ໺ٿ੒੷༧ଌϞσϧ&໺ٿAIʮkenshiʯ͕ര஀.

    View full-size slide

  15. ໺ٿAIΛ࣮૷͢Δ - Google CloudΛఴ͑ͯ

    View full-size slide

  16. ໺ٿAIʮkenshiʯΛ࣮૷͢Δ
    • ΞʔΩςΫνϟͷશମ૾


    • σʔλऔಘͱલॲཧ


    • ΞϧΰϦζϜΛܾΊͯΫϥελϦϯά


    • ༧ଌ੒੷Λ፻଄͢Δੜ੒͢Δ


    ͪͳΈʹkenshi໊ͬͯલͷ༝དྷ͸ӈ౤྆ଧͷ͋ͷબखΑΓʢࠢʣ

    View full-size slide

  17. ϓϩ໺ٿબख੒੷༧ଌϓϩμΫτશମ૾

    View full-size slide

  18. ΞʔΩͷجຊํ਑
    • σʔλ͸͢΂ͯBigQueryʹूΊΔʢ㲈Google CloudͰ͢΂ͯΛݻΊͨཧ༝ʣ


    • ֶशσʔλ΋ςετσʔλ΋͢΂ͯBQ


    • ޙड़͢Δલॲཧɾσʔλ؅ཧΛͳΔ΂͘SQLͰ΍Γ͔ͨͬͨ


    • αʔόϨεͳαʔϏεΛத৺ʹબΜͰ࢖͏ʢ㲈VMͰ͋Δඞཁ͕ແ͍ʣ


    • ΞϓϦ΋Ϋϩʔϥʔ΋CI/CD΋αʔόϨεܥͷαʔϏεͰݻΊΔ


    • ʮ࢖ͬͨ෼ʯ͚ͩඅ༻ʹͳΔͷͰࡒ෍ʹ༏͍͠&εέʔϦϯά΋ָ

    View full-size slide

  19. αϥοͱղઆ
    • Data Analytics


    • BigQuery͕͢΂ͯͷத৺, σʔλ͸͢΂ͯ͜͜


    • Cloud ConsoleͰΫΤϦʔΛॻ͍ͯσʔληοτ࡞੒, ೉͍͠λεΫ͸Jupyter Lab্Ͱ࣮ࢪ


    • ωοτ͔Βऩू͢ΔσʔλʢCSVʣ͸Cloud Storageʹอଘ, Cloud FunctionsΛ࢖ͬͯBigQueryʹExport


    • Web App


    • StreamlitʢޙͰղઆʣͰ࣮૷ͨ͠ΞϓϦΛCloud RunͰϗετ


    • CI/CD͸GitHub ActionsͰαΫοͱ

    View full-size slide

  20. ϗϯτʹࡉ͔͍ٕज़ղઆ͸ϒϩάͰ
    https://shinyorke.hatenablog.com/entry/cloud-arch-serverless


    ࠓճͷൃද༻ͷ͓ֆ͔͖Ͱ͕ͨ͠ϒϩάͰόζͬͨ&ผ৔Ͱৄ͘͠࿩ͤΕ͹ʂ

    View full-size slide

  21. σʔλͷऔಘ
    • ֶशσʔλ͸ϝδϟʔϦʔάͷσʔλΛ࢖༻


    • Lahman’s Baseball Database


    • ্هσʔλϕʔεͷCSVσʔλΛBigQueryʹimport


    • ϓϩ໺ٿͷσʔλ͸Baseball Reference͔ΒεΫϨΠϐϯά


    • 2021೥γʔζϯऴྃ࣌੒੷ΛݩʹεΫϨΠϐϯά


    • Pythonͷrequests-htmlͰΫϩʔϥʔΛ࣮૷, CSVอଘ -> BigQuery

    View full-size slide

  22. ϝδϟʔϦʔάͷσʔλΛ࢖ͬͨཧ༝
    • ೔ຊͷϓϩ໺ٿͰ·ͱ·ͬͨσʔληοτ͕ଘࡏ͠ͳ͍


    • ͋Δॴʹ͸͋Δ͕, ݖརతʹ࢖͑Δ͔ո͍͠


    • ϝδϟʔϦʔά͸Φʔϓϯσʔλ͕ॆ࣮͔ͭݖར΋େৎ෉


    • αϯϓϧσʔλͷେ͖͞ʢ100೥Ҏ্͋ΔͷͰे෼͗͢Δʣ


    • ಉ͡໺ٿͱ͍͏ڝٕ͔ͭه࿥΋มΘΒͳ͍ͷͰӨڹ͸গͳ͍ͱ൑அ

    View full-size slide

  23. લॲཧ
    • ֶशʹඞཁͳσʔλ͸SQLͰՃ޻, Viewʹͯ͠อଘ

    →Google Cloud ConsoleͰ࣮ࢪ


    • Ͳ͏ͯ͠΋SQLͰ͸໘౗͍͘͞΋ͷΛPandasͳͲͰॲཧ

    →ࣗ෼ͷPC্ʹ࡞ͬͨJupyter Lab؀ڥͰ࣮ࢪ


    • ֶशʹඞཁͳ௨ࢉ੒੷ɾ೥౓ผ੒੷Λࢉग़͢ΔͨΊͷ

    ΫΤϦʔ΍σʔληοτΛͻͨ͢Β࡞Γ·ͬͨ͘

    View full-size slide

  24. લॲཧͷྫ - SQLͰߦ͏໺ٿͷಛ௃ྔநग़
    • ଧ཰, ग़ྥ཰, OPSతͳͷ͸

    SQLͰܭࢉͰ͖Δ.


    • ΋͏ͪΐͬͱෳࡶͳࢦඪ΋.

    ྫ͑͹wOBAͱ͔.


    • ্ه͸BigQueryͰ׬݁͠·ͨ͠.

    View full-size slide

  25. લॲཧͷྫ - SQLͰߦ͑ͳ͍΋ͷ͸?
    • ൥ࡶͳॲཧɾܭࢉ͕ೖͬͨΓ,

    ߦྻͰ·ͱ·ͬͨϞϊͷॲཧ͸

    Python΍RͰॲཧ͕ϕετ.


    • ྫ͑͹ϐϘοτςʔϒϧ,

    άϧʔϐϯάͳͲ͸PandasͰ

    ॻ͍ͨ΄͏͕Θ͔Γ΍͍͢

    ͱ͖΋͋Δʢॾઆ͋Γ·͢ʣ


    • SQL͕ۤखͳํ͸શ෦ͬͪ͜Ͱ΍ͬͯྑ͍͔΋.

    View full-size slide

  26. ΞϧΰϦζϜΛܾΊͯΫϥελϦϯά
    • ʮࣅ͍ͯΔબखʯΛ෼ྨ͢ΔλεΫ


    • ΞϧΰϦζϜΛܾΊΔˠ࠷ऴతʹ͸ANNʹ


    • AnnoyʢΞϊΠʔʣͰര଎ANN


    ෼ྨλεΫΛ࡞Γ, ςετΛॻ͖, γϡοͱCIͰ࠶࣮ߦՄೳʹ.

    View full-size slide

  27. ࣅ͍ͯΔબखΛ୳͢ɾ෼ྨ͢Δ
    • ௨ࢉ੒੷ͱकඋҐஔ͝ͱͷग़৔ճ਺Λಛ௃ྔͱ͢Δ͜ͱʹΑΓ,

    ʮࣅ͍ͯΔબखʯΛ୳͢͜ͱ͕ՄೳͳͷͰ͸?


    • ಛ௃ྔΛ࢖ͬͯΫϥελϦϯάͯ͠ڑ཭Λܭଌ,

    ͍ۙॱͰϥϯΩϯάԽ͢ΔʢϢʔΫϦουڑ཭ͳͲͰʣ


    • ͳ͓, PECOTA΋ʢ͓ͦΒ͘ʣߟ͑ํ͸ಉ͡.

    View full-size slide

  28. ANNʢۙࣅ࠷ۙ๣୳ࡧʣΛ࠾༻
    • ग़৔ࢼ߹਺, ଧ੮਺, ओཁͳଧܸ੒੷ʢ҆ଧ, ຊྥଧ, ଧ఺, etc…ʣ


    • कඋҐஔʢશ9ϙδγϣϯ, DH͸ߟྀ͠ͳ͍ʣผͷग़৔ճ਺


    • ্هΛಛ௃ྔͱͯ͠ANNʢۙࣅ࠷ۙ๣୳ࡧʣΛ͔ͭͬͯ

    ϢʔΫϦουڑ཭Λࢉग़͠, ͍ۙબखΛूΊΔ͜ͱʹ.


    • ʮAIʹΑΔࣆδϟύϯબग़ʯͱ͍͏ωλͰར༻->݁Ռ͸্ʑ

    https://shinyorke.hatenablog.com/entry/tokyo2020-samurai-japan


    • ࣮૷͸Annoyͱ͍͏௒ศརͳϥΠϒϥϦΛ࢖͍·ͨ͠.

    View full-size slide

  29. AnnoyΛ࢖ͬͨANNʹΑΔΫϥελϦϯά.
    ूΊͨσʔλΛ଍͠ࠐΜͰ΍Δ͜ͱͰΫϥελϦϯά͕Ͱ͖·ͨ͠.

    View full-size slide

  30. ݁ՌΛݟͯΈͨ
    • ΦϦοΫε٢ాਖ਼ঘʹࣅ͍ͯΔਓΛ୳͢


    • ༧ଌϞσϧʹ٢ాਖ਼ঘͷ੒੷Λ౉ͯ͠

    ΫϥελϦϯά݁ՌΛௐࠪ


    • ϋϯΫɾΞʔϩϯ, ΢ΟϦʔɾϝΠζ,

    ήϨʔϩଞ, ࣅ͍ͯΔ֎໺ख͕औΕͨͷͰ

    ੒ޭͱݴ͑ͦ͏🎉

    ※ήϨʔϩ͸ڈ೥ΦΦλχαϯͱHRԦ૪͍ͨ͠ήϨʔϩJr.ͷ͓෕͞Μ

    View full-size slide

  31. ༧ଌ੒੷ͷग़͠ํ
    • ΫϥελϦϯάͷ݁Ռ, ্ҐʹϥϯΩϯά͞Εͨબखͷ

    ೥ྸผ੒੷Λऔಘ


    • ೥ྸผ੒੷ͷฏۉ΍ύʔηϯλΠϧΛࢼͯ͠,

    ऩ·Γͷྑ͍਺ࣈʹ͢Δ


    • ଧ਺ɾ҆ଧ਺ͳͲʮੵΈॏͶʯͷ੒੷Λ༧ଌޙ,

    ଧ཰ͳͲͷʮ཰ʯΛද͢੒੷Λܭࢉ

    View full-size slide

  32. ϓϩμΫτʹ͢Δ
    • ͻͱ·࣮ͣݧతͳΞϓϦέʔγϣϯΛ

    StreamlitͰ࣮૷


    • Streamlit͸ҰݴͰݴ͏ͱ

    ʮJupyter notebookΛΞϓϦʹ͢Δʯ

    ͨΊͷFramework


    • Dockerίϯςφʹͯ͠

    Cloud RunͰϗεςΟϯά

    View full-size slide

  33. ಥવͰ͕͢”੒੷”઎ͬͯ΋͍͍Ͱ͔͢?

    View full-size slide

  34. AIͰ઎͏ʮࠓ, ؾʹͳΔϓϩ໺ٿબखʯ
    • ݱࡏઈ޷ௐ, ޥͷ͋ͷਓ


    • ೋ಄ཽʢೋ౛ྲྀʣͤ͞Δඞཁ͸͋Δͷ͔ແ͍ͷ͔?


    • BIG BOSSʹࣅͯΔʢ͔΋͠Εͳ͍ʣ͋ͷબख


    ຊ౰͸12ٿஂ৮Ε͍ͨ…Ͱ͕࣌ؒ͢ͷ౎߹ʹΑΓ🙏

    View full-size slide

  35. ઈ޷ௐͳޥͷ͋ͷਓͱ͍͑͹
    • ࡔ૔ কޗʢ޿ౡʣ - 2016೥υϥϑτ4Ґ


    • ࡢ೥͍ͭʹϒϨΠΫ, ࠓ೥΋͜͜·Ͱଧ๮രൃ


    • ϝΠϯ͸ัख͕ͩ಺໺कΕΔϢʔςΟϦςΟ

    View full-size slide

  36. ͜Ε͸Τά͍ະདྷ༧૝ਤʢੌʣ

    View full-size slide

  37. ࡔ૔ কޗબखͷະདྷ
    • ࠓ೥ͷ༧૝ʮଧ཰.309 ຊྥଧ20ຊ ଧ఺70 OPS .903ʯ


    • ڈ೥ͷงғؾ͔Β͢ΔͱϦΞϧʹୡ੒Մೳͳ༧ײ͕!?


    • ݸਓతʹ͸΍ͬͺัख΍ͬͯ΄͍͠, νʔϜࣄ৘ͳΜ͚ͩΕͲ΋

    ʢଧͯΔัख͸͍Δ͚ͩͰΞυόϯςʔδେ͖͍ʣ

    View full-size slide

  38. ཽͷະདྷΛ઎͏ - ೋਓͷཽઓ࢜
    • AɾϚϧςΟωεʢத೔ʣ - 2018೥ೖஂ


    • ࠜඌ ߉ʢத೔ʣ - 2018೥υϥϑτ1Ґ


    • ଧ๮͓Αͼೋ౛ྲྀͰͪΐͬͱ࿩୊ΛݺΜͰ͍ΔೋਓΛ઎͏

    View full-size slide

  39. ཽͷະདྷ͸໌Δ͍͔΋?

    View full-size slide

  40. AɾϚϧςΟωεબखͷະདྷ
    • ࠓ೥ͷ༧૝ʮଧ཰.290 ຊྥଧ10ຊ ଧ఺44 OPS .862ʯ


    • OPSҎ֎͸ຊؾͰୟ͖ग़ͦ͠͏ͳ਺ࣈͳؾ͕͢Δ?


    • ཉΛݴ͑͹֎໺͡Όͳͯ͘ัखͰग़ͯ΄͍͠

    ัखͰ͜Ε͚ͩଧͬͨΒࠓͷ໺ٿͩͱੌ͍͜ͱʹ

    View full-size slide

  41. ࠜඌ ߉બखͷະདྷ
    • ࠓ೥ͷ༧૝ʮଧ཰.244 ຊྥଧ1ຊ ଧ఺6 OPS .654ʯ

    5೥ޙ·Ͱͷ༧ଌ΋…͏ʔʔΜ?


    • ඇৗʹौ͍ධՁ, ೋ౛ྲྀΛࢼ͢ҙຯ͸༧ଌ͚ͩͩͱ͋Γͦ͏?


    • ൩੒ܕͱ৴͍ͨ͡, ͍͘ΒͳΜͰ΋໺ٿAIͷධՁ͕ौ͗͢?

    ͪͳΈʹ౻ݪ ګେʢϩοςʣ΋ͳ͔ͳ͔ौ͍ධՁʹ

    View full-size slide

  42. BIG BOSSͷޙܧऀ͸୭ͩ?
    • ສ೾ தਖ਼ʢ೔ຊϋϜʣ - 2018೥υϥϑτ4Ґ


    • ύϫʔͱεϐʔυ, ࡶ͞Λ݉Ͷἧ͑ͨϑΟδΧϧϞϯελʔ

    ϑϧεΠϯάͰ͔ͬඈ͹͢ଧܸͱڧݞΛੜ͔ͨ͠कඋ͸

    ݱ໾࣌୅ͷBIG BOSSͦͷ΋ͷ


    • ࢲ, shinyorke͕ࠓ࠷΋ਪ͍ͯ͠Δϓϩ໺ٿબख

    View full-size slide

  43. ࢥͬͨΑΓBIG BOSSͬΆ͞?

    View full-size slide

  44. ສ೾ தਖ਼બखͷະདྷ
    • ࠓ೥ͷ༧૝ʮଧ཰.252 ຊྥଧ18ຊ ଧ఺52 OPS .780ʯ


    • ϗϯτʹୟ͖ग़ͦ͠͏ͳ਺ࣈ, ग़৔ػձ&ଧ཰࣍ୈͰ

    ͳΜͩͬͨΒຊྥଧ͸༧ଌ௨Γ΋͔ͨ͠͠Β௒͔͢΋?


    • 5೥ޙʹOPS.900௒͑Β͍͠ͷͰ, ͜ͷ઎͍౰ͨͬͯཉ͍͠

    View full-size slide

  45. ͪͳΈʹ, ϓϩτλΠϓͰ࡞ͬͨ


    ผͷAIϞσϧ͕มͳ༧ଌͯ͠·ͨ͠

    ʢࠓճVer.Ͱ͸͍͟͝·ͤΜʣ

    View full-size slide

  46. ສ೾ தਖ਼ͱBIG BOSS
    ଧ཰ ຊྥଧ ଧ఺
    #*(#044ࡀ

    ʢ೥ɾࡕਆʣ
    ຊ ଧ఺
    ສ೾தਖ਼ࡀ
    ʢ೥ͷ༧ଌ੒੷ʣ
    ຊ ଧ఺
    ΊͬͪΌ৽ঙ߶ࢤબख΍Μʂʂʂ

    View full-size slide

  47. ΍͖͏AIͰBIG BOSSͷޙܧऀ, ݟ͚ͭ·ͨ͠ʢ͜ͳΈʣ

    View full-size slide

  48. ΍͖͏AIͷ՝୊ͱ࣍ͷςʔϚ
    • ৽ਓબखͷ༧ଌ͕ʢϞσϧͷ࢓্༷ʣͰ͖ͳ͍


    • ݱϞσϧ͸௨ࢉ੒੷ϕʔεͰͷֶश&༧ଌͰ͋ΔͨΊ, ࣮੷ແ͍ϧʔΩʔͷ༧ଌ͕ग़དྷͳ͍


    • ߴߍɾେֶͷ੒੷Λͦͷ··࢖͑͹…ͱ͍͏୯७ͳղܾ͕Ͱ͖ͳ͍


    • ੒੷Ҏ֎ͷઆ໌ม਺ΛՃ͍͑ͨ


    • ΍ͬͺΓτϥοΩϯάσʔλ࢖͍͍ͨʂ͋ͱ͸ମ֨ͱ͔


    • ೔ຊϓϩ໺ٿͰ΍Δखஈ͸ແ͍͕, ϝδϟʔϦʔά͸Baseball Savant౳Ͱ͍͚ΔͷͰҾ͖ଓ͖AIΛҭ͍͖͍ͯͯͨ


    • ౤ख൛͕͋Μ·Γ͓΋͠Ζ͘ͳ͔ͬͨͷ͕չ͍͠


    • ҰԠ͋ΔͷͰ͕͢, ඍົͩͬͨͷͰൃද߇͑·ͨ͠, ࠤʑ໦ ࿕رͷະདྷ༧૝ਤݟͯΈ͍ͨͷͰ΋͏গ͕͠Μ͹Γ·͢.


    • ݱ࣮తʹ͸, ϓϩ໺ٿͰ͸଍Γͳ͍ಛ௃ྔ͕͋Γ·ͯ͠…ϝδϟʔϦʔά൛͸े෼࣮༻ʹת͑ΔͷͰ͕͢😇

    View full-size slide

  49. ࣍ͷల։
    • ੒੷઎͍ʢ੒੷༧ଌʣαΠτͷ্ཱͪ͛.

    σʔλͷݖརͱ͔ॾʑ্ख͘ղ্ܾͨ͠Ͱʢଟ෼͍͚Δͱࢥ͏ʣ.


    • ੒੷༧ଌΞϧΰϦζϜͷվྑ.

    ϝδϟʔϦʔά൛ͰτϥοΩϯάσʔλΛ࢖ͬͨϞσϧͷ։ൃ.


    • PyCon JP 2023ͱ͔, ϦΞϧ։࠵ͷBaseball Play StudyͰ·ͨձ͓͏.

    View full-size slide

  50. ಥવͰ͕͢”੒੷”઎ͬͯ΋͍͍Ͱ͔͢?
    • ໺ٿAI͸ηΠόʔϝτϦΫεͱػցֶशͷԠ༻Ͱ࣮૷Մೳ


    • ໺ٿAI͸BigQuery΍PythonͰ࡞ΕΔ


    • ัख͸ัखΛ΍Δ΂͖Ͱ, Ϛϯνϡ΢͸BIG BOSSͷޙܧऀ


    ·ͩ·ͩ༡΅͏ͱࢥ͍·͢ͷͰҾ͖ଓ͖ΑΖ͘͠ʂ

    View full-size slide

  51. ήʔϜηοτ
    ͝ਗ਼ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠


    Shinichi Nakagawa(Twitter/Facebook/etc… @shinyorke)

    View full-size slide