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

検索キーワードをPythonのScikit learnでクラスタリングした話 〜機械学習を使って自然検索に強いサイトを作る〜

検索キーワードをPythonのScikit learnでクラスタリングした話 〜機械学習を使って自然検索に強いサイトを作る〜

自然検索のサジェストキーワードを、PythonのScikit learnでクラスタリングすることで、検索キーワードに強いサイト作りをする

soheiyagi

July 14, 2019
Tweet

More Decks by soheiyagi

Other Decks in Programming

Transcript

  1. ػցֶशΛ࢖ͬͯࣗવݕࡧʹڧ͍αΠτΛ࡞Δ ݕࡧΩʔϫʔυΛTDJLJUMFBSOͰ ΫϥελϦϯάͨ͠࿩ 406 ˏTPIFJZBHJ TPIFJZBHJ

  2. ࣗݾ঺հ ͜Μͳਓʹฉ͍ͯཉ͍͠ Ͳ͜ͰΫϥελϦϯάΛ࢖͔ͬͨ ίʔυ͸ͲΜͳײ͡ ·ͱΊ ໨࣍

  3. ࣗݾ঺հ גࣜձࣾι΢୅දऔక໾ TPVDPKQ  ɾίϯςϯπϚʔέςΟϯά ɾ8FC޿ࠂӡ༻ ɾϚʔέςΟϯάπʔϧ࡞੒ ຊொΦʔϓϯιʔεϥϘӡӦ ɾΤϯδχΞͷίϛϡχςΟεϖʔε େࡕ1ZUIPOͷձɹΦʔΨφΠβʔ

    தখاۀிϛϥαϙઐ໳Ո೿ݣɹొ࿥ઐ໳Ո 8FC޿ࠂ΍ਓࡐϏδωεͷӦۀ͔Β࢓ࣄΛ͸͡Ίɺ 8FCӡ༻΍޿ࠂӡ༻Λ΍ΓͭͭɺϓϩάϥϜΛॻ͘ਓ ίʔυ͕ॻ͚ΔϚʔέολʔ !TPIFJZBHJ TPIFJZBHJ 4PIFJ:BHJʗീ໦૑ฏ
  4. ࣗݾ঺հ גࣜձࣾι΢୅දऔక໾ TPVDPKQ  ɾίϯςϯπϚʔέςΟϯά ɾ8FC޿ࠂӡ༻ ɾϚʔέςΟϯάπʔϧ࡞੒ ຊொΦʔϓϯιʔεϥϘӡӦ ɾΤϯδχΞͷίϛϡχςΟεϖʔε େࡕ1ZUIPOͷձɹΦʔΨφΠβʔ

    தখاۀிϛϥαϙઐ໳Ո೿ݣɹొ࿥ઐ໳Ո 8FC޿ࠂ΍ਓࡐϏδωεͷӦۀ͔Β࢓ࣄΛ͸͡Ίɺ 8FCӡ༻΍޿ࠂӡ༻Λ΍ΓͭͭɺϓϩάϥϜΛॻ͘ਓ ίʔυ͕ॻ͚ΔϚʔέολʔ !TPIFJZBHJ TPIFJZBHJ 4PIFJ:BHJʗീ໦૑ฏ ࠷ۙͷझຯ͸ ےτϨͰ͢ɻ
  5. ࣗݾ঺հ ͜Μͳਓʹฉ͍ͯཉ͍͠ Ͳ͜ͰΫϥελϦϯάΛ࢖͔ͬͨ ίʔυ͸ͲΜͳײ͡ ·ͱΊ ໨࣍

  6. ͜Μͳਓʹฉ͍ͯཉ͍͠ 8FCαΠτΛӡӦ͍ͯ͠Δਓ ϒϩάΛӡӦ͍ͯ͠Δਓ &$αΠτΛӡӦ͍ͯ͠Δਓ ɾɾɾ 8FCαΠτ͔Β Կ͔͠Βͷ੒Ռ͕ཉ͍͠ਓ

  7. ࣗݾ঺հ ͜Μͳਓʹฉ͍ͯཉ͍͠ Ͳ͜ͰΫϥελϦϯάΛ࢖͔ͬͨ ίʔυ͸ͲΜͳײ͡ ·ͱΊ ໨࣍

  8. Ͳ͜ͰΫϥελϦϯάΛ࢖͔ͬͨ 8FCαΠτઃܭͷྲྀΕ αδΣετϫʔυͷऔಘ ʢϢʔβʔχʔζ͕͋ΔΩʔϫʔυ܈ʣ ҙຯͷ͋Δմʹάϧʔϐϯά άϧʔϐϯάΛݩʹαΠτઃܭ

  9. Ͳ͜ͰΫϥελϦϯάΛ࢖͔ͬͨ 8FCαΠτઃܭͷྲྀΕ αδΣετϫʔυͷऔಘ ʢϢʔβʔχʔζ͕͋ΔΩʔϫʔυ܈ʣ ҙຯͷ͋Δմʹάϧʔϐϯά άϧʔϐϯάΛݩʹαΠτઃܭ

  10. αδΣετϫʔυͷऔಘ Ϣʔβʔχʔζ͕͋ΔΩʔϫʔυ܈ΛूΊΔ

  11. αδΣετϫʔυͷऔಘ Πϊϕʔγϣϯࣄྫ Πϊϕʔγϣϯࣄྫ೔ຊ Πϊϕʔγϣϯࣄྫ࠷ۙ Πϊϕʔγϣϯࣄྫ Πϊϕʔγϣϯࣄྫւ֎ ΠϊϕʔγϣϯࣄྫJQIPOF Πϊϕʔγϣϯࣄྫ࠷৽ Πϊϕʔγϣϯࣄྫ਎ۙ ΠϊϕʔγϣϯࣄྫΞϝϦΧ

    Πϊϕʔγϣϯࣄྫ΢ΥʔΫϚϯ ΤίγεςϜΠϊϕʔγϣϯࣄྫ ӦۀΠϊϕʔγϣϯࣄྫ ΠϊϕʔγϣϯΦϑΟεࣄྫ ΦʔϓϯΠϊϕʔγϣϯࣄྫ ΦʔϓϯΠϊϕʔγϣϯࣄྫ೔ຊ ΦʔϓϯσʔλΠϊϕʔγϣϯࣄྫ େࡕΨεΠϊϕʔγϣϯࣄྫ Πϊϕʔγϣϯձࣾࣄྫ Πϊϕʔγϣϯ؀ڥࣄྫ Ձ஋Πϊϕʔγϣϯࣄྫ ֶੜΠϊϕʔγϣϯࣄྫ Πϊϕʔγϣϯࣄྫاۀ Πϊϕʔγϣϯۚ༥ࣄྫ େاۀΠϊϕʔγϣϯࣄྫ ٕज़Πϊϕʔγϣϯࣄྫ ۀքΠϊϕʔγϣϯࣄྫ Πϊϕʔγϣϯࣄྫ૊Έ߹Θͤ ݚڀ։ൃΠϊϕʔγϣϯࣄྫ Πϊϕʔγϣϯܦࡁࣄྫ ΠϊϕʔγϣϯܦӦࣄྫ খചۀΠϊϕʔγϣϯࣄྫ খചΠϊϕʔγϣϯࣄྫ ࢠڙΠϊϕʔγϣϯࣄྫ খചۀΠϊϕʔγϣϯࣄྫ ΠϊϕʔγϣϯࣄྫαʔϏε ࢈ֶ࿈ܞΠϊϕʔγϣϯࣄྫ αʔϏεۀΠϊϕʔγϣϯࣄྫ Πϊϕʔγϣϯࣄྫू Πϊϕʔγϣϯࣄྫࣦഊ Πϊϕʔγϣϯ঎඼ࣄྫ Πϊϕʔγϣϯ৽݁߹ࣄྫ ΤίγεςϜΠϊϕʔγϣϯࣄྫ ࣾձ՝୊Πϊϕʔγϣϯࣄྫ ࣾ಺Πϊϕʔγϣϯࣄྫ ΠϊϕʔγϣϯδϨϯϚࣄྫ Πϊϕʔγϣϯ࣋ଓత੒௕ࣄྫ Πϊϕʔγϣϯࣄྫੈք Πϊϕʔγϣϯ੡඼ࣄྫ ੡଄ۀΠϊϕʔγϣϯࣄྫ ଟ༷ੑΠϊϕʔγϣϯࣄྫ Πϊϕʔγϣϯ૊৫ࣄྫ Πϊϕʔγϣϯ૑ग़ࣄྫ ιʔγϟϧΠϊϕʔγϣϯࣄྫ೔ຊ ૑ൃΠϊϕʔγϣϯࣄྫ ଟ༷ੑΠϊϕʔγϣϯࣄྫ େاۀΠϊϕʔγϣϯࣄྫ μΠόʔγςΟΠϊϕʔγϣϯࣄྫ தখاۀΠϊϕʔγϣϯࣄྫ ΠϊϕʔγϣϯνʔϜࣄྫ Πϊϕʔγϣϯ஌ࣝ૑଄ࣄྫ ஍ҬΠϊϕʔγϣϯࣄྫ ΠϊϕʔγϣϯࣄྫσβΠϯࢥߟ σβΠϯΠϊϕʔγϣϯࣄྫ σδλϧΠϊϕʔγϣϯࣄྫ ഁյతΠϊϕʔγϣϯࣄྫ ඇ࿈ଓΠϊϕʔγϣϯࣄྫ ೔ཱΠϊϕʔγϣϯࣄྫ ϏδωεϞσϧΠϊϕʔγϣϯࣄྫ ϏδωεΠϊϕʔγϣϯࣄྫ ϏοάσʔλΠϊϕʔγϣϯࣄྫ ෋࢜ϑΠϧϜΠϊϕʔγϣϯࣄྫ ෋࢜௨ϑΟʔϧυΠϊϕʔγϣϯࣄྫ ෋࢜௨Πϊϕʔγϣϯࣄྫ ϓϩηεΠϊϕʔγϣϯࣄྫ ϓϩμΫτΠϊϕʔγϣϯࣄྫ ϔϧεέΞΠϊϕʔγϣϯࣄྫ Πϊϕʔγϣϯࣄྫຊ ΠϊϕʔγϣϯࣄྫϚΠΫϩιϑτ ϚʔέςΟϯάΠϊϕʔγϣϯࣄྫ ϢʔβʔΠϊϕʔγϣϯࣄྫ ϦόʔεΠϊϕʔγϣϯࣄྫ ΞʔΩςΫνϟϧΠϊϕʔγϣϯࣄྫ ࢈ֶ࿈ܞΠϊϕʔγϣϯࣄྫ QHΠϊϕʔγϣϯࣄྫ Πϊϕʔγϣϯࣄྫ NΠϊϕʔγϣϯࣄྫ Πϊϕʔγϣϯͭͷػձࣄྫ λʔήοτΩʔϫʔυʮΠϊϕʔγϣϯࣄྫʯ݅
  12. ҙຯͷ͋Δմʹάϧʔϐϯά ɾ೔ཱΠϊϕʔγϣϯࣄྫ ɾ෋࢜ϑΠϧϜΠϊϕʔγϣϯࣄྫ ɾେࡕΨεΠϊϕʔγϣϯࣄྫ ɾμΠόʔγςΟΠϊϕʔγϣϯࣄྫ ɾଟ༷ੑΠϊϕʔγϣϯࣄྫ ɾଟ༷ੑΠϊϕʔγϣϯࣄྫ ɾΠϊϕʔγϣϯδϨϯϚࣄྫ ɾΠϊϕʔγϣϯ࣋ଓత੒௕ࣄྫ ɾഁյతΠϊϕʔγϣϯࣄྫ

    اۀࣄྫ ଟ༷ੑ δϨϯϚ ໨ࢹͰ΍͍ͬͯͨͷΛɺ ػցֶशͰάϧʔϓ෼͚Λߦͬͨ
  13. ࣮ࡍͷਫ਼౓  ΠϊϕʔγϣϯܦӦࣄྫ Πϊϕʔγϣϯܦࡁࣄྫ Πϊϕʔγϣϯࣄྫ Πϊϕʔγϣϯࣄྫ΢ΥʔΫϚϯ ϓϩηεΠϊϕʔγϣϯࣄྫ  ඇ࿈ଓΠϊϕʔγϣϯࣄྫ 

    Πϊϕʔγϣϯձࣾࣄྫ ΠϊϕʔγϣϯࣄྫΞϝϦΧ ΠϊϕʔγϣϯࣄྫαʔϏε Πϊϕʔγϣϯࣄྫاۀ Πϊϕʔγϣϯࣄྫू Πϊϕʔγϣϯࣄྫ਎ۙ Πϊϕʔγϣϯࣄྫੈք Πϊϕʔγϣϯ঎඼ࣄྫ ϓϩμΫτΠϊϕʔγϣϯࣄྫ ٕज़Πϊϕʔγϣϯࣄྫ ࢠڙΠϊϕʔγϣϯࣄྫ  μΠόʔγςΟΠϊϕʔγϣϯࣄྫ ଟ༷ੑΠϊϕʔγϣϯࣄྫ ଟ༷ੑΠϊϕʔγϣϯࣄྫ  Πϊϕʔγϣϯࣄྫࣦഊ Πϊϕʔγϣϯ૊৫ࣄྫ ֶੜΠϊϕʔγϣϯࣄྫ  Πϊϕʔγϣϯࣄྫւ֎ ΦʔϓϯΠϊϕʔγϣϯࣄྫ ΦʔϓϯΠϊϕʔγϣϯࣄྫ೔ຊ  ΠϊϕʔγϣϯࣄྫσβΠϯࢥߟ σβΠϯΠϊϕʔγϣϯࣄྫ  Πϊϕʔγϣϯࣄྫ Πϊϕʔγϣϯࣄྫ࠷ۙ Πϊϕʔγϣϯࣄྫ࠷৽ Πϊϕʔγϣϯࣄྫ೔ຊ Πϊϕʔγϣϯ੡඼ࣄྫ αʔϏεۀΠϊϕʔγϣϯࣄྫ ϏδωεΠϊϕʔγϣϯࣄྫ ۀքΠϊϕʔγϣϯࣄྫ ੡଄ۀΠϊϕʔγϣϯࣄྫ  Πϊϕʔγϣϯ؀ڥࣄྫ Πϊϕʔγϣϯۚ༥ࣄྫ ιʔγϟϧΠϊϕʔγϣϯࣄྫ೔ຊ ϏδωεϞσϧΠϊϕʔγϣϯࣄྫ  ΠϊϕʔγϣϯδϨϯϚࣄྫ Πϊϕʔγϣϯ࣋ଓత੒௕ࣄྫ ഁյతΠϊϕʔγϣϯࣄྫ  খചΠϊϕʔγϣϯࣄྫ খചۀΠϊϕʔγϣϯࣄྫ খചۀΠϊϕʔγϣϯࣄྫ  ෋࢜௨Πϊϕʔγϣϯࣄྫ ෋࢜௨ϑΟʔϧυΠϊϕʔγϣϯࣄྫ  NΠϊϕʔγϣϯࣄྫ QHΠϊϕʔγϣϯࣄྫ ΞʔΩςΫνϟϧΠϊϕʔγϣϯࣄྫ ΠϊϕʔγϣϯΦϑΟεࣄྫ ΠϊϕʔγϣϯνʔϜࣄྫ ΠϊϕʔγϣϯࣄྫϚΠΫϩιϑτ Πϊϕʔγϣϯࣄྫຊ Πϊϕʔγϣϯ૑ग़ࣄྫ Πϊϕʔγϣϯ஌ࣝ૑଄ࣄྫ ΦʔϓϯσʔλΠϊϕʔγϣϯࣄྫ σδλϧΠϊϕʔγϣϯࣄྫ ϏοάσʔλΠϊϕʔγϣϯࣄྫ ϔϧεέΞΠϊϕʔγϣϯࣄྫ ϢʔβʔΠϊϕʔγϣϯࣄྫ ϦόʔεΠϊϕʔγϣϯࣄྫ ӦۀΠϊϕʔγϣϯࣄྫ ݚڀ։ൃΠϊϕʔγϣϯࣄྫ ࢈ֶ࿈ܞΠϊϕʔγϣϯࣄྫ ࢈ֶ࿈ܞΠϊϕʔγϣϯࣄྫ ࣾձ՝୊Πϊϕʔγϣϯࣄྫ ࣾ಺Πϊϕʔγϣϯࣄྫ ૑ൃΠϊϕʔγϣϯࣄྫ େࡕΨεΠϊϕʔγϣϯࣄྫ ஍ҬΠϊϕʔγϣϯࣄྫ ೔ཱΠϊϕʔγϣϯࣄྫ ෋࢜ϑΠϧϜΠϊϕʔγϣϯࣄྫ
  14. ࣮ࡍͷਫ਼౓  ΤίγεςϜΠϊϕʔγϣϯࣄྫ ΤίγεςϜΠϊϕʔγϣϯࣄྫ  େاۀΠϊϕʔγϣϯࣄྫ େاۀΠϊϕʔγϣϯࣄྫ தখاۀΠϊϕʔγϣϯࣄྫ  ΠϊϕʔγϣϯࣄྫJQIPOF

    Πϊϕʔγϣϯࣄྫ૊Έ߹Θͤ Πϊϕʔγϣϯ৽݁߹ࣄྫ ϚʔέςΟϯάΠϊϕʔγϣϯࣄྫ Ձ஋Πϊϕʔγϣϯࣄྫ  Πϊϕʔγϣϯͭͷػձࣄྫ ·ͩ·ͩਫ਼౓͸্͛Δඞཁ͋Δ͕ɺ ໨ࢹͰҰ͔Β΍ΔΑΓ͸அવ࣌ؒ୹ॖ͕࣮ݱ
  15. άϧʔϐϯάΛݩʹαΠτઃܭ اۀࣄྫ ଟ༷ੑ δϨϯϚ Πϊϕʔγϣϯࣄྫͷϖʔδ Ϣʔβʔχʔζͷ͋ΔΩʔϫʔυΛ࢖ͬͯ αΠτઃܭ͍ͯ͘͠ͷͰݕࡧʹڧ͍αΠτઃܭʹͳΔ ɾɾɾ

  16. ຊொΦʔϓϯιʔεϥϘ8FCαΠτͰެ։࣮ݧ ໨త͸ɺ*5ษڧձʹڵຯΛ࣋ͬͯ΋Β͍ΞΫγϣϯΛىͯ͜͠΋Β͏ࣄ IUUQTIPNNBDIJPQFOTPVSDFMBCHJUIVCJPɹ

  17. ೥݄͔Β αΠτઃܭͨ͠هࣄΛ௥Ճ ຊொΦʔϓϯιʔεϥϘ8FCαΠτͰެ։࣮ݧ

  18. ຊொΦʔϓϯιʔεϥϘ8FCαΠτͰެ։࣮ݧ Ωʔϫʔυ ॱҐ ݕࡧϘϦϡʔϜ ϓϩάϥϛϯάษڧձॳ৺ऀ   ϓϩάϥϛϯάษڧձॳ৺ऀ  

    JUษڧձॳ৺ऀ   JUॳ৺ऀηϛφʔ   VEFNZQZUIPO͓͢͢Ί   ίϯύεษڧձ   JUษڧձ   JUษڧձ   DPNQBTTษڧձ   ษڧձαΠτ   ΤϯδχΞษڧձ   ษڧձJU   EPUTษڧձ   ษڧձɹJU   JUษڧձΧϨϯμʔ   ΤϯδχΞษڧձ   JUษڧॳ৺ऀ   ໊ݹ԰QZUIPO   QZUIPOॳ৺ऀษڧձ   Ωʔϫʔυ ॱҐ ݕࡧϘϦϡʔϜ JUษڧձେࡕ   େࡕJUษڧձ   ϓϩάϥϛϯάษڧձ   େࡕJUษڧձ   JUษڧձେࡕ   QZUIPOษڧձ౦ژ   େࡕษڧձJU   ෱ԬJUษڧձ   ϓϩάϥϛϯάษڧձ   SVCZؔ੢   େࡕJUษڧձ   ໊ݹ԰ษڧձ   QZUIPOηϛφʔ   QZUIPOVEFNZ   VEFNZQZUIPO   JUษڧ   ૂͬͨΩʔϫʔυͰͷ্Ґදࣔͱ$7Λ֫ಘ ˞೥݄೔࣌఺ɹ"ISFGTௐ΂
  19. ˞೥݄೔࣌఺ɹ"ISFGTௐ΂ ຊொΦʔϓϯιʔεϥϘ8FCαΠτͰެ։࣮ݧ Ωʔϫʔυ ॱҐ ݕࡧϘϦϡʔϜ ϓϩάϥϛϯάษڧձॳ৺ऀ   ϓϩάϥϛϯάษڧձॳ৺ऀ 

     JUษڧձॳ৺ऀ   JUॳ৺ऀηϛφʔ   VEFNZQZUIPO͓͢͢Ί   ίϯύεษڧձ   JUษڧձ   JUษڧձ   DPNQBTTษڧձ   ษڧձαΠτ   ΤϯδχΞษڧձ   ษڧձJU   EPUTษڧձ   ษڧձɹJU   JUษڧձΧϨϯμʔ   ΤϯδχΞษڧձ   JUษڧॳ৺ऀ   ໊ݹ԰QZUIPO   QZUIPOॳ৺ऀษڧձ   Ωʔϫʔυ ॱҐ ݕࡧϘϦϡʔϜ JUษڧձେࡕ   େࡕJUษڧձ   ϓϩάϥϛϯάษڧձ   େࡕJUษڧձ   JUษڧձେࡕ   QZUIPOษڧձ౦ژ   େࡕษڧձJU   ෱ԬJUษڧձ   ϓϩάϥϛϯάษڧձ   SVCZؔ੢   େࡕJUษڧձ   ໊ݹ԰ษڧձ   QZUIPOηϛφʔ   QZUIPOVEFNZ   VEFNZQZUIPO   JUษڧ   ࠓճͷςʔϚʹ௚઀ؔ܎ͳ͍Ͱ͕͢ɺ ݕࡧΩʔϫʔυͷϘϦϡʔϜͱ $73ͷ૬ؔ͸ແ͍ͨΊɺ ࣮ࡍʹ͸$7ʹ͍ۙΩʔϫʔυͰ ্ҐදࣔͰ͖Δ͜ͱ͕ॏཁ ˞$73ɹίϯόʔδϣϯ཰ʢ੒໿཰ʣ ˞$7ɹίϯόʔδϣϯ
  20. ࣗݾ঺հ ͜Μͳਓʹฉ͍ͯཉ͍͠ Ͳ͜ͰΫϥελϦϯάΛ࢖͔ͬͨ ίʔυ͸ͲΜͳײ͡ ·ͱΊ ໨࣍

  21. ίʔυ͸ͲΜͳײ͡ # -*- coding: utf-8 -*- import pandas as pd

    from sklearn.cluster import KMeans ίʔυൈਮ pred = KMeans( n_clusters=int(query_len/5), init='k-means++' ).fit_predict(cust_array)
  22. # -*- coding: utf-8 -*- import pandas as pd from

    sklearn.cluster import KMeans ίʔυൈਮ pred = KMeans( n_clusters=int(query_len/5), init='k-means++' ).fit_predict(cust_array) ,.FBOTΛར༻ ίʔυ͸ͲΜͳײ͡
  23. LNFBOT๏ͷΠϝʔδ ΫϥελϦϯάͷख๏ͷͭͰΑ͘࢖ΘΕ͍ͯΔ

  24. Ϋϥελͷத৺఺ΛϥϯμϜʹܾΊΔ ݸ਺͸Ϋϥελ਺ LNFBOT๏ͷΠϝʔδ

  25. ֤σʔλΛۙ͘ͷΫϥελத৺఺ʹूΊΔ LNFBOT๏ͷΠϝʔδ

  26. ֤σʔλͷฏۉ஋Ͱ৽͍͠த৺఺Λઃఆ͢Δ LNFBOT๏ͷΠϝʔδ

  27. ֤σʔλΛۙ͘ͷΫϥελத৺఺ʹूΊΔ LNFBOT๏ͷΠϝʔδ

  28. ֤σʔλͷฏۉ஋Ͱ৽͍͠த৺఺Λઃఆ͢Δ LNFBOT๏ͷΠϝʔδ

  29. ֤σʔλΛۙ͘ͷΫϥελத৺఺ʹूΊΔ LNFBOT๏ͷΠϝʔδ

  30. த৺఺͕ಈ͔ͳ͘ͳΔ·Ͱ܁Γฦ͢ LNFBOT๏ͷΠϝʔδ

  31. # -*- coding: utf-8 -*- import pandas as pd from

    sklearn.cluster import KMeans ίʔυൈਮ pred = KMeans( n_clusters=int(query_len/5), init='k-means++' ).fit_predict(cust_array) Ϋϥελ਺ ίʔυ͸ͲΜͳײ͡
  32. # -*- coding: utf-8 -*- import pandas as pd from

    sklearn.cluster import KMeans ίʔυൈਮ pred = KMeans( n_clusters=int(query_len/5), init='k-means++' ).fit_predict(cust_array) αδΣετΩʔϫʔυ਺Λ Ͱׂͬͨ਺ࣈΛઃఆ ˞೚ҙͷ਺ࣈ ίʔυ͸ͲΜͳײ͡
  33. # -*- coding: utf-8 -*- import pandas as pd from

    sklearn.cluster import KMeans ίʔυൈਮ pred = KMeans( n_clusters=int(query_len/5), init='k-means++' ).fit_predict(cust_array) ॳظԽͷઃఆ ίʔυ͸ͲΜͳײ͡
  34. # -*- coding: utf-8 -*- import pandas as pd from

    sklearn.cluster import KMeans ίʔυൈਮ pred = KMeans( n_clusters=int(query_len/5), init='k-means++' ).fit_predict(cust_array) ֤σʔλʹର͢Δ Ϋϥελ൪߸Λฦ͢ ίʔυ͸ͲΜͳײ͡
  35. # -*- coding: utf-8 -*- import pandas as pd from

    sklearn.cluster import KMeans ίʔυൈਮ pred = KMeans( n_clusters=int(query_len/5), init='k-means++' ).fit_predict(cust_array) <<> <>  <> <>> ֤ΩʔϫʔυΛϕΫτϧԽͯ͠pU@QSFEJDUʹ౉͢ Ωʔϫʔυ<      > Ωʔϫʔυ<      > ίʔυ͸ͲΜͳײ͡
  36. # -*- coding: utf-8 -*- import pandas as pd from

    sklearn.cluster import KMeans ίʔυൈਮ pred = KMeans( n_clusters=int(query_len/5), init='k-means++' ).fit_predict(cust_array) <      > ֤ΩʔϫʔυͷΫϥελ൪߸͕ฦͬͯ͘Δ Ωʔϫʔυɿ Ωʔϫʔυɿ̍̒ ίʔυ͸ͲΜͳײ͡
  37. ࣗݾ঺հ ͜Μͳਓʹฉ͍ͯཉ͍͠ Ͳ͜ͰΫϥελϦϯάΛ࢖͔ͬͨ ίʔυ͸ͲΜͳײ͡ ·ͱΊ ໨࣍

  38. ·ͱΊ ɾαΠτઃܭͷαδΣετΩʔϫʔυͷάϧʔϐϯάͷ࡞ ۀ͕ѹ౗తʹָʹͳͬͨ ɾαδΣετΩʔϫʔυ਺͕ଟ͘ͳΔͱɺLNFBOTͷܭ ࢉ͕࣌ؒരൃ͢Δ ɾڭࢣແ͠ͷػցֶशͷͨΊɺ݁Ռ͸໨ࢹͰଥ౰͔Ͳ͏ ͔ͷ൑அ͕ඞཁ ɾࣗવݴޠॲཧΛҰॹʹษڧ͍ͨ͠ਓ͍Ε͹੠͔͚ͯ͘ ͍ͩ͞ ɾࣗવݕࡧʹڧ͍αΠτΛ࡞Γ͍ͨਓ΋੠͔͚ͯͩ͘͞

    ͍