{"id":50762,"date":"2021-09-10T00:00:00","date_gmt":"2021-09-10T07:00:00","guid":{"rendered":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/%e6%9c%aa%e5%88%86%e9%a1%9e\/how-to-implement-the-k-means-algorithm-using-java-and-griddb\/"},"modified":"2025-11-14T07:54:52","modified_gmt":"2025-11-14T15:54:52","slug":"how-to-implement-the-k-means-algorithm-using-java-and-griddb","status":"publish","type":"post","link":"https:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/how-to-implement-the-k-means-algorithm-using-java-and-griddb\/","title":{"rendered":"Java\u3068GridDB\u3092\u4f7f\u3063\u305fK-Means\u30a2\u30eb\u30b4\u30ea\u30ba\u30e0\u306e\u5b9f\u88c5\u65b9\u6cd5"},"content":{"rendered":"<h2>\u306f\u3058\u3081\u306b<\/h2>\n<p>\u30af\u30e9\u30b9\u30bf\u30ea\u30f3\u30b0\u306f\u30c7\u30fc\u30bf\u30de\u30a4\u30cb\u30f3\u30b0\u306e\u4ee3\u8868\u7684\u306a\u30bf\u30b9\u30af\u3067\u3059\u3002\u3053\u306e\u30bf\u30b9\u30af\u3067\u306f\u3001\u30c7\u30fc\u30bf\u30a2\u30a4\u30c6\u30e0\u3092\u3044\u304f\u3064\u304b\u306e\u610f\u5473\u306e\u3042\u308b\u30b0\u30eb\u30fc\u30d7\u307e\u305f\u306f\u30af\u30e9\u30b9\u30bf\u306b\u5206\u5272\u3057\u307e\u3059\u3002\u30af\u30e9\u30b9\u30bf\u30ea\u30f3\u30b0\u306f\u3001\u30c7\u30fc\u30bf\u30a2\u30a4\u30c6\u30e0\u9593\u306e\u57fa\u672c\u7684\u306a\u95a2\u4fc2\u3092\u7279\u5b9a\u3059\u308b\u306e\u306b\u5f79\u7acb\u3061\u3001\u610f\u601d\u6c7a\u5b9a\u306b\u3082\u5f79\u7acb\u3061\u307e\u3059\u3002<\/p>\n<p>\u30af\u30e9\u30b9\u30bf\u30ea\u30f3\u30b0\u30a2\u30eb\u30b4\u30ea\u30ba\u30e0\u306f\u6570\u591a\u304f\u5b58\u5728\u3057\u307e\u3059\u304c\u3001K-Means\u306f\u6700\u3082\u4e00\u822c\u7684\u3067\u7c21\u5358\u306a\u30af\u30e9\u30b9\u30bf\u30ea\u30f3\u30b0\u30a2\u30eb\u30b4\u30ea\u30ba\u30e0\u3067\u3059\u3002K-Means\u306f\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u3092<code>k<\/code>\u500b\u306e\u30b0\u30eb\u30fc\u30d7\u306b\u5206\u5272\u3057\u307e\u3059\u3002\u4f3c\u305f\u3088\u3046\u306a\u30a2\u30a4\u30c6\u30e0\u306f\u540c\u3058\u30b0\u30eb\u30fc\u30d7\u306b\u5165\u308c\u3089\u308c\u3001\u4f3c\u3066\u3044\u306a\u3044\u30a2\u30a4\u30c6\u30e0\u306f\u7570\u306a\u308b\u30b0\u30eb\u30fc\u30d7\u306b\u5165\u308c\u3089\u308c\u307e\u3059\u3002\u3053\u306e\u30d6\u30ed\u30b0\u3067\u306f\u3001Java\u3068GridDB\u3092\u4f7f\u3063\u3066K-Means\u30a2\u30eb\u30b4\u30ea\u30ba\u30e0\u3092\u5b9f\u88c5\u3059\u308b\u65b9\u6cd5\u306b\u3064\u3044\u3066\u8aac\u660e\u3057\u307e\u3059\u3002<\/p>\n<h2>K-Means\u30a2\u30eb\u30b4\u30ea\u30ba\u30e0 \u3068\u306f\u4f55\u304b\uff1f<\/h2>\n<p>K-Means\u306f\u30c7\u30fc\u30bf\u30a2\u30a4\u30c6\u30e0\u3092\u6700\u3082\u8fd1\u3044\u30af\u30e9\u30b9\u30bf\u306b\u5272\u308a\u5f53\u3066\u308b\u30af\u30e9\u30b9\u30bf\u30ea\u30f3\u30b0\u30a2\u30eb\u30b4\u30ea\u30ba\u30e0\u3067\u3059\u3001\u3053\u306e\u30a2\u30eb\u30b4\u30ea\u30ba\u30e0\u3067\u306f\u3001\u4e00\u3064\u306e\u30d7\u30ed\u30d1\u30c6\u30a3\u3001\u3059\u306a\u308f\u3061\u3001\u901a\u5e38<code>k<\/code>\u3068\u793a\u3055\u308c\u308b\u30af\u30e9\u30b9\u30bf\u306e\u6570\u3092\u6307\u5b9a\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>\u4ee5\u4e0b\u306e\u7591\u4f3c\u30b3\u30fc\u30c9\u306f\u3001\u3053\u306e\u30a2\u30eb\u30b4\u30ea\u30ba\u30e0\u304c\u3069\u306e\u3088\u3046\u306b\u6a5f\u80fd\u3059\u308b\u304b\u3092\u8aac\u660e\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<pre><code>Step 1: `k`\u500b\u306e\u521d\u671f\u30bb\u30f3\u30c8\u30ed\u30a4\u30c9\u3092\u9078\u629e\u3057\u307e\u3059\u3002\n\n\u7e70\u308a\u8fd4\u3059:\n\n    Step 2: \u5404\u30c7\u30fc\u30bf\u30dd\u30a4\u30f3\u30c8\u3092\u6700\u3082\u8fd1\u3044\u30af\u30e9\u30b9\u30bf\u306e\u30bb\u30f3\u30c8\u30ed\u30a4\u30c9\u306b\u5272\u308a\u5f53\u3066\u3066\uff0c`k`\u500b\u306e\u30af\u30e9\u30b9\u30bf\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002\n\n    Step 3: \u30af\u30e9\u30b9\u30bf\u306e\u65b0\u3057\u3044\u30bb\u30f3\u30c8\u30ed\u30a4\u30c9\u3092\u518d\u8a08\u7b97\u3057\u307e\u3059\u3002\n\n\u3053\u308c\u3092\u30bb\u30f3\u30c8\u30ed\u30a4\u30c9\u304c\u5909\u5316\u3057\u306a\u304f\u306a\u308b\u307e\u3067\u7e70\u308a\u8fd4\u3057\u3066\u884c\u3044\u307e\u3059\u3002\n<\/code><\/pre>\n<p>\u30e6\u30fc\u30b6\u30fc\u306f\u3001\u5f62\u6210\u3059\u308b\u30af\u30e9\u30b9\u30bf\u306e\u6570\u3067\u3042\u308b<code>k<\/code>\u306e\u5024\u3092\u6307\u5b9a\u3059\u308b\u3053\u3068\u304c\u6c42\u3081\u3089\u308c\u307e\u3059\u3002\u30a2\u30eb\u30b4\u30ea\u30ba\u30e0\u306f\u3001\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u304b\u3089 <code>k<\/code> \u500b\u306e\u30aa\u30d6\u30b6\u30d9\u30fc\u30b7\u30e7\u30f3\u3092\u9078\u629e\u3057\u3066\uff0c\u30af\u30e9\u30b9\u30bf\u30fc\u306e\u4e2d\u5fc3\u3068\u3057\u307e\u3059\u3002<\/p>\n<p>\u6b21\u306e\u30b9\u30c6\u30c3\u30d7\u3067\u306f\u3001\u3059\u3079\u3066\u306e\u30c7\u30fc\u30bf\u9805\u76ee\u3092\u8abf\u3079\u3066\u30af\u30e9\u30b9\u30bf\u306b\u5206\u985e\u3057\u3001\u3059\u3079\u3066\u306e\u89b3\u6e2c\u30c7\u30fc\u30bf\u304c\u6700\u3082\u8fd1\u3044\u30bb\u30f3\u30c8\u30ed\u30a4\u30c9\u306b\u5272\u308a\u5f53\u3066\u3089\u308c\u308b\u3088\u3046\u306b\u3057\u307e\u3059\u3002<\/p>\n<p>\u305d\u306e\u5f8c\u3001\u30af\u30e9\u30b9\u30bf\u306e\u65b0\u3057\u3044\u30bb\u30f3\u30c8\u30ed\u30a4\u30c9\u304c\u518d\u8a08\u7b97\u3055\u308c\u307e\u3059\u3002\u3053\u308c\u306f\u3001\u30af\u30e9\u30b9\u30bf\u5185\u306e\u3059\u3079\u3066\u306e\u30aa\u30d6\u30b6\u30d9\u30fc\u30b7\u30e7\u30f3\u306e\u5e73\u5747\u5024\u3092\u5f97\u308b\u3053\u3068\u3067\u884c\u308f\u308c\u3001\u305d\u306e\u7d50\u679c\u304c\u65b0\u3057\u3044\u30bb\u30f3\u30c8\u30ed\u30a4\u30c9\u306b\u306a\u308a\u307e\u3059\u3002\u4e0a\u8a18\u306e\u30b9\u30c6\u30c3\u30d7\u306f\u3001\u30bb\u30f3\u30c8\u30ed\u30a4\u30c9\u304c\u5909\u5316\u3057\u306a\u304f\u306a\u308b\u307e\u3067\u7e70\u308a\u8fd4\u3055\u308c\u307e\u3059\u3002<\/p>\n<p>\u6b21\u306b\u3001K-Means\u30a2\u30eb\u30b4\u30ea\u30ba\u30e0\u3092Java\u3067\u5b9f\u88c5\u3059\u308b\u65b9\u6cd5\u3092\u7d39\u4ecb\u3057\u307e\u3059\u3002\u84c4\u7a4d\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3068\u3057\u3066GridDB\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002<\/p>\n<h2>Java\u3067K-Means\u3092\u5b9f\u88c5\u3059\u308b<\/h2>\n<p>\u3053\u3053\u304b\u3089\u306f\u3001Java\u3068GridDB\u3092\u4f7f\u3063\u3066K-Means\u30a2\u30eb\u30b4\u30ea\u30ba\u30e0\u3092\u5b9f\u88c5\u3057\u307e\u3059\u3002\u4eca\u56de\u306f\u3001\u8907\u6570\u4eba\u306e\u5e74\u53ce\u3068\u3001\u305d\u308c\u306b\u5bfe\u5fdc\u3059\u308b\u652f\u51fa\u30b9\u30b3\u30a2\u3092\u793a\u3059\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002<\/p>\n<p><a href=\"https:\/\/griddb.net\/wp-content\/uploads\/2021\/09\/capture.png\"><img fetchpriority=\"high\" decoding=\"async\" src=\"https:\/\/griddb.net\/wp-content\/uploads\/2021\/09\/capture.png\" alt=\"\" width=\"205\" height=\"467\" class=\"aligncenter size-full wp-image-27743\" srcset=\"\/wp-content\/uploads\/2021\/09\/capture.png 205w, \/wp-content\/uploads\/2021\/09\/capture-132x300.png 132w\" sizes=\"(max-width: 205px) 100vw, 205px\" \/><\/a><\/p>\n<p>\u307e\u305a\u3001\u30c7\u30fc\u30bf\u3092GridDB\u306b\u66f8\u304d\u8fbc\u307f\u3001\u305d\u3053\u304b\u3089K-Means\u30a2\u30eb\u30b4\u30ea\u30ba\u30e0\u3092\u4f7f\u3063\u3066\u5206\u6790\u3059\u308b\u305f\u3081\u306b\u30c7\u30fc\u30bf\u3092\u53d6\u308a\u51fa\u3057\u307e\u3059\u3002<\/p>\n<h2>\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30a4\u30f3\u30dd\u30fc\u30c8\u3059\u308b<\/h2>\n<p>\u307e\u305a\u3001\u4f7f\u7528\u3059\u308b\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30a4\u30f3\u30dd\u30fc\u30c8\u3057\u307e\u3059\u3002<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-java\">import java.io.IOException;\nimport java.util.Collection;\nimport java.util.Properties;\nimport java.util.Scanner;\n\nimport com.toshiba.mwcloud.gs.Collection;\nimport com.toshiba.mwcloud.gs.GSException;\nimport com.toshiba.mwcloud.gs.GridStore;\nimport com.toshiba.mwcloud.gs.GridStoreFactory;\nimport com.toshiba.mwcloud.gs.Query;\nimport com.toshiba.mwcloud.gs.RowKey;\nimport com.toshiba.mwcloud.gs.RowSet;<\/code><\/pre>\n<\/div>\n<h2>GridDB\u306b\u30c7\u30fc\u30bf\u3092\u66f8\u304d\u8fbc\u3080<\/h2>\n<p>\u30c7\u30fc\u30bf\u306f<a href=\"https:\/\/griddb.net\/en\/download\/27745\/\">&#8220;Customers.csv&#8221;<\/a>\u3068\u3044\u3046CSV\u30d5\u30a1\u30a4\u30eb\u306b\u4fdd\u5b58\u3055\u308c\u3066\u3044\u307e\u3059\u304c\u3001\u3053\u308c\u3092GridDB\u30b3\u30f3\u30c6\u30ca\u306b\u79fb\u52d5\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u307e\u305a\u3001\u30b3\u30f3\u30c6\u30ca\u306e\u30b9\u30ad\u30fc\u30de\u3092\u30b9\u30bf\u30c6\u30a3\u30c3\u30af\u306a\u30af\u30e9\u30b9\u3068\u3057\u3066\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-java\"> public static class Customers{\n    \n         @RowKey String income;\n     String spending_score;\n    \n    }<\/code><\/pre>\n<\/div>\n<p>\u4e0a\u8a18\u306e\u30af\u30e9\u30b9\u306f\u30012\u3064\u306e\u30ab\u30e9\u30e0\u3092\u6301\u3064\u30b3\u30f3\u30c6\u30ca\u307e\u305f\u306fSQL\u30c6\u30fc\u30d6\u30eb\u3068\u3057\u3066\u898b\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u3053\u3053\u3067\u3001GridDB\u3078\u306e\u63a5\u7d9a\u3092\u78ba\u7acb\u3055\u305b\u307e\u3059\u3002\u63a5\u7d9a\u3059\u308b\u30af\u30e9\u30b9\u30bf\u306e\u540d\u524d\u3001\u63a5\u7d9a\u3059\u308b\u5fc5\u8981\u306e\u3042\u308b\u30e6\u30fc\u30b6\u306e\u540d\u524d\u3001\u304a\u3088\u3073\u305d\u306e\u30e6\u30fc\u30b6\u306e\u30d1\u30b9\u30ef\u30fc\u30c9\u306a\u3069\u3001GridDB\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306e\u4ed5\u69d8\u3092\u4f7f\u7528\u3057\u3066Properties\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u4f5c\u6210\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u4ee5\u4e0b\u306e\u30b3\u30fc\u30c9\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-java\">Properties props = new Properties();\n        props.setProperty(\"notificationAddress\", \"239.0.0.1\");\n        props.setProperty(\"notificationPort\", \"31999\");\n        props.setProperty(\"clusterName\", \"defaultCluster\");\n        props.setProperty(\"user\", \"admin\");\n        props.setProperty(\"password\", \"admin\");\n        GridStore store = GridStoreFactory.getInstance().getGridStore(props);<\/code><\/pre>\n<\/div>\n<p>\u4e0a\u8a18\u306f\u3001\u79c1\u305f\u3061\u304c\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u305fGridDB\u306e\u8a73\u7d30\u3067\u3059\u3002\u5404\u81ea\u306e\u74b0\u5883\u306b\u5408\u308f\u305b\u3066\u9069\u5b9c\u5909\u66f4\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u4eca\u56de\u306f<code>Customers<\/code>\u30b3\u30f3\u30c6\u30ca\u3092\u4f7f\u7528\u3059\u308b\u306e\u3067\u3001\u307e\u305a\u305d\u308c\u3092\u9078\u629e\u3057\u307e\u3059\u3002<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-java\">Collection&lt;String, Customers> coll = store.putCollection(\"col01\", Customers.class);<\/code><\/pre>\n<\/div>\n<p>\u30b3\u30f3\u30c6\u30ca <code>Customers<\/code> \u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u4f5c\u6210\u3057\u3001<code>coll<\/code> \u3068\u3044\u3046\u540d\u524d\u3092\u4ed8\u3051\u307e\u3057\u305f\u3002\u4eca\u5f8c\u306f\u3053\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u4f7f\u3063\u3066\u30b3\u30f3\u30c6\u30ca\u3092\u53c2\u7167\u3057\u307e\u3059\u3002<\/p>\n<h2>\u30c7\u30fc\u30bf\u3092GridDB\u306b\u683c\u7d0d\u3059\u308b<\/h2>\n<p>\u6b21\u306eJava\u30b3\u30fc\u30c9\u306f\u3001&#8221;Customers.csv &#8220;\u30d5\u30a1\u30a4\u30eb\u304b\u3089\u30c7\u30fc\u30bf\u3092\u8aad\u307f\u53d6\u308a\u3001\u305d\u308c\u3092GridDB\u306b\u683c\u7d0d\u3059\u308b\u305f\u3081\u306b\u4f7f\u3044\u307e\u3059\u3002<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-java\">File file1 = new File(\"Customers.csv\");\n                Scanner sc = new Scanner(file1);\n                String data = sc.next();\n \n                while (sc.hasNext()){\n                        String scData = sc.next();\n                        String dataList[] = scData.split(\",\");\n                        String income = dataList[0];\n                        String spending_score = dataList[1];\n                        \n                        \n                        Customers customers = new Customers();\n    \n                        customers.income = income;\n                        customers.spending_score = spending_score;\n                        coll.append(customers);\n                 }<\/code><\/pre>\n<\/div>\n<p>\u3053\u306e\u30b3\u30fc\u30c9\u3067\u306f\u3001&#8221;Customers.csv &#8220;\u30d5\u30a1\u30a4\u30eb\u304b\u3089\u30c7\u30fc\u30bf\u3092\u8aad\u307f\u8fbc\u307f\u3001<code>customers<\/code>\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u4f5c\u6210\u3057\u3066\u3044\u307e\u3059\u3002\u305d\u3057\u3066\u3001\u305d\u306e <code>customers<\/code> \u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092 GridDB \u30b3\u30f3\u30c6\u30ca\u306b\u8ffd\u52a0\u3057\u3066\u3044\u307e\u3059\u3002.csv \u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u306e\u533a\u5207\u308a\u6587\u5b57\u306b\u306f\u30ab\u30f3\u30de (,) \u3092\u4f7f\u7528\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<h2>GridDB\u304b\u3089\u30c7\u30fc\u30bf\u3092\u53d6\u5f97\u3059\u308b<\/h2>\n<p>\u3053\u308c\u3067\u3001GridDB\u304b\u3089\u30c7\u30fc\u30bf\u3092\u53d6\u308a\u51fa\u3057\u3001K-Means\u30a2\u30eb\u30b4\u30ea\u30ba\u30e0\u3092\u4f7f\u3063\u3066\u5206\u6790\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u4ee5\u4e0b\u306e\u30b3\u30fc\u30c9\u306f\u3001GridDB\u306b\u30c7\u30fc\u30bf\u3092\u7167\u4f1a\u3059\u308b\u305f\u3081\u306e\u3082\u306e\u3067\u3059\u3002<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-java\">Query&lt;customers> query = coll.query(\"select *\");\n                RowSet&lt;\/customers>&lt;customers> rs = query.fetch(false);\n            RowSet res = query.fetch();&lt;\/customers><\/code><\/pre>\n<\/div>\n<p><code>select *<\/code>\u6587\u306f\u3001\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u30b3\u30f3\u30c6\u30ca\u304b\u3089\u3059\u3079\u3066\u306e\u30c7\u30fc\u30bf\u3092\u7167\u4f1a\u3059\u308b\u306e\u306b\u5f79\u7acb\u3061\u307e\u3059\u3002<\/p>\n<h2>\u30c7\u30fc\u30bf\u3092\u30af\u30e9\u30b9\u30bf\u30fc\u5316\u3059\u308b<\/h2>\n<p>\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u304b\u3089\u30c7\u30fc\u30bf\u3092\u53d6\u308a\u51fa\u3057\u305f\u306e\u3067\u3001K-Means\u30a2\u30eb\u30b4\u30ea\u30ba\u30e0\u3092\u4f7f\u3063\u3066\u30af\u30e9\u30b9\u30bf\u30ea\u30f3\u30b0\u3092\u884c\u3044\u307e\u3059\u3002\u30c7\u30fc\u30bf\u304b\u30892\u3064\u306e\u30af\u30e9\u30b9\u30bf\u3092\u4f5c\u6210\u3059\u308b\u306e\u3067\u3001<code>k<\/code>\u306e\u5024\u30922\u306b\u8a2d\u5b9a\u3057\u307e\u3059\u3002<\/p>\n<p>\u307e\u305f\u30012\u3064\u306e\u70b9\u3092\u521d\u671f\u5316\u3057\u3066\u30012\u3064\u306e\u30af\u30e9\u30b9\u30bf\u306e\u30bb\u30f3\u30c8\u30ed\u30a4\u30c9\u306e\u521d\u671f\u30bb\u30f3\u30c8\u30ed\u30a4\u30c9\u3068\u3057\u3066\u6a5f\u80fd\u3055\u305b\u307e\u3059\u3002\u3053\u306e\u30b3\u30fc\u30c9\u3067\u306f\u3001\u5404\u30c7\u30fc\u30bf\u30a2\u30a4\u30c6\u30e0\u3068\u30bb\u30f3\u30c8\u30ed\u30a4\u30c9\u306e\u9593\u306e\u8ddd\u96e2\u3092\u8a08\u7b97\u3057\u3001\u5404\u30c7\u30fc\u30bf\u30a2\u30a4\u30c6\u30e0\u3092\u6700\u3082\u8fd1\u3044\u30af\u30e9\u30b9\u30bf\u306b\u5272\u308a\u5f53\u3066\u307e\u3059\u3002<\/p>\n<p>\u3053\u306e\u30b3\u30fc\u30c9\u306f\u3001\u30af\u30e9\u30b9\u30bf\u30fc\u306e\u30bb\u30f3\u30c8\u30ed\u30a4\u30c9\u304c\u5909\u5316\u3057\u306a\u304f\u306a\u308b\u3068\u3001\u53cd\u5fa9\u51e6\u7406\u3092\u505c\u6b62\u3057\u307e\u3059\u3002<\/p>\n<p>\u30b3\u30fc\u30c9\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3059\u3002<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-java\">int x,j,k=2;\n        int cluster1[][] = new int[18][10];\n        int cluster2[][] = new int[20][80];\n        float mean1[][] = new float[1][2];\n        float mean2[][] = new float[1][2];\n        float temp1[][] = new float[1][2], temp2[][] = new float[1][2];\n        int sum11 = 0, sum12 = 0, sum21 = 0, sum22 = 0;\n        double dist1, dist2;\n        int i1 = 0, i2 = 0, itr = 0;\n        \n        \n        System.out.println(\"nNumber of clusters: \"+k);\n        \n        \/\/ Set random means\n        mean1[0][0] = 18;\n        mean1[0][1] = 10;\n        mean2[0][0] = 20;\n        mean2[0][1] = 80;\n        \n        \/\/ Loop untill the new mean and previous mean are the same\n        while(!Arrays.deepEquals(mean1, temp1) || !Arrays.deepEquals(mean2, temp2)) {\n        \n            \/\/Empty the partitions\n            for(x=0;x&lt;10;x++) {\n                cluster1[x][0] = 0;\n                cluster1[x][1] = 0;\n                cluster2[x][0] = 0;\n                cluster2[x][1] = 0;\n            }\n            \n            i1 = 0; i2 = 0;\n            \n            \/\/Find the distance between mean and the data point and store it in its corresponding partition\n            for(x=0;x&lt;10;x++) {\n                dist1 = Math.sqrt(Math.pow(res[x][0] - mean1[0][0],2) + Math.pow(res[x][1] - mean1[0][1],2));\n                dist2 = Math.sqrt(Math.pow(res[x][0] - mean2[0][0],2) + Math.pow(res[x][1] - mean2[0][1],2));\n                \n                if(dist1 &lt; dist2) {\n                    cluster1[i1][0] = res[x][0];\n                    cluster1[i1][1] = res[x][1];\n                    \n                    i1++;\n                }\n                else {\n                    cluster2[i2][0] = res[x][0];\n                    cluster2[i2][1] = res[x][1];\n                    \n                    i2++;\n                }\n            }\n            \n            \/\/Store the previous mean\n            temp1[0][0] = mean1[0][0];\n            temp1[0][1] = mean1[0][1];\n            temp2[0][0] = mean2[0][0];\n            temp2[0][1] = mean2[0][1];\n            \n            \/\/Find the new mean for new partitions\n            sum11 = 0; sum12 = 0; sum21 = 0; sum22 = 0;\n\n            for(x=0;x&lt;i1;x++) {\n                sum11 += cluster1[x][0];\n                sum12 += cluster1[x][1];\n            }\n            for(x=0;x&lt;i2;x++) {\n                sum21 += cluster2[x][0];\n                sum22 += cluster2[x][1];\n            }\n            mean1[0][0] = (float)sum11\/i1;\n            mean1[0][1] = (float)sum12\/i1;\n            mean2[0][0] = (float)sum21\/i2;\n            mean2[0][1] = (float)sum22\/i2;\n            \n            itr++;\n        }\n        \n        System.out.println(\"Cluster1:\");\n        for(x=0;x&lt;i1;x++) {\n            System.out.println(cluster1[x][0]+\" \"+cluster1[x][1]);\n        }\n        System.out.println(\"nCluster2:\");\n        for(x=0;x&lt;i2;x++) {\n            System.out.println(cluster2[x][0]+\" \"+cluster2[x][1]);\n        }\n        System.out.println(\"nFinal Mean: \");\n        System.out.println(\"Mean1 : \"+mean1[0][0]+\" \"+mean1[0][1]);\n        System.out.println(\"Mean2 : \"+mean2[0][0]+\" \"+mean2[0][1]);\n        System.out.println(\"nTotal Iterations: \"+itr);<\/code><\/pre>\n<\/div>\n<h2>\u30b3\u30fc\u30c9\u3092\u30b3\u30f3\u30d1\u30a4\u30eb\u3057\u5b9f\u884c\u3059\u308b<\/h2>\n<p>\u307e\u305a\u3001<code>gsadm<\/code>\u30e6\u30fc\u30b6\u3067\u30ed\u30b0\u30a4\u30f3\u3057\u307e\u3059\u3002\u4f5c\u6210\u3057\u305f<code>.java<\/code>\u30d5\u30a1\u30a4\u30eb\u3092\u3001\u4ee5\u4e0b\u306e\u30d1\u30b9\u306b\u3042\u308bGridDB\u306e<code>bin<\/code>\u30d5\u30a9\u30eb\u30c0\u306b\u79fb\u52d5\u3057\u307e\u3059\u3002<\/p>\n<p>\/griddb_4.6.0-1_amd64\/usr\/griddb-4.6.0\/bin<\/p>\n<p>\u6b21\u306b\u3001Linux\u306e\u30bf\u30fc\u30df\u30ca\u30eb\u3067\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3001gridstore.jar\u30d5\u30a1\u30a4\u30eb\u306e\u30d1\u30b9\u3092\u8a2d\u5b9a\u3057\u307e\u3059\u3002<\/p>\n<pre><code>export CLASSPATH=$CLASSPATH:\/home\/osboxes\/Downloads\/griddb_4.6.0-1_amd64\/usr\/griddb-4.6.0\/bin\/gridstore.jar\n<\/code><\/pre>\n<p>\u6b21\u306b\u3001\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u3001<code>.java<\/code>\u30d5\u30a1\u30a4\u30eb\u3092\u30b3\u30f3\u30d1\u30a4\u30eb\u3057\u307e\u3059\u3002<\/p>\n<pre><code>javac Kmeans.java\n<\/code><\/pre>\n<p>\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u751f\u6210\u3055\u308c\u305f.class\u30d5\u30a1\u30a4\u30eb\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002<\/p>\n<pre><code>java Kmeans\n<\/code><\/pre>\n<p>\u3053\u306e\u30b3\u30fc\u30c9\u3067\u306f\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u30012\u3064\u306e\u30af\u30e9\u30b9\u30bf\u30fc\u305d\u308c\u305e\u308c\u306b\u30af\u30e9\u30b9\u30bf\u30ea\u30f3\u30b0\u3055\u308c\u305f\u30c7\u30fc\u30bf\u30dd\u30a4\u30f3\u30c8\u3001\u5404\u30af\u30e9\u30b9\u30bf\u30fc\u306e\u5e73\u5747\u5024\u3001\u304a\u3088\u3073\u5b9f\u884c\u3055\u308c\u305f\u53cd\u5fa9\u56de\u6570\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002\u540c\u3058\u30af\u30e9\u30b9\u30bf\u30fc\u306b\u5165\u308c\u3089\u308c\u305f\u30c7\u30fc\u30bf\u30dd\u30a4\u30f3\u30c8\u306f\u3001\u4ed6\u306e\u30af\u30e9\u30b9\u30bf\u30fc\u306b\u5165\u308c\u3089\u308c\u305f\u30c7\u30fc\u30bf\u30dd\u30a4\u30f3\u30c8\u3088\u308a\u3082\u4e92\u3044\u306b\u4f3c\u3066\u3044\u308b\u3053\u3068\u304c\u308f\u304b\u308a\u307e\u3059\u3002<\/p>\n<pre><code>Number of clusters: 2\nCluster1:\n15 39\n16 6\n17 40\n18 6\n19 3\n\nCluster2:\n15 89\n16 77\n17 76\n18 94\n19 72\n\nFinal Mean: \nMean1 : 17.0 18.8\nMean2 : 17.0 81.6\n\nTotal Iterations: 2\n<\/code><\/pre>\n<p>\u3053\u308c\u3067\u5b8c\u4e86\u3067\u3059\u3002\u4ee5\u4e0a\u3001Java\u3068GridDB\u3092\u4f7f\u3063\u305fK-Means\u30a2\u30eb\u30b4\u30ea\u30ba\u30e0\u306e\u5b9f\u88c5\u65b9\u6cd5\u306b\u3064\u3044\u3066\u8aac\u660e\u3057\u307e\u3057\u305f\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u306f\u3058\u3081\u306b \u30af\u30e9\u30b9\u30bf\u30ea\u30f3\u30b0\u306f\u30c7\u30fc\u30bf\u30de\u30a4\u30cb\u30f3\u30b0\u306e\u4ee3\u8868\u7684\u306a\u30bf\u30b9\u30af\u3067\u3059\u3002\u3053\u306e\u30bf\u30b9\u30af\u3067\u306f\u3001\u30c7\u30fc\u30bf\u30a2\u30a4\u30c6\u30e0\u3092\u3044\u304f\u3064\u304b\u306e\u610f\u5473\u306e\u3042\u308b\u30b0\u30eb\u30fc\u30d7\u307e\u305f\u306f\u30af\u30e9\u30b9\u30bf\u306b\u5206\u5272\u3057\u307e\u3059\u3002\u30af\u30e9\u30b9\u30bf\u30ea\u30f3\u30b0\u306f\u3001\u30c7\u30fc\u30bf\u30a2\u30a4\u30c6\u30e0\u9593\u306e\u57fa\u672c\u7684\u306a\u95a2\u4fc2\u3092\u7279\u5b9a\u3059\u308b\u306e\u306b\u5f79\u7acb\u3061 [&hellip;]<\/p>\n","protected":false},"author":41,"featured_media":50232,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1005],"tags":[],"class_list":["post-50762","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-1005"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.1.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Java\u3068GridDB\u3092\u4f7f\u3063\u305fK-Means\u30a2\u30eb\u30b4\u30ea\u30ba\u30e0\u306e\u5b9f\u88c5\u65b9\u6cd5 | GridDB: Open Source Time Series Database for IoT<\/title>\n<meta name=\"description\" content=\"\u306f\u3058\u3081\u306b\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/griddb.net\/ja\/\u672a\u5206\u985e\/how-to-implement-the-k-means-algorithm-using-java-and-griddb\/\" \/>\n<meta property=\"og:locale\" content=\"ja_JP\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Java\u3068GridDB\u3092\u4f7f\u3063\u305fK-Means\u30a2\u30eb\u30b4\u30ea\u30ba\u30e0\u306e\u5b9f\u88c5\u65b9\u6cd5 | GridDB: Open Source Time Series Database for IoT\" \/>\n<meta property=\"og:description\" content=\"\u306f\u3058\u3081\u306b\" \/>\n<meta property=\"og:url\" content=\"https:\/\/griddb.net\/ja\/\u672a\u5206\u985e\/how-to-implement-the-k-means-algorithm-using-java-and-griddb\/\" \/>\n<meta property=\"og:site_name\" content=\"GridDB: Open Source Time Series Database for IoT\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/griddbcommunity\/\" \/>\n<meta property=\"article:published_time\" content=\"2021-09-10T07:00:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-11-14T15:54:52+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/griddb.net\/wp-content\/uploads\/2021\/09\/k-means1.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1160\" \/>\n\t<meta property=\"og:image:height\" content=\"653\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"griddb-admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@GridDBCommunity\" \/>\n<meta name=\"twitter:site\" content=\"@GridDBCommunity\" \/>\n<meta name=\"twitter:label1\" content=\"\u57f7\u7b46\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"griddb-admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u63a8\u5b9a\u8aad\u307f\u53d6\u308a\u6642\u9593\" \/>\n\t<meta name=\"twitter:data2\" content=\"3\u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/how-to-implement-the-k-means-algorithm-using-java-and-griddb\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/how-to-implement-the-k-means-algorithm-using-java-and-griddb\/\"},\"author\":{\"name\":\"griddb-admin\",\"@id\":\"https:\/\/griddb.net\/en\/#\/schema\/person\/4fe914ca9576878e82f5e8dd3ba52233\"},\"headline\":\"Java\u3068GridDB\u3092\u4f7f\u3063\u305fK-Means\u30a2\u30eb\u30b4\u30ea\u30ba\u30e0\u306e\u5b9f\u88c5\u65b9\u6cd5\",\"datePublished\":\"2021-09-10T07:00:00+00:00\",\"dateModified\":\"2025-11-14T15:54:52+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/how-to-implement-the-k-means-algorithm-using-java-and-griddb\/\"},\"wordCount\":58,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/griddb.net\/en\/#organization\"},\"image\":{\"@id\":\"https:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/how-to-implement-the-k-means-algorithm-using-java-and-griddb\/#primaryimage\"},\"thumbnailUrl\":\"\/wp-content\/uploads\/2021\/09\/k-means1.png\",\"inLanguage\":\"ja\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/how-to-implement-the-k-means-algorithm-using-java-and-griddb\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/how-to-implement-the-k-means-algorithm-using-java-and-griddb\/\",\"url\":\"https:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/how-to-implement-the-k-means-algorithm-using-java-and-griddb\/\",\"name\":\"Java\u3068GridDB\u3092\u4f7f\u3063\u305fK-Means\u30a2\u30eb\u30b4\u30ea\u30ba\u30e0\u306e\u5b9f\u88c5\u65b9\u6cd5 | GridDB: Open Source Time Series Database for IoT\",\"isPartOf\":{\"@id\":\"https:\/\/griddb.net\/en\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/how-to-implement-the-k-means-algorithm-using-java-and-griddb\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/how-to-implement-the-k-means-algorithm-using-java-and-griddb\/#primaryimage\"},\"thumbnailUrl\":\"\/wp-content\/uploads\/2021\/09\/k-means1.png\",\"datePublished\":\"2021-09-10T07:00:00+00:00\",\"dateModified\":\"2025-11-14T15:54:52+00:00\",\"description\":\"\u306f\u3058\u3081\u306b\",\"inLanguage\":\"ja\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/how-to-implement-the-k-means-algorithm-using-java-and-griddb\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/how-to-implement-the-k-means-algorithm-using-java-and-griddb\/#primaryimage\",\"url\":\"\/wp-content\/uploads\/2021\/09\/k-means1.png\",\"contentUrl\":\"\/wp-content\/uploads\/2021\/09\/k-means1.png\",\"width\":1160,\"height\":653},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/griddb.net\/en\/#website\",\"url\":\"https:\/\/griddb.net\/en\/\",\"name\":\"GridDB: Open Source Time Series Database for IoT\",\"description\":\"GridDB is an open source time-series database with the performance of NoSQL and convenience of SQL\",\"publisher\":{\"@id\":\"https:\/\/griddb.net\/en\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/griddb.net\/en\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"ja\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/griddb.net\/en\/#organization\",\"name\":\"Fixstars\",\"url\":\"https:\/\/griddb.net\/en\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\/\/griddb.net\/en\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/griddb.net\/wp-content\/uploads\/2019\/04\/fixstars_logo_web_tagline.png\",\"contentUrl\":\"https:\/\/griddb.net\/wp-content\/uploads\/2019\/04\/fixstars_logo_web_tagline.png\",\"width\":200,\"height\":83,\"caption\":\"Fixstars\"},\"image\":{\"@id\":\"https:\/\/griddb.net\/en\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/griddbcommunity\/\",\"https:\/\/x.com\/GridDBCommunity\",\"https:\/\/www.linkedin.com\/company\/griddb-by-toshiba\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/griddb.net\/en\/#\/schema\/person\/4fe914ca9576878e82f5e8dd3ba52233\",\"name\":\"griddb-admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\/\/griddb.net\/en\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/5bceca1cafc06886a7ba873e2f0a28011a1176c4dea59709f735b63ae30d0342?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/5bceca1cafc06886a7ba873e2f0a28011a1176c4dea59709f735b63ae30d0342?s=96&d=mm&r=g\",\"caption\":\"griddb-admin\"},\"url\":\"https:\/\/griddb.net\/ja\/author\/griddb-admin\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Java\u3068GridDB\u3092\u4f7f\u3063\u305fK-Means\u30a2\u30eb\u30b4\u30ea\u30ba\u30e0\u306e\u5b9f\u88c5\u65b9\u6cd5 | GridDB: Open Source Time Series Database for IoT","description":"\u306f\u3058\u3081\u306b","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:\/\/griddb.net\/ja\/\u672a\u5206\u985e\/how-to-implement-the-k-means-algorithm-using-java-and-griddb\/","og_locale":"ja_JP","og_type":"article","og_title":"Java\u3068GridDB\u3092\u4f7f\u3063\u305fK-Means\u30a2\u30eb\u30b4\u30ea\u30ba\u30e0\u306e\u5b9f\u88c5\u65b9\u6cd5 | GridDB: Open Source Time Series Database for IoT","og_description":"\u306f\u3058\u3081\u306b","og_url":"https:\/\/griddb.net\/ja\/\u672a\u5206\u985e\/how-to-implement-the-k-means-algorithm-using-java-and-griddb\/","og_site_name":"GridDB: Open Source Time Series Database for IoT","article_publisher":"https:\/\/www.facebook.com\/griddbcommunity\/","article_published_time":"2021-09-10T07:00:00+00:00","article_modified_time":"2025-11-14T15:54:52+00:00","og_image":[{"width":1160,"height":653,"url":"https:\/\/griddb.net\/wp-content\/uploads\/2021\/09\/k-means1.png","type":"image\/png"}],"author":"griddb-admin","twitter_card":"summary_large_image","twitter_creator":"@GridDBCommunity","twitter_site":"@GridDBCommunity","twitter_misc":{"\u57f7\u7b46\u8005":"griddb-admin","\u63a8\u5b9a\u8aad\u307f\u53d6\u308a\u6642\u9593":"3\u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/how-to-implement-the-k-means-algorithm-using-java-and-griddb\/#article","isPartOf":{"@id":"https:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/how-to-implement-the-k-means-algorithm-using-java-and-griddb\/"},"author":{"name":"griddb-admin","@id":"https:\/\/griddb.net\/en\/#\/schema\/person\/4fe914ca9576878e82f5e8dd3ba52233"},"headline":"Java\u3068GridDB\u3092\u4f7f\u3063\u305fK-Means\u30a2\u30eb\u30b4\u30ea\u30ba\u30e0\u306e\u5b9f\u88c5\u65b9\u6cd5","datePublished":"2021-09-10T07:00:00+00:00","dateModified":"2025-11-14T15:54:52+00:00","mainEntityOfPage":{"@id":"https:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/how-to-implement-the-k-means-algorithm-using-java-and-griddb\/"},"wordCount":58,"commentCount":0,"publisher":{"@id":"https:\/\/griddb.net\/en\/#organization"},"image":{"@id":"https:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/how-to-implement-the-k-means-algorithm-using-java-and-griddb\/#primaryimage"},"thumbnailUrl":"\/wp-content\/uploads\/2021\/09\/k-means1.png","inLanguage":"ja","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/how-to-implement-the-k-means-algorithm-using-java-and-griddb\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/how-to-implement-the-k-means-algorithm-using-java-and-griddb\/","url":"https:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/how-to-implement-the-k-means-algorithm-using-java-and-griddb\/","name":"Java\u3068GridDB\u3092\u4f7f\u3063\u305fK-Means\u30a2\u30eb\u30b4\u30ea\u30ba\u30e0\u306e\u5b9f\u88c5\u65b9\u6cd5 | GridDB: Open Source Time Series Database for IoT","isPartOf":{"@id":"https:\/\/griddb.net\/en\/#website"},"primaryImageOfPage":{"@id":"https:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/how-to-implement-the-k-means-algorithm-using-java-and-griddb\/#primaryimage"},"image":{"@id":"https:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/how-to-implement-the-k-means-algorithm-using-java-and-griddb\/#primaryimage"},"thumbnailUrl":"\/wp-content\/uploads\/2021\/09\/k-means1.png","datePublished":"2021-09-10T07:00:00+00:00","dateModified":"2025-11-14T15:54:52+00:00","description":"\u306f\u3058\u3081\u306b","inLanguage":"ja","potentialAction":[{"@type":"ReadAction","target":["https:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/how-to-implement-the-k-means-algorithm-using-java-and-griddb\/"]}]},{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/how-to-implement-the-k-means-algorithm-using-java-and-griddb\/#primaryimage","url":"\/wp-content\/uploads\/2021\/09\/k-means1.png","contentUrl":"\/wp-content\/uploads\/2021\/09\/k-means1.png","width":1160,"height":653},{"@type":"WebSite","@id":"https:\/\/griddb.net\/en\/#website","url":"https:\/\/griddb.net\/en\/","name":"GridDB: Open Source Time Series Database for IoT","description":"GridDB is an open source time-series database with the performance of NoSQL and convenience of SQL","publisher":{"@id":"https:\/\/griddb.net\/en\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/griddb.net\/en\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"ja"},{"@type":"Organization","@id":"https:\/\/griddb.net\/en\/#organization","name":"Fixstars","url":"https:\/\/griddb.net\/en\/","logo":{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/griddb.net\/en\/#\/schema\/logo\/image\/","url":"https:\/\/griddb.net\/wp-content\/uploads\/2019\/04\/fixstars_logo_web_tagline.png","contentUrl":"https:\/\/griddb.net\/wp-content\/uploads\/2019\/04\/fixstars_logo_web_tagline.png","width":200,"height":83,"caption":"Fixstars"},"image":{"@id":"https:\/\/griddb.net\/en\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/griddbcommunity\/","https:\/\/x.com\/GridDBCommunity","https:\/\/www.linkedin.com\/company\/griddb-by-toshiba"]},{"@type":"Person","@id":"https:\/\/griddb.net\/en\/#\/schema\/person\/4fe914ca9576878e82f5e8dd3ba52233","name":"griddb-admin","image":{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/griddb.net\/en\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/5bceca1cafc06886a7ba873e2f0a28011a1176c4dea59709f735b63ae30d0342?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/5bceca1cafc06886a7ba873e2f0a28011a1176c4dea59709f735b63ae30d0342?s=96&d=mm&r=g","caption":"griddb-admin"},"url":"https:\/\/griddb.net\/ja\/author\/griddb-admin\/"}]}},"_links":{"self":[{"href":"https:\/\/griddb.net\/ja\/wp-json\/wp\/v2\/posts\/50762","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/griddb.net\/ja\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/griddb.net\/ja\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/griddb.net\/ja\/wp-json\/wp\/v2\/users\/41"}],"replies":[{"embeddable":true,"href":"https:\/\/griddb.net\/ja\/wp-json\/wp\/v2\/comments?post=50762"}],"version-history":[{"count":1,"href":"https:\/\/griddb.net\/ja\/wp-json\/wp\/v2\/posts\/50762\/revisions"}],"predecessor-version":[{"id":51596,"href":"https:\/\/griddb.net\/ja\/wp-json\/wp\/v2\/posts\/50762\/revisions\/51596"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/griddb.net\/ja\/wp-json\/wp\/v2\/media\/50232"}],"wp:attachment":[{"href":"https:\/\/griddb.net\/ja\/wp-json\/wp\/v2\/media?parent=50762"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/griddb.net\/ja\/wp-json\/wp\/v2\/categories?post=50762"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/griddb.net\/ja\/wp-json\/wp\/v2\/tags?post=50762"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}