{"id":19545748,"url":"https://github.com/ekojs/ejs_k-means","last_synced_at":"2026-02-02T21:42:37.873Z","repository":{"id":89321277,"uuid":"81446148","full_name":"ekojs/ejs_k-means","owner":"ekojs","description":"Penerapan K-Means Clustering pada Javascript","archived":false,"fork":false,"pushed_at":"2017-03-16T09:46:05.000Z","size":593,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-08T07:16:43.041Z","etag":null,"topics":["clustering","clustering-algorithm","data-mining-algorithms","data-science","k-means"],"latest_commit_sha":null,"homepage":null,"language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ekojs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-02-09T12:04:41.000Z","updated_at":"2017-03-16T08:38:40.000Z","dependencies_parsed_at":null,"dependency_job_id":"3e68ba14-cb87-48f0-878a-bf8d34d0c10a","html_url":"https://github.com/ekojs/ejs_k-means","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ekojs/ejs_k-means","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ekojs%2Fejs_k-means","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ekojs%2Fejs_k-means/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ekojs%2Fejs_k-means/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ekojs%2Fejs_k-means/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ekojs","download_url":"https://codeload.github.com/ekojs/ejs_k-means/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ekojs%2Fejs_k-means/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29021031,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-02T18:51:31.335Z","status":"ssl_error","status_checked_at":"2026-02-02T18:49:20.777Z","response_time":58,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["clustering","clustering-algorithm","data-mining-algorithms","data-science","k-means"],"created_at":"2024-11-11T03:40:56.224Z","updated_at":"2026-02-02T21:42:37.847Z","avatar_url":"https://github.com/ekojs.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"## K-Means Clustering Algorithm\n\n### Penerapan K-Means Clustering pada Javascript\n\n\n### Cara melakukan Test Training pada [`ejs_kmeans.js`](https://github.com/ekojs/machine_learning/blob/master/unsupervised/ejs_kmeans.js)\n\n#### 1 - Create file tes.js pada folder yg sama dengan file ejs_k-means.js\n```javascript\nvar ejs_kmeans = require('./ejs_kmeans');\nfunction TestData(samples,centroid){\n\tconsole.log('Samples Data : %s \\n','('+samples.join(') (')+')');\n\tvar k_means = new ejs_kmeans.k_mean_cluster(samples);\n\tk_means.initialize(centroid);\n\tk_means.calculate();\n\tconsole.log(k_means.result().replace(/\u003cbr \\/\u003e/g,\"\\n\").replace(/\u0026nbsp;/g,' ').replace(/\u003c\\/?strong\u003e/g,''));\n}\n\nTestData([[5.09,5.80], [3.24,5.90], [1.68,4.90], [1.00,3.17], [1.48,1.38], [2.91,0.20], [4.76,0.10], [6.32,1.10], [7.00,2.83], [6.52,4.62]],[[1.48,1.38],[4.76,0.10]]);\n//TestData([[5.09,5.80], [3.24,5.90], [1.68,4.90], [1.00,3.17], [1.48,1.38], [2.91,0.20], [4.76,0.10], [6.32,1.10], [7.00,2.83], [6.52,4.62]],[[5.09,5.80], [3.24,5.90]]);\n//TestData([[1.0,1.0],[1.5,2.0],[3.0,4.0],[5.0,7.0],[3.5,5.0],[4.5,5.0],[3.5,4.5]],[[1,1],[5,7]]);\n//TestData([[1,1],[2,1],[4,3],[5,4]],[[1,1],[2,1]]);\n//TestData([[1,1,2],[2,1,3],[4,3,2],[5,4,4],[4,4,4]],[[1,1,2],[2,1,3]]);\n//TestData([[5.09,5.80], [3.24,5.90], [1.68,4.90], [1.00,3.17], [1.48,1.38], [2.91,0.20], [4.76,0.10], [6.32,1.10], [7.00,2.83], [6.52,4.62]],[[5.09,5.80], [3.24,5.90], [1.68,4.90]]);\n```\n\n#### 3 - Eksekusi langsung\n```javascript\nnode tes.js\n```\n\n#### 4 - Hasilnya kurang lebih akan seperti ini\n```javascript\nSamples Data : (5.09,5.8) (3.24,5.9) (1.68,4.9) (1,3.17) (1.48,1.38) (2.91,0.2) (4.76,0.1) (6.32,1.1) (7,2.83) (6.52,4.62)\n\nCentroids initialized at:\n     (1.48,1.38)\n     (4.76,0.1)\n\n\nCluster 0 includes:\n     (5.09,5.8)\n     (3.24,5.9)\n     (1.68,4.9)\n     (1,3.17)\n     (1.48,1.38)\n\n\nCluster 1 includes:\n     (2.91,0.2)\n     (4.76,0.1)\n     (6.32,1.1)\n     (7,2.83)\n     (6.52,4.62)\n\n\nCentroids finalized at:\n     (2.498,4.23)\n     (5.502000000000001,1.7700000000000002)\n```\n\n\n#### Note:\nBaca artikel pada [`K-Means Clustering Algorithm`](http://ekojunaidisalam.com/2017/02/09/k-means-clustering-algorithm/)\n\nSimulasi program di [`sini`](https://ekojs.github.io/ejs_k-means/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fekojs%2Fejs_k-means","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fekojs%2Fejs_k-means","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fekojs%2Fejs_k-means/lists"}