{"id":1244,"date":"2023-07-27T03:54:17","date_gmt":"2023-07-27T03:54:17","guid":{"rendered":"https:\/\/statorials.org\/ja\/r-%e3%81%ae-k-medoid\/"},"modified":"2023-07-27T03:54:17","modified_gmt":"2023-07-27T03:54:17","slug":"r-%e3%81%ae-k-medoid","status":"publish","type":"post","link":"https:\/\/statorials.org\/ja\/r-%e3%81%ae-k-medoid\/","title":{"rendered":"R \u306e k-medoids: \u30b9\u30c6\u30c3\u30d7\u30d0\u30a4\u30b9\u30c6\u30c3\u30d7\u306e\u4f8b"},"content":{"rendered":"<p><\/p>\n<hr>\n<p><span style=\"color: #000000;\">\u30af\u30e9\u30b9\u30bf\u30ea\u30f3\u30b0\u306f\u3001\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u5185\u3067<a href=\"https:\/\/statorials.org\/ja\/\u7d71\u8a08\u306b\u304a\u3051\u308b\u89b3\u5bdf\/\" target=\"_blank\" rel=\"noopener noreferrer\">\u89b3\u5bdf<\/a>\u306e\u30b0\u30eb\u30fc\u30d7\u307e\u305f\u306f<em>\u30af\u30e9\u30b9\u30bf\u30fc\u3092<\/em>\u898b\u3064\u3051\u3088\u3046\u3068\u3059\u308b\u6a5f\u68b0\u5b66\u7fd2\u624b\u6cd5\u3067\u3059\u3002<\/span><\/p>\n<p><span style=\"color: #000000;\">\u76ee\u6a19\u306f\u3001\u5404\u30af\u30e9\u30b9\u30bf\u30fc\u5185\u306e\u89b3\u6e2c\u5024\u304c\u4e92\u3044\u306b\u975e\u5e38\u306b\u985e\u4f3c\u3057\u3066\u3044\u308b\u4e00\u65b9\u3067\u3001\u7570\u306a\u308b\u30af\u30e9\u30b9\u30bf\u30fc\u5185\u306e\u89b3\u6e2c\u5024\u304c\u4e92\u3044\u306b\u5927\u304d\u304f\u7570\u306a\u308b\u3088\u3046\u306a\u30af\u30e9\u30b9\u30bf\u30fc\u3092\u898b\u3064\u3051\u308b\u3053\u3068\u3067\u3059\u3002<\/span><\/p>\n<p><span style=\"color: #000000;\">\u30af\u30e9\u30b9\u30bf\u30ea\u30f3\u30b0\u306f\u3001 <a href=\"https:\/\/statorials.org\/ja\/\u5909\u6570\u306e\u8aac\u660e\u5fdc\u7b54\/\" target=\"_blank\" rel=\"noopener noreferrer\">\u5fdc\u7b54\u5909\u6570<\/a>\u306e\u5024\u3092\u4e88\u6e2c\u3059\u308b\u306e\u3067\u306f\u306a\u304f\u3001\u5358\u306b\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u5185\u306e\u69cb\u9020\u3092\u898b\u3064\u3051\u3088\u3046\u3068\u3057\u3066\u3044\u308b\u3060\u3051\u3067\u3042\u308b\u305f\u3081\u3001 <a href=\"https:\/\/statorials.org\/ja\/\u6559\u5e2b\u3042\u308a\u5b66\u7fd2\u3068\u6559\u5e2b\u306a\u3057\u5b66\u7fd2\/\" target=\"_blank\" rel=\"noopener noreferrer\">\u6559\u5e2b\u306a\u3057\u5b66\u7fd2<\/a>\u306e\u4e00\u7a2e\u3067\u3059\u3002<\/span><\/p>\n<p><span style=\"color: #000000;\">\u30af\u30e9\u30b9\u30bf\u30ea\u30f3\u30b0\u306f\u3001\u4f01\u696d\u304c\u6b21\u306e\u3088\u3046\u306a\u60c5\u5831\u306b\u30a2\u30af\u30bb\u30b9\u3067\u304d\u308b\u5834\u5408\u306b\u30de\u30fc\u30b1\u30c6\u30a3\u30f3\u30b0\u3067\u3088\u304f\u4f7f\u7528\u3055\u308c\u307e\u3059\u3002<\/span><\/p>\n<ul>\n<li><span style=\"color: #000000;\">\u4e16\u5e2f\u53ce\u5165<\/span><\/li>\n<li><span style=\"color: #000000;\">\u4e16\u5e2f\u898f\u6a21<\/span><\/li>\n<li><span style=\"color: #000000;\">\u4e16\u5e2f\u4e3b\u306e\u8077\u696d<\/span><\/li>\n<li><span style=\"color: #000000;\">\u6700\u5bc4\u308a\u306e\u5e02\u8857\u5730\u307e\u3067\u306e\u8ddd\u96e2<\/span><\/li>\n<\/ul>\n<p><span style=\"color: #000000;\">\u3053\u306e\u60c5\u5831\u304c\u5229\u7528\u53ef\u80fd\u306a\u5834\u5408\u3001\u30af\u30e9\u30b9\u30bf\u30ea\u30f3\u30b0\u3092\u4f7f\u7528\u3057\u3066\u3001\u7279\u5b9a\u306e\u88fd\u54c1\u3092\u8cfc\u5165\u3059\u308b\u53ef\u80fd\u6027\u304c\u9ad8\u3044\u3001\u307e\u305f\u306f\u7279\u5b9a\u306e\u7a2e\u985e\u306e\u5e83\u544a\u306b\u3088\u308a\u3088\u304f\u53cd\u5fdc\u3059\u308b\u53ef\u80fd\u6027\u304c\u9ad8\u3044\u3001\u985e\u4f3c\u3057\u305f\u4e16\u5e2f\u3092\u8b58\u5225\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/span><\/p>\n<p><span style=\"color: #000000;\">\u30af\u30e9\u30b9\u30bf\u30ea\u30f3\u30b0\u306e\u6700\u3082\u4e00\u822c\u7684\u306a\u5f62\u5f0f\u306e 1 \u3064\u306f\u3001 <a href=\"https:\/\/statorials.org\/ja\/k-\u306f-r-\u3066\u3099\u30af\u3099\u30eb\u30fc\u30d5\u309a\u5316\u3059\u308b\u3053\u3068\u3092\u610f\u5473\u3057\u307e\u3059\/\" target=\"_blank\" rel=\"noopener noreferrer\">k-means \u30af\u30e9\u30b9\u30bf\u30ea\u30f3\u30b0<\/a>\u3068\u3057\u3066\u77e5\u3089\u308c\u3066\u3044\u307e\u3059\u3002<\/span><\/p>\n<p><span style=\"color: #000000;\">\u6b8b\u5ff5\u306a\u304c\u3089\u3001\u3053\u306e\u65b9\u6cd5\u306f\u5916\u308c\u5024\u306e\u5f71\u97ff\u3092\u53d7\u3051\u308b\u53ef\u80fd\u6027\u304c\u3042\u308b\u305f\u3081\u3001\u4ee3\u66ff\u3068\u3057\u3066<strong>k-medoids \u30af\u30e9\u30b9\u30bf\u30ea\u30f3\u30b0<\/strong>\u304c\u3088\u304f\u4f7f\u7528\u3055\u308c\u307e\u3059\u3002<\/span><\/p>\n<h3> <span style=\"color: #000000;\"><strong>K-Medoids \u30af\u30e9\u30b9\u30bf\u30ea\u30f3\u30b0\u3068\u306f\u4f55\u3067\u3059\u304b?<\/strong><\/span><\/h3>\n<p> <span style=\"color: #000000;\">K-medoids \u30af\u30e9\u30b9\u30bf\u30ea\u30f3\u30b0\u306f\u3001\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u5185\u306e\u5404\u89b3\u6e2c\u5024\u3092<em>K<\/em>\u500b\u306e\u30af\u30e9\u30b9\u30bf\u30fc\u306e 1 \u3064\u306b\u914d\u7f6e\u3059\u308b\u624b\u6cd5\u3067\u3059\u3002<\/span><\/p>\n<p><span style=\"color: #000000;\">\u6700\u7d42\u7684\u306a\u76ee\u6a19\u306f\u3001\u5404\u30af\u30e9\u30b9\u30bf\u30fc\u5185\u306e\u89b3\u6e2c\u5024\u304c\u4e92\u3044\u306b\u3088\u304f\u4f3c\u3066\u3044\u308b\u4e00\u65b9\u3067\u3001\u7570\u306a\u308b\u30af\u30e9\u30b9\u30bf\u30fc\u5185\u306e\u89b3\u6e2c\u5024\u304c\u4e92\u3044\u306b\u307e\u3063\u305f\u304f\u7570\u306a\u308b<em>K<\/em>\u500b\u306e\u30af\u30e9\u30b9\u30bf\u30fc\u3092\u4f5c\u6210\u3059\u308b\u3053\u3068\u3067\u3059\u3002<\/span><\/p>\n<p><span style=\"color: #000000;\">\u5b9f\u969b\u306b\u306f\u3001\u6b21\u306e\u624b\u9806\u3092\u4f7f\u7528\u3057\u3066 K-means \u30af\u30e9\u30b9\u30bf\u30ea\u30f3\u30b0\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002<\/span><\/p>\n<p> <span style=\"color: #000000;\"><strong>1. <em>K<\/em>\u306e\u5024\u3092\u9078\u629e\u3057\u307e\u3059\u3002<\/strong><\/span><\/p>\n<ul>\n<li><span style=\"color: #000000;\">\u307e\u305a\u3001\u30c7\u30fc\u30bf\u5185\u3067\u8b58\u5225\u3059\u308b\u30af\u30e9\u30b9\u30bf\u30fc\u306e\u6570\u3092\u6c7a\u5b9a\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u591a\u304f\u306e\u5834\u5408\u3001 <em>K<\/em>\u306e\u3044\u304f\u3064\u304b\u306e\u7570\u306a\u308b\u5024\u3092\u30c6\u30b9\u30c8\u3057\u3001\u305d\u306e\u7d50\u679c\u3092\u5206\u6790\u3057\u3066\u3001\u7279\u5b9a\u306e\u554f\u984c\u306b\u5bfe\u3057\u3066\u3069\u306e\u30af\u30e9\u30b9\u30bf\u30fc\u306e\u6570\u304c\u6700\u3082\u5408\u7406\u7684\u3067\u3042\u308b\u304b\u3092\u78ba\u8a8d\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/span><\/li>\n<\/ul>\n<p> <span style=\"color: #000000;\"><strong>2. \u5404\u89b3\u6e2c\u5024\u3092 1 \u304b\u3089<em>K<\/em>\u307e\u3067\u306e\u521d\u671f\u30af\u30e9\u30b9\u30bf\u30fc\u306b\u30e9\u30f3\u30c0\u30e0\u306b\u5272\u308a\u5f53\u3066\u307e\u3059\u3002<\/strong><\/span><\/p>\n<p> <span style=\"color: #000000;\"><strong>3. \u30af\u30e9\u30b9\u30bf\u30fc\u306e\u5272\u308a\u5f53\u3066\u304c\u5909\u66f4\u3055\u308c\u306a\u304f\u306a\u308b\u307e\u3067\u3001\u6b21\u306e\u624b\u9806\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002<\/strong><\/span><\/p>\n<ul>\n<li> <span style=\"color: #000000;\"><em>K<\/em>\u500b\u306e\u30af\u30e9\u30b9\u30bf\u30fc\u306e\u305d\u308c\u305e\u308c\u306b\u3064\u3044\u3066\u3001<em>\u30af\u30e9\u30b9\u30bf\u30fc\u306e\u91cd\u5fc3\u3092\u8a08\u7b97\u3057\u307e\u3059\u3002<\/em>\u3053\u308c\u306f\u3001 <em>k<\/em>\u756a\u76ee\u306e\u30af\u30e9\u30b9\u30bf\u30fc\u306e\u89b3\u6e2c\u5024\u306e\u7279\u5fb4\u306e<em>p<\/em><b>\u4e2d\u592e\u5024<\/b>\u306e\u30d9\u30af\u30c8\u30eb\u3067\u3059\u3002<\/span><\/li>\n<li><span style=\"color: #000000;\">\u5404\u89b3\u6e2c\u5024\u3092\u6700\u3082\u8fd1\u3044\u91cd\u5fc3\u3092\u6301\u3064\u30af\u30e9\u30b9\u30bf\u30fc\u306b\u5272\u308a\u5f53\u3066\u307e\u3059\u3002\u3053\u3053\u3067\u3001<em>\u6700\u3082\u8fd1\u3044<\/em>\u306f<a href=\"https:\/\/en.wikipedia.org\/wiki\/Euclidean_distance#Squared_Euclidean_distance\" target=\"_blank\" rel=\"noopener noreferrer\">\u30e6\u30fc\u30af\u30ea\u30c3\u30c9\u8ddd\u96e2<\/a>\u3092\u4f7f\u7528\u3057\u3066\u5b9a\u7fa9\u3055\u308c\u307e\u3059\u3002<\/span><\/li>\n<\/ul>\n<blockquote>\n<p><span style=\"color: #000000;\"><strong>\u6280\u8853\u7684\u306a\u30e1\u30e2:<\/strong><\/span><\/p>\n<p> <span style=\"color: #000000;\">k-medoids \u306f\u5e73\u5747\u5024\u3067\u306f\u306a\u304f\u4e2d\u592e\u5024\u3092\u4f7f\u7528\u3057\u3066\u30af\u30e9\u30b9\u30bf\u30fc\u306e\u91cd\u5fc3\u3092\u8a08\u7b97\u3059\u308b\u305f\u3081\u3001k-means \u3088\u308a\u3082\u5916\u308c\u5024\u306b\u5bfe\u3057\u3066\u5805\u7262\u306b\u306a\u308b\u50be\u5411\u304c\u3042\u308a\u307e\u3059\u3002<\/span><\/p>\n<p><span style=\"color: #000000;\">\u5b9f\u969b\u306b\u306f\u3001\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u306b\u6975\u7aef\u306a\u5916\u308c\u5024\u304c\u306a\u3044\u5834\u5408\u3001k-means \u3068 k-medoid \u306f\u540c\u69d8\u306e\u7d50\u679c\u3092\u751f\u6210\u3057\u307e\u3059\u3002<\/span><\/p>\n<\/blockquote>\n<h3> <span style=\"color: #000000;\"><strong>R \u3067\u306e K-Medoid \u30af\u30e9\u30b9\u30bf\u30ea\u30f3\u30b0<\/strong><\/span><\/h3>\n<p><span style=\"color: #000000;\">\u6b21\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3067\u306f\u3001R \u3067 k-medoids \u30af\u30e9\u30b9\u30bf\u30ea\u30f3\u30b0\u3092\u5b9f\u884c\u3059\u308b\u65b9\u6cd5\u306e\u6bb5\u968e\u7684\u306a\u4f8b\u3092\u793a\u3057\u307e\u3059\u3002<\/span><\/p>\n<h3><span style=\"color: #000000;\"><strong>\u30b9\u30c6\u30c3\u30d7 1: \u5fc5\u8981\u306a\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30ed\u30fc\u30c9\u3059\u308b<\/strong><\/span><\/h3>\n<p><span style=\"color: #000000;\">\u307e\u305a\u3001R \u3067\u306e k-medoids \u30af\u30e9\u30b9\u30bf\u30ea\u30f3\u30b0\u306b\u5f79\u7acb\u3064\u3044\u304f\u3064\u304b\u306e\u95a2\u6570\u3092\u542b\u3080 2 \u3064\u306e\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30ed\u30fc\u30c9\u3057\u307e\u3059\u3002<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong><span style=\"color: #993300;\">library<\/span> (factoextra)\n<span style=\"color: #993300;\">library<\/span> (cluster)<\/strong><\/pre>\n<h3><span style=\"color: #000000;\"><strong>\u30b9\u30c6\u30c3\u30d7 2: \u30c7\u30fc\u30bf\u306e\u30ed\u30fc\u30c9\u3068\u6e96\u5099<\/strong><\/span><\/h3>\n<p><span style=\"color: #000000;\">\u3053\u306e\u4f8b\u3067\u306f\u3001R \u306b\u7d44\u307f\u8fbc\u307e\u308c\u3066\u3044\u308b<em>USArrests<\/em>\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002\u3053\u306e\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u306b\u306f\u30011973 \u5e74\u306e\u7c73\u56fd\u5404\u5dde\u306e\u4eba\u53e3 100,000 \u4eba\u3042\u305f\u308a\u306e<em>\u6bba\u4eba<\/em>\u3001<em>\u66b4\u884c<\/em>\u3001<em>\u5f37\u59e6<\/em>\u306e\u902e\u6355\u6570\u3068\u3001\u90fd\u5e02\u90e8\u306b\u4f4f\u3080\u5404\u5dde\u306e\u4eba\u53e3\u306e\u5272\u5408\u304c\u542b\u307e\u308c\u3066\u3044\u307e\u3059\u3002\u5730\u57df\u3002 \u3001<em>\u30a2\u30fc\u30d0\u30f3\u30dd\u30c3\u30d7<\/em>\u3002<\/span><\/p>\n<p><span style=\"color: #000000;\">\u6b21\u306e\u30b3\u30fc\u30c9\u306f\u3001\u6b21\u306e\u3053\u3068\u3092\u884c\u3046\u65b9\u6cd5\u3092\u793a\u3057\u3066\u3044\u307e\u3059\u3002<\/span><\/p>\n<ul>\n<li> <span style=\"color: #000000;\"><em>USArrests<\/em>\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u3092\u30ed\u30fc\u30c9\u3059\u308b<\/span><\/li>\n<li><span style=\"color: #000000;\">\u6b20\u640d\u5024\u306e\u3042\u308b\u884c\u3092\u3059\u3079\u3066\u524a\u9664\u3057\u307e\u3059<\/span><\/li>\n<li><span style=\"color: #000000;\">\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u5185\u306e\u5404\u5909\u6570\u3092\u3001\u5e73\u5747\u304c 0\u3001\u6a19\u6e96\u504f\u5dee\u304c 1 \u306b\u306a\u308b\u3088\u3046\u306b\u30b9\u30b1\u30fc\u30ea\u30f3\u30b0\u3057\u307e\u3059\u3002<\/span><\/li>\n<\/ul>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong><span style=\"color: #008080;\">#load data<\/span>\ndf &lt;-USArrests\n\n<span style=\"color: #008080;\">#remove rows with missing values<\/span><\/strong>\n<strong>df &lt;- na. <span style=\"color: #3366ff;\">omitted<\/span> (df)\n\n<span style=\"color: #008080;\">#scale each variable to have a mean of 0 and sd of 1<\/span><\/strong>\n<strong>df &lt;- scale(df)\n\n<span style=\"color: #008080;\">#view first six rows of dataset<\/span>\nhead(df)\n\n               Murder Assault UrbanPop Rape\nAlabama 1.24256408 0.7828393 -0.5209066 -0.003416473\nAlaska 0.50786248 1.1068225 -1.2117642 2.484202941\nArizona 0.07163341 1.4788032 0.9989801 1.042878388\nArkansas 0.23234938 0.2308680 -1.0735927 -0.184916602\nCalifornia 0.27826823 1.2628144 1.7589234 2.067820292\nColorado 0.02571456 0.3988593 0.8608085 1.864967207\n<\/strong><\/pre>\n<h3><span style=\"color: #000000;\"><strong>\u30b9\u30c6\u30c3\u30d7 3: \u6700\u9069\u306a\u30af\u30e9\u30b9\u30bf\u30fc\u6570\u3092\u898b\u3064\u3051\u308b<\/strong><\/span><\/h3>\n<p><span style=\"color: #000000;\">R \u3067 k-medoid \u30af\u30e9\u30b9\u30bf\u30ea\u30f3\u30b0\u3092\u5b9f\u884c\u3059\u308b\u306b\u306f\u3001 <strong>pam()<\/strong>\u95a2\u6570\u3092\u4f7f\u7528\u3067\u304d\u307e\u3059\u3002\u3053\u308c\u306f\u300c\u4e2d\u592e\u5024\u306e\u5468\u308a\u306e\u5206\u5272\u300d\u3092\u8868\u3057\u3001\u6b21\u306e\u69cb\u6587\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002<\/span><\/p>\n<p> <span style=\"color: #000000;\"><strong>pam(\u30c7\u30fc\u30bf, k, \u30e1\u30c8\u30ea\u30c3\u30af = \u201c\u30e6\u30fc\u30af\u30ea\u30c3\u30c9\u201d, \u30b9\u30bf\u30f3\u30c9 = FALSE)<\/strong><\/span><\/p>\n<p><span style=\"color: #000000;\">\u91d1\uff1a<\/span><\/p>\n<ul>\n<li> <span style=\"color: #000000;\"><strong>data:<\/strong>\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u306e\u540d\u524d\u3002<\/span><\/li>\n<li> <span style=\"color: #000000;\"><strong>k:<\/strong>\u30af\u30e9\u30b9\u30bf\u30fc\u306e\u6570\u3002<\/span><\/li>\n<li> <span style=\"color: #000000;\"><strong>metric:<\/strong>\u8ddd\u96e2\u306e\u8a08\u7b97\u306b\u4f7f\u7528\u3059\u308b\u30e1\u30c8\u30ea\u30c3\u30af\u3002\u30c7\u30d5\u30a9\u30eb\u30c8\u306f<em>\u30e6\u30fc\u30af\u30ea\u30c3\u30c9<\/em>\u3067\u3059\u304c\u3001 <em>manhattan<\/em>\u3092\u6307\u5b9a\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002<\/span><\/li>\n<li><span style=\"color: #000000;\"><strong>\u30b9\u30bf\u30f3\u30c9:<\/strong>\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u5185\u306e\u5404\u5909\u6570\u3092\u6b63\u898f\u5316\u3059\u308b\u304b\u3069\u3046\u304b\u3002\u30c7\u30d5\u30a9\u30eb\u30c8\u5024\u306f false \u3067\u3059\u3002<\/span><\/li>\n<\/ul>\n<p><span style=\"color: #000000;\">\u6700\u9069\u306a\u30af\u30e9\u30b9\u30bf\u30fc\u306e\u6570\u304c\u4e8b\u524d\u306b\u308f\u304b\u3089\u306a\u3044\u305f\u3081\u3001\u6c7a\u5b9a\u306b\u5f79\u7acb\u3064 2 \u3064\u306e\u7570\u306a\u308b\u30b0\u30e9\u30d5\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/span><\/p>\n<p> <span style=\"color: #000000;\"><strong>1. \u5e73\u65b9\u548c\u306e\u5408\u8a08\u306b\u5bfe\u3059\u308b\u30af\u30e9\u30b9\u30bf\u30fc\u306e\u6570<\/strong><\/span><\/p>\n<p><span style=\"color: #000000;\">\u307e\u305a\u3001 <strong>fviz_nbclust()<\/strong>\u95a2\u6570\u3092\u4f7f\u7528\u3057\u3066\u3001\u30af\u30e9\u30b9\u30bf\u30fc\u6570\u3068\u5e73\u65b9\u548c\u306e\u5408\u8a08\u306e\u30d7\u30ed\u30c3\u30c8\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/span> <\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong>fviz_nbclust(df, pam, method = \u201c <span style=\"color: #008000;\">wss<\/span> \u201d)<\/strong> <\/pre>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-12327 \" src=\"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/kmedoide1.png\" alt=\"k-medoid \u306b\u6700\u9069\u306a\u30af\u30e9\u30b9\u30bf\u30fc\" width=\"462\" height=\"449\" srcset=\"\" sizes=\"auto, \"><\/p>\n<p><span style=\"color: #000000;\">\u901a\u5e38\u3001\u30af\u30e9\u30b9\u30bf\u30fc\u306e\u6570\u304c\u5897\u52a0\u3059\u308b\u3068\u3001\u5e73\u65b9\u548c\u306e\u5408\u8a08\u306f\u5e38\u306b\u5897\u52a0\u3057\u307e\u3059\u3002\u3057\u305f\u304c\u3063\u3066\u3001\u3053\u306e\u30bf\u30a4\u30d7\u306e\u30d7\u30ed\u30c3\u30c8\u3092\u4f5c\u6210\u3059\u308b\u3068\u304d\u306f\u3001\u5e73\u65b9\u548c\u304c\u300c\u66f2\u304c\u308b\u300d\u304b\u6a2a\u3070\u3044\u306b\u306a\u308a\u59cb\u3081\u308b\u300c\u819d\u300d\u3092\u63a2\u3057\u307e\u3059\u3002<\/span><\/p>\n<p><span style=\"color: #000000;\">\u30d7\u30ed\u30c3\u30c8\u306e\u66f2\u7387\u70b9\u306f\u901a\u5e38\u3001\u6700\u9069\u306a\u30af\u30e9\u30b9\u30bf\u30fc\u6570\u306b\u5bfe\u5fdc\u3057\u307e\u3059\u3002\u3053\u306e\u6570\u5024\u3092\u8d85\u3048\u308b\u3068\u3001 <a href=\"https:\/\/statorials.org\/ja\/\u6a5f\u68b0\u5b66\u7fd2\u306e\u904e\u5b66\u7fd2\/\" target=\"_blank\" rel=\"noopener noreferrer\">\u904e\u5b66\u7fd2\u304c<\/a>\u767a\u751f\u3059\u308b\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002<\/span><\/p>\n<p><span style=\"color: #000000;\">\u3053\u306e\u30b0\u30e9\u30d5\u3067\u306f\u3001k = 4 \u30af\u30e9\u30b9\u30bf\u30fc\u306b\u5c0f\u3055\u306a\u306d\u3058\u308c\u307e\u305f\u306f\u300c\u66f2\u304c\u308a\u300d\u304c\u3042\u308b\u3088\u3046\u306b\u898b\u3048\u307e\u3059\u3002<\/span><\/p>\n<p> <span style=\"color: #000000;\"><strong>2. \u30af\u30e9\u30b9\u30bf\u30fc\u6570\u3068\u30ae\u30e3\u30c3\u30d7\u7d71\u8a08<\/strong><\/span><\/p>\n<p><span style=\"color: #000000;\">\u6700\u9069\u306a\u30af\u30e9\u30b9\u30bf\u30fc\u6570\u3092\u6c7a\u5b9a\u3059\u308b\u3082\u3046 1 \u3064\u306e\u65b9\u6cd5\u306f\u3001 <a style=\"color: #000000;\" href=\"https:\/\/web.stanford.edu\/~hastie\/Papers\/gap.pdf\" target=\"_blank\" rel=\"noopener noreferrer\">\u504f\u5dee\u7d71\u8a08<\/a>\u3068\u547c\u3070\u308c\u308b\u30e1\u30c8\u30ea\u30c3\u30af\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u3067\u3059\u3002\u3053\u308c\u306f\u3001k \u306e\u3055\u307e\u3056\u307e\u306a\u5024\u306e\u30af\u30e9\u30b9\u30bf\u30fc\u5185\u5909\u52d5\u306e\u5408\u8a08\u3092\u3001\u30af\u30e9\u30b9\u30bf\u30fc\u5316\u3092\u884c\u308f\u306a\u3044\u5206\u5e03\u306e\u671f\u5f85\u5024\u3068\u6bd4\u8f03\u3057\u307e\u3059\u3002<\/span><\/p>\n<p><span style=\"color: #000000;\"><em>\u30af\u30e9\u30b9\u30bf\u30fc<\/em>\u30d1\u30c3\u30b1\u30fc\u30b8\u306e<strong>clusGap()<\/strong>\u95a2\u6570\u3092\u4f7f\u7528\u3057\u3066\u30af\u30e9\u30b9\u30bf\u30fc\u306e\u6570\u3054\u3068\u306e\u30ae\u30e3\u30c3\u30d7\u7d71\u8a08\u3092\u8a08\u7b97\u3057\u305f\u308a\u3001 <strong>fviz_gap_stat()<\/strong>\u95a2\u6570\u3092\u4f7f\u7528\u3057\u3066\u30af\u30e9\u30b9\u30bf\u30fc\u3068\u30ae\u30e3\u30c3\u30d7\u7d71\u8a08\u306e\u30d7\u30ed\u30c3\u30c8\u3092\u8a08\u7b97\u3057\u305f\u308a\u3067\u304d\u307e\u3059\u3002<\/span> <\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong><span style=\"color: #008080;\">#calculate gap statistic based on number of clusters\n<\/span>gap_stat &lt;- clusGap(df,\n                    FUN = pam,\n                    K.max = 10, <span style=\"color: #008080;\">#max clusters to consider<\/span>\n                    B = 50) <span style=\"color: #008080;\">#total bootstrapped iterations<\/span>\n\n<span style=\"color: #008080;\">#plot number of clusters vs. gap statistic\n<\/span>fviz_gap_stat(gap_stat)<\/strong> <\/pre>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-12328 \" src=\"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/kmedoide2.png\" alt=\"K-medoids R \u306e\u6700\u9069\u306a\u30af\u30e9\u30b9\u30bf\u30fc\u6570\" width=\"443\" height=\"441\" srcset=\"\" sizes=\"auto, \"><\/p>\n<p><span style=\"color: #000000;\">\u30b0\u30e9\u30d5\u304b\u3089\u3001\u30ae\u30e3\u30c3\u30d7\u7d71\u8a08\u304c k = 4 \u30af\u30e9\u30b9\u30bf\u30fc\u3067\u6700\u3082\u9ad8\u304f\u306a\u308b\u3053\u3068\u304c\u308f\u304b\u308a\u307e\u3059\u3002\u3053\u308c\u306f\u3001\u4ee5\u524d\u306b\u4f7f\u7528\u3057\u305f\u30a8\u30eb\u30dc\u30fc\u6cd5\u306b\u5bfe\u5fdc\u3057\u307e\u3059\u3002<\/span><\/p>\n<h3><span style=\"color: #000000;\"><strong>\u30b9\u30c6\u30c3\u30d7 4: Optimal <em>K<\/em>\u3092\u4f7f\u7528\u3057\u3066 K-Medoids \u30af\u30e9\u30b9\u30bf\u30ea\u30f3\u30b0\u3092\u5b9f\u884c\u3059\u308b<\/strong><\/span><\/h3>\n<p><span style=\"color: #000000;\">\u6700\u5f8c\u306b\u3001 <em>k<\/em>\u306e\u6700\u9069\u5024 4 \u3092\u4f7f\u7528\u3057\u3066\u3001\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u306b\u5bfe\u3057\u3066 k-medoids \u30af\u30e9\u30b9\u30bf\u30ea\u30f3\u30b0\u3092\u5b9f\u884c\u3067\u304d\u307e\u3059\u3002<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong><span style=\"color: #008080;\">#make this example reproducible\n<span style=\"color: #000000;\">set.seed(1)<\/span>\n\n#perform k-medoids clustering with k = 4 clusters\n<\/span>kmed &lt;- pam(df, k = 4)\n\n<span style=\"color: #008080;\">#view results\n<\/span>kmed\n\n              ID Murder Assault UrbanPop Rape\nAlabama 1 1.2425641 0.7828393 -0.5209066 -0.003416473\nMichigan 22 0.9900104 1.0108275 0.5844655 1.480613993\nOklahoma 36 -0.2727580 -0.2371077 0.1699510 -0.131534211\nNew Hampshire 29 -1.3059321 -1.3650491 -0.6590781 -1.252564419\nVector clustering:\n       Alabama Alaska Arizona Arkansas California \n             1 2 2 1 2 \n      Colorado Connecticut Delaware Florida Georgia \n             2 3 3 2 1 \n        Hawaii Idaho Illinois Indiana Iowa \n             3 4 2 3 4 \n        Kansas Kentucky Louisiana Maine Maryland \n             3 3 1 4 2 \n Massachusetts Michigan Minnesota Mississippi Missouri \n             3 2 4 1 3 \n       Montana Nebraska Nevada New Hampshire New Jersey \n             3 3 2 4 3 \n    New Mexico New York North Carolina North Dakota Ohio \n             2 2 1 4 3 \n      Oklahoma Oregon Pennsylvania Rhode Island South Carolina \n             3 3 3 3 1 \n  South Dakota Tennessee Texas Utah Vermont \n             4 1 2 3 4 \n      Virginia Washington West Virginia Wisconsin Wyoming \n             3 3 4 4 3 \nObjective function:\n   build swap \n1.035116 1.027102 \n\nAvailable components:\n [1] \"medoids\" \"id.med\" \"clustering\" \"objective\" \"isolation\" \n [6] \"clusinfo\" \"silinfo\" \"diss\" \"call\" \"data\"          \n<\/strong><\/pre>\n<p> <span style=\"color: #000000;\">4 \u3064\u306e\u30af\u30e9\u30b9\u30bf\u30fc\u91cd\u5fc3\u306f\u3059\u3079\u3066\u3001\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u5185\u306e\u5b9f\u969b\u306e\u89b3\u6e2c\u5024\u3067\u3042\u308b\u3053\u3068\u306b\u6ce8\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u51fa\u529b\u306e\u4e0a\u90e8\u8fd1\u304f\u3067\u30014 \u3064\u306e\u91cd\u5fc3\u304c\u6b21\u306e\u72b6\u614b\u3067\u3042\u308b\u3053\u3068\u304c\u308f\u304b\u308a\u307e\u3059\u3002<\/span><\/p>\n<ul>\n<li><span style=\"color: #000000;\">\u30a2\u30e9\u30d0\u30de\u5dde<\/span><\/li>\n<li><span style=\"color: #000000;\">\u30df\u30b7\u30ac\u30f3\u5dde<\/span><\/li>\n<li><span style=\"color: #000000;\">\u30aa\u30af\u30e9\u30db\u30de\u5dde<\/span><\/li>\n<li><span style=\"color: #000000;\">\u30cb\u30e5\u30fc\u30cf\u30f3\u30d7\u30b7\u30e3\u30fc<\/span><\/li>\n<\/ul>\n<p><span style=\"color: #000000;\"><strong>fivz_cluster()<\/strong>\u95a2\u6570\u3092\u4f7f\u7528\u3057\u3066\u3001\u8ef8\u4e0a\u306e\u6700\u521d\u306e 2 \u3064\u306e\u4e3b\u6210\u5206\u3092\u8868\u793a\u3059\u308b\u6563\u5e03\u56f3\u3067\u30af\u30e9\u30b9\u30bf\u30fc\u3092\u8996\u899a\u5316\u3067\u304d\u307e\u3059\u3002<\/span> <\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong><span style=\"color: #008080;\">#plot results of final k-medoids model\n<span style=\"color: #000000;\">fviz_cluster(kmed, data = df)\n<\/span><\/span><\/strong><\/pre>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-12329 \" src=\"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/kmedoide3.png\" alt=\"R \u3067\u306e k-medoid \u30af\u30e9\u30b9\u30bf\u30fc\u306e\u30d7\u30ed\u30c3\u30c8\" width=\"497\" height=\"500\" srcset=\"\" sizes=\"auto, \"><\/p>\n<p><span style=\"color: #000000;\">\u5404\u5dde\u306e\u30af\u30e9\u30b9\u30bf\u30fc\u5272\u308a\u5f53\u3066\u3092\u5143\u306e\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u306b\u8ffd\u52a0\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong><span style=\"color: #008080;\">#add cluster assignment to original data\n<span style=\"color: #000000;\">final_data &lt;- cbind(USArrests, cluster = kmed$cluster)\n<\/span>\n#view final data\n<span style=\"color: #000000;\">head(final_data)\n\n           Murder Assault UrbanPop Rape cluster\nAlabama 13.2 236 58 21.2 1\nAlaska 10.0 263 48 44.5 2\nArizona 8.1 294 80 31.0 2\nArkansas 8.8 190 50 19.5 1\nCalifornia 9.0 276 91 40.6 2\nColorado 7.9 204 78 38.7 2\n<\/span><\/span><\/strong><\/pre>\n<hr>\n<p><span style=\"color: #000000;\">\u3053\u306e\u4f8b\u3067\u4f7f\u7528\u3055\u308c\u3066\u3044\u308b\u5b8c\u5168\u306a R \u30b3\u30fc\u30c9\u306f\u3001 <a href=\"https:\/\/github.com\/Statorials\/R-Guides\/blob\/main\/k_medoids.R\" target=\"_blank\" rel=\"noopener noreferrer\">\u3053\u3053\u3067<\/a>\u898b\u3064\u3051\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u30af\u30e9\u30b9\u30bf\u30ea\u30f3\u30b0\u306f\u3001\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u5185\u3067\u89b3\u5bdf\u306e\u30b0\u30eb\u30fc\u30d7\u307e\u305f\u306f\u30af\u30e9\u30b9\u30bf\u30fc\u3092\u898b\u3064\u3051\u3088\u3046\u3068\u3059\u308b\u6a5f\u68b0\u5b66\u7fd2\u624b\u6cd5\u3067\u3059\u3002 \u76ee\u6a19\u306f\u3001\u5404\u30af\u30e9\u30b9\u30bf\u30fc\u5185\u306e\u89b3\u6e2c\u5024\u304c\u4e92\u3044\u306b\u975e\u5e38\u306b\u985e\u4f3c\u3057\u3066\u3044\u308b\u4e00\u65b9\u3067\u3001\u7570\u306a\u308b\u30af\u30e9\u30b9\u30bf\u30fc\u5185\u306e\u89b3\u6e2c\u5024\u304c\u4e92\u3044\u306b\u5927\u304d\u304f\u7570\u306a\u308b\u3088\u3046\u306a\u30af [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-1244","post","type-post","status-publish","format-standard","hentry","category-16"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v21.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>R \u306e K-Medoids: \u30b9\u30c6\u30c3\u30d7\u30d0\u30a4\u30b9\u30c6\u30c3\u30d7\u306e\u4f8b<\/title>\n<meta name=\"description\" content=\"\u3053\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3067\u306f\u3001R \u3067 k-medoids \u30af\u30e9\u30b9\u30bf\u30ea\u30f3\u30b0\u3092\u5b9f\u884c\u3059\u308b\u65b9\u6cd5\u306e\u6bb5\u968e\u7684\u306a\u4f8b\u3092\u793a\u3057\u307e\u3059\u3002\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/statorials.org\/ja\/r-\u306e-k-medoid\/\" \/>\n<meta property=\"og:locale\" content=\"ja_JP\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"R \u306e K-Medoids: \u30b9\u30c6\u30c3\u30d7\u30d0\u30a4\u30b9\u30c6\u30c3\u30d7\u306e\u4f8b\" \/>\n<meta property=\"og:description\" content=\"\u3053\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3067\u306f\u3001R \u3067 k-medoids \u30af\u30e9\u30b9\u30bf\u30ea\u30f3\u30b0\u3092\u5b9f\u884c\u3059\u308b\u65b9\u6cd5\u306e\u6bb5\u968e\u7684\u306a\u4f8b\u3092\u793a\u3057\u307e\u3059\u3002\" \/>\n<meta property=\"og:url\" content=\"https:\/\/statorials.org\/ja\/r-\u306e-k-medoid\/\" \/>\n<meta property=\"og:site_name\" content=\"Statorials\" \/>\n<meta property=\"article:published_time\" content=\"2023-07-27T03:54:17+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/kmedoide1.png\" \/>\n<meta name=\"author\" content=\"\u30d9\u30f3\u30b8\u30e3\u30df\u30f3\u30fb\u30a2\u30f3\u30c0\u30fc\u30bd\u30f3\u535a\u58eb\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u57f7\u7b46\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u30d9\u30f3\u30b8\u30e3\u30df\u30f3\u30fb\u30a2\u30f3\u30c0\u30fc\u30bd\u30f3\u535a\u58eb\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u63a8\u5b9a\u8aad\u307f\u53d6\u308a\u6642\u9593\" \/>\n\t<meta name=\"twitter:data2\" content=\"2\u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/statorials.org\/ja\/r-%e3%81%ae-k-medoid\/\",\"url\":\"https:\/\/statorials.org\/ja\/r-%e3%81%ae-k-medoid\/\",\"name\":\"R \u306e K-Medoids: \u30b9\u30c6\u30c3\u30d7\u30d0\u30a4\u30b9\u30c6\u30c3\u30d7\u306e\u4f8b\",\"isPartOf\":{\"@id\":\"https:\/\/statorials.org\/ja\/#website\"},\"datePublished\":\"2023-07-27T03:54:17+00:00\",\"dateModified\":\"2023-07-27T03:54:17+00:00\",\"author\":{\"@id\":\"https:\/\/statorials.org\/ja\/#\/schema\/person\/86b92d2dd87368b26360d19d9c6a5d83\"},\"description\":\"\u3053\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3067\u306f\u3001R \u3067 k-medoids \u30af\u30e9\u30b9\u30bf\u30ea\u30f3\u30b0\u3092\u5b9f\u884c\u3059\u308b\u65b9\u6cd5\u306e\u6bb5\u968e\u7684\u306a\u4f8b\u3092\u793a\u3057\u307e\u3059\u3002\",\"breadcrumb\":{\"@id\":\"https:\/\/statorials.org\/ja\/r-%e3%81%ae-k-medoid\/#breadcrumb\"},\"inLanguage\":\"ja\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/statorials.org\/ja\/r-%e3%81%ae-k-medoid\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/statorials.org\/ja\/r-%e3%81%ae-k-medoid\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u5bb6\",\"item\":\"https:\/\/statorials.org\/ja\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"R \u306e k-medoids: \u30b9\u30c6\u30c3\u30d7\u30d0\u30a4\u30b9\u30c6\u30c3\u30d7\u306e\u4f8b\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/statorials.org\/ja\/#website\",\"url\":\"https:\/\/statorials.org\/ja\/\",\"name\":\"Statorials\",\"description\":\"\u7d71\u8a08\u80fd\u529b\u3078\u306e\u30ac\u30a4\u30c9\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/statorials.org\/ja\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"ja\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/statorials.org\/ja\/#\/schema\/person\/86b92d2dd87368b26360d19d9c6a5d83\",\"name\":\"\u30d9\u30f3\u30b8\u30e3\u30df\u30f3\u30fb\u30a2\u30f3\u30c0\u30fc\u30bd\u30f3\u535a\u58eb\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\/\/statorials.org\/ja\/#\/schema\/person\/image\/\",\"url\":\"http:\/\/statorials.org\/ja\/wp-content\/uploads\/2023\/10\/Dr.-Benjamin-Anderson-96x96.jpg\",\"contentUrl\":\"http:\/\/statorials.org\/ja\/wp-content\/uploads\/2023\/10\/Dr.-Benjamin-Anderson-96x96.jpg\",\"caption\":\"\u30d9\u30f3\u30b8\u30e3\u30df\u30f3\u30fb\u30a2\u30f3\u30c0\u30fc\u30bd\u30f3\u535a\u58eb\"},\"description\":\"\u79c1\u306f\u30d9\u30f3\u30b8\u30e3\u30df\u30f3\u3067\u3059\u3002\u9000\u8077\u3057\u305f\u7d71\u8a08\u6559\u6388\u304b\u3089\u3001\u5c02\u4efb\u306e Statorials \u6559\u80b2\u8005\u306b\u306a\u308a\u307e\u3057\u305f\u3002 \u7d71\u8a08\u5206\u91ce\u306b\u304a\u3051\u308b\u8c4a\u5bcc\u306a\u7d4c\u9a13\u3068\u5c02\u9580\u77e5\u8b58\u3092\u6d3b\u304b\u3057\u3066\u3001\u79c1\u306f Statorials \u3092\u901a\u3058\u3066\u5b66\u751f\u306b\u529b\u3092\u4e0e\u3048\u308b\u305f\u3081\u306b\u81ea\u5206\u306e\u77e5\u8b58\u3092\u5171\u6709\u3059\u308b\u3053\u3068\u306b\u5c3d\u529b\u3057\u3066\u3044\u307e\u3059\u3002\u3082\u3063\u3068\u77e5\u308b\",\"sameAs\":[\"http:\/\/statorials.org\/ja\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"R \u306e K-Medoids: \u30b9\u30c6\u30c3\u30d7\u30d0\u30a4\u30b9\u30c6\u30c3\u30d7\u306e\u4f8b","description":"\u3053\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3067\u306f\u3001R \u3067 k-medoids \u30af\u30e9\u30b9\u30bf\u30ea\u30f3\u30b0\u3092\u5b9f\u884c\u3059\u308b\u65b9\u6cd5\u306e\u6bb5\u968e\u7684\u306a\u4f8b\u3092\u793a\u3057\u307e\u3059\u3002","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/statorials.org\/ja\/r-\u306e-k-medoid\/","og_locale":"ja_JP","og_type":"article","og_title":"R \u306e K-Medoids: \u30b9\u30c6\u30c3\u30d7\u30d0\u30a4\u30b9\u30c6\u30c3\u30d7\u306e\u4f8b","og_description":"\u3053\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3067\u306f\u3001R \u3067 k-medoids \u30af\u30e9\u30b9\u30bf\u30ea\u30f3\u30b0\u3092\u5b9f\u884c\u3059\u308b\u65b9\u6cd5\u306e\u6bb5\u968e\u7684\u306a\u4f8b\u3092\u793a\u3057\u307e\u3059\u3002","og_url":"https:\/\/statorials.org\/ja\/r-\u306e-k-medoid\/","og_site_name":"Statorials","article_published_time":"2023-07-27T03:54:17+00:00","og_image":[{"url":"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/kmedoide1.png"}],"author":"\u30d9\u30f3\u30b8\u30e3\u30df\u30f3\u30fb\u30a2\u30f3\u30c0\u30fc\u30bd\u30f3\u535a\u58eb","twitter_card":"summary_large_image","twitter_misc":{"\u57f7\u7b46\u8005":"\u30d9\u30f3\u30b8\u30e3\u30df\u30f3\u30fb\u30a2\u30f3\u30c0\u30fc\u30bd\u30f3\u535a\u58eb","\u63a8\u5b9a\u8aad\u307f\u53d6\u308a\u6642\u9593":"2\u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/statorials.org\/ja\/r-%e3%81%ae-k-medoid\/","url":"https:\/\/statorials.org\/ja\/r-%e3%81%ae-k-medoid\/","name":"R \u306e K-Medoids: \u30b9\u30c6\u30c3\u30d7\u30d0\u30a4\u30b9\u30c6\u30c3\u30d7\u306e\u4f8b","isPartOf":{"@id":"https:\/\/statorials.org\/ja\/#website"},"datePublished":"2023-07-27T03:54:17+00:00","dateModified":"2023-07-27T03:54:17+00:00","author":{"@id":"https:\/\/statorials.org\/ja\/#\/schema\/person\/86b92d2dd87368b26360d19d9c6a5d83"},"description":"\u3053\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3067\u306f\u3001R \u3067 k-medoids \u30af\u30e9\u30b9\u30bf\u30ea\u30f3\u30b0\u3092\u5b9f\u884c\u3059\u308b\u65b9\u6cd5\u306e\u6bb5\u968e\u7684\u306a\u4f8b\u3092\u793a\u3057\u307e\u3059\u3002","breadcrumb":{"@id":"https:\/\/statorials.org\/ja\/r-%e3%81%ae-k-medoid\/#breadcrumb"},"inLanguage":"ja","potentialAction":[{"@type":"ReadAction","target":["https:\/\/statorials.org\/ja\/r-%e3%81%ae-k-medoid\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/statorials.org\/ja\/r-%e3%81%ae-k-medoid\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u5bb6","item":"https:\/\/statorials.org\/ja\/"},{"@type":"ListItem","position":2,"name":"R \u306e k-medoids: \u30b9\u30c6\u30c3\u30d7\u30d0\u30a4\u30b9\u30c6\u30c3\u30d7\u306e\u4f8b"}]},{"@type":"WebSite","@id":"https:\/\/statorials.org\/ja\/#website","url":"https:\/\/statorials.org\/ja\/","name":"Statorials","description":"\u7d71\u8a08\u80fd\u529b\u3078\u306e\u30ac\u30a4\u30c9","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/statorials.org\/ja\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"ja"},{"@type":"Person","@id":"https:\/\/statorials.org\/ja\/#\/schema\/person\/86b92d2dd87368b26360d19d9c6a5d83","name":"\u30d9\u30f3\u30b8\u30e3\u30df\u30f3\u30fb\u30a2\u30f3\u30c0\u30fc\u30bd\u30f3\u535a\u58eb","image":{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/statorials.org\/ja\/#\/schema\/person\/image\/","url":"http:\/\/statorials.org\/ja\/wp-content\/uploads\/2023\/10\/Dr.-Benjamin-Anderson-96x96.jpg","contentUrl":"http:\/\/statorials.org\/ja\/wp-content\/uploads\/2023\/10\/Dr.-Benjamin-Anderson-96x96.jpg","caption":"\u30d9\u30f3\u30b8\u30e3\u30df\u30f3\u30fb\u30a2\u30f3\u30c0\u30fc\u30bd\u30f3\u535a\u58eb"},"description":"\u79c1\u306f\u30d9\u30f3\u30b8\u30e3\u30df\u30f3\u3067\u3059\u3002\u9000\u8077\u3057\u305f\u7d71\u8a08\u6559\u6388\u304b\u3089\u3001\u5c02\u4efb\u306e Statorials \u6559\u80b2\u8005\u306b\u306a\u308a\u307e\u3057\u305f\u3002 \u7d71\u8a08\u5206\u91ce\u306b\u304a\u3051\u308b\u8c4a\u5bcc\u306a\u7d4c\u9a13\u3068\u5c02\u9580\u77e5\u8b58\u3092\u6d3b\u304b\u3057\u3066\u3001\u79c1\u306f Statorials \u3092\u901a\u3058\u3066\u5b66\u751f\u306b\u529b\u3092\u4e0e\u3048\u308b\u305f\u3081\u306b\u81ea\u5206\u306e\u77e5\u8b58\u3092\u5171\u6709\u3059\u308b\u3053\u3068\u306b\u5c3d\u529b\u3057\u3066\u3044\u307e\u3059\u3002\u3082\u3063\u3068\u77e5\u308b","sameAs":["http:\/\/statorials.org\/ja"]}]}},"yoast_meta":{"yoast_wpseo_title":"","yoast_wpseo_metadesc":"","yoast_wpseo_canonical":""},"_links":{"self":[{"href":"https:\/\/statorials.org\/ja\/wp-json\/wp\/v2\/posts\/1244","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/statorials.org\/ja\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/statorials.org\/ja\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/statorials.org\/ja\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/statorials.org\/ja\/wp-json\/wp\/v2\/comments?post=1244"}],"version-history":[{"count":0,"href":"https:\/\/statorials.org\/ja\/wp-json\/wp\/v2\/posts\/1244\/revisions"}],"wp:attachment":[{"href":"https:\/\/statorials.org\/ja\/wp-json\/wp\/v2\/media?parent=1244"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/statorials.org\/ja\/wp-json\/wp\/v2\/categories?post=1244"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/statorials.org\/ja\/wp-json\/wp\/v2\/tags?post=1244"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}