ãã¯ã©ã¹ã¿ãªã³ã°ãã¯ã©ã¹ã¿ã¼åæã¨è¨ãã°ãk-meansãæåã§ããããããäºãã¯ã©ã¹ï¼åé¡ï¼æ°ãæå®ããå¿
è¦ãããã¾ãããã®å¯¾çã¨ãã¦ãåé¡æ°ãèªåã§æ±ºå®ããã¢ã«ã´ãªãºã ã¯ããã¤ãåå¨ãã¦ãã¦ããx-meansã,ãg-meansã,ãStar Clusteringããªã©ãããã¾ãã
ãæ¬è¨äºã§ã¯ããx-meansãã¨ãg-meansãã®éå½¢ã³ã¼ãã¨å®è¡çµæã®æ¯è¼ä¾ãè¼ãã¾ããããã®2ã¤ã¯ãpyclusteringãã¤ã³ã¹ãã¼ã«ãããã¨ã§ä½¿ç¨ã§ãã¾ãã
â ã¤ã³ã¹ãã¼ã«æ¹æ³
pipã®å ´å
Anacondaç°å¢ä¸ã®å ´å
â åæã«ä½¿ç¨ããä¾é¡ãã¼ã¿
ãscikit-learnã«å梱ããã¦ããã¯ã¤ã³ãã¼ã¿ã»ãããç¨ãã¾ãããæ¬æ¥ã¯ãæ©æ¢°å¦ç¿ã®åé¡ç¨ã«ç¨æããããã¼ã¿ã»ããã§ã説æå¤æ°ï¼ç¹å¾´éï¼ã13é ç®ãã£ã¦ãäºã3ã¤ã«åé¡ããããtargetããããã¾ãã詳細ã¯æ¬¡ã®ãªã³ã¯å ãåç §sklearn.datasets.load_wine â scikit-learn 0.24.2 documentation
ãæ¬è¨äºã§ã¯ãåé¡ã§ã¯ãªãã¦ã¯ã©ã¹ã¿ã¼åæã®ãããæ師ãã¼ã¿ã¯ä½¿ããã«åé¡ãããããä¸è¨ãtargetããç¨ããåæã¯ãã¾ãããï¼åæå¾ã®æ¯è¼ã ãã«ä½¿ãã¾ãï¼
Â
â ã¯ã©ã¹ã¿ãªã³ã°ã®å®æ½ä¾
å
ã«ãå®æ½ä¾ã«ã¤ãã¦èª¬æãã¾ããåææã«ä½¿ç¨ãã説æå¤æ°ã®æ°ã2, 3, 13é
ç®ã®3ã¤å ´åã«ã¤ãã¦é çªã«èª¬æãã¾ãã
ãä¸å³ã¯ã1ã¤ç®ã®ä¾ã§ããã¯ã©ã¹ã¿ã¼åæã«ç¹å¾´é2é
ç®ã ããç¨ããå ´åã§ãã
ä¸å³å·¦ã¯å
ãã¼ã¿ã§3ã¤ã®ã«ãã´ãªã«åããã¦ãã¾ãï¼3ã¤ã®ã¯ã©ã¹åé¡ï¼ãä¸æ¹ãä¸å³ä¸å¤®ã®x-meansã§ã®åæçµæã¯4ã¤ã«ã¯ã©ã¹åé¡ãããä¸å³å³ã®g-meansã®å ´åã§ã¯2ã¤ã«ã¯ã©ã¹åé¡ããã¾ãããåé¡æ°ãç°ãªãçµæã«ãªãã¾ããããããããããéåä½ã®åå¸ã¯éåæã¯ãªã妥å½ã«ä»åããããããã«ã¿ãã¾ããæ¬æ¥ã¯æ£è§£ãã¼ã¿ã¯ããããªããããæè¡è
æ¬äººãç¨éã«å¿ãã¦å¤æãããã¨ã«ãªãã¾ãã
ãä¸å³ã¯ã2ã¤ç®ã®ä¾ã§ããã¯ã©ã¹ã¿ã¼åæã«ç¹å¾´éã3é
ç®ããç¨ããå ´åã§ãã
x-meansã¯3ã¤ã«ã¯ã©ã¹åé¡ãããg-meansã¯4ã¤ã«ã¯ã©ã¹åé¡ãããçµæã§ãã
ãä¸å³ã¯ã3ã¤ç®ã®ä¾ã§ããã¯ã©ã¹ã¿ã¼åæã«ç¹å¾´éå
¨ã¦13é
ç®ãç¨ããå ´åã§ãã
x-meansã¯3ã¤ã«ã¯ã©ã¹åé¡ãããg-meansã¯7ã¤ã«ã¯ã©ã¹åé¡ãããçµæã§ãã
ãä¸è¨3ã¤ã®ä¾ã¯ãã¯ã©ã¹ã¿ãªã³ã°ã«ä½¿ç¨ãã説æå¤æ°ã®æ°ãå¤æ´ãã¦æ¤è¨¼ãã¾ãããå®ã¯ãæ¬ã³ã¼ãã§ã¯åå¦çã¨ãã¦ãã¼ã¿ãæ¨æºåãã¦ãã¾ãããã®åå¦çã®æç¡ã§ãçµæã¯å¤ããã¾ããä»ã«ã¯ãã¯ã©ã¹ã¿ã¼åæããã説æå¤æ°éã«æ¡ãèãããã¨ãªããã¼ã¿ç¾¤ãä¾ãã°ã対æ°ãã¼ã¿ç¾¤ãä½æ¡ãå°ããå°æ°ãã¼ã¿ç¾¤ãªã©ãããå ´åã¯æ¨æºåããæ¹ãåã§ããã¾ããå®åã«ããã¦ã¯å¤ãå¤ãåå¨ããå ´åãé ã«å ¥ãã¦ãããå ´åã«ãã£ã¦ã¯ããããåé¤ããå¤æãå¿ è¦ãªãã¨ããããã¾ãã
Â
â æ¬ããã°ã©ã
æ¬ã³ã¼ãã¯x-meansã®å ´åã®ä¾ã§ããg-meansã使ç¨ãããå ´åã¯ãxmeansã®ç®æãgmeansã«ç½®æããã ãã§OKã§ãã
以ä¸
<åºå>