{"id":23288060,"url":"https://github.com/rhettadam/optimal-k","last_synced_at":"2026-02-19T17:01:08.911Z","repository":{"id":266939152,"uuid":"899814431","full_name":"rhettadam/Optimal-K","owner":"rhettadam","description":"Function to find the optimal number of clusters for k-means analysis using the Elbow Method","archived":false,"fork":false,"pushed_at":"2024-12-08T04:04:29.000Z","size":12,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-19T05:44:04.853Z","etag":null,"topics":["elbow-analysis","elbow-method","elbow-plot","elbow-point","kmeans-analysis","kmeans-clustering","r"],"latest_commit_sha":null,"homepage":"","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rhettadam.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-12-07T04:53:10.000Z","updated_at":"2025-04-15T01:38:41.000Z","dependencies_parsed_at":"2024-12-07T06:20:09.899Z","dependency_job_id":"47b531bf-16ab-451a-bfa8-c4f6f32ff33b","html_url":"https://github.com/rhettadam/Optimal-K","commit_stats":null,"previous_names":["rhettadam/optimal-k"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rhettadam/Optimal-K","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhettadam%2FOptimal-K","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhettadam%2FOptimal-K/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhettadam%2FOptimal-K/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhettadam%2FOptimal-K/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rhettadam","download_url":"https://codeload.github.com/rhettadam/Optimal-K/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhettadam%2FOptimal-K/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29623546,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-19T13:04:20.082Z","status":"ssl_error","status_checked_at":"2026-02-19T13:03:33.775Z","response_time":117,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":["elbow-analysis","elbow-method","elbow-plot","elbow-point","kmeans-analysis","kmeans-clustering","r"],"created_at":"2024-12-20T03:13:38.696Z","updated_at":"2026-02-19T17:01:08.874Z","avatar_url":"https://github.com/rhettadam.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Optimal-K\n\n## Overview\n`Optimal-K` is an R function to determine the optimal number of clusters in [K-Means clustering](https://www.geeksforgeeks.org/k-means-clustering-introduction/) using the [Elbow Method](https://www.geeksforgeeks.org/elbow-method-for-optimal-value-of-k-in-kmeans/). This function helps users decide the best value of `k` by identifying the elbow point on the WCSS (Within-Cluster Sum of Squares) curve.\n\n## How It Works\nThe function works by calculating the perpendicular distance of each point on the WCSS curve to the line connecting the first and last points of the curve. The point with the maximum distance is identified as the \"elbow,\" and its corresponding `k` value is returned.\n\n### Function Definition:\n```R\nfind_optimal_k(wcss_values, k_values)\n```\n\n![Screenshot 2024-12-06 231351](https://github.com/user-attachments/assets/8f8d667e-33d9-4079-ae00-a3d5d0bd241c)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frhettadam%2Foptimal-k","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frhettadam%2Foptimal-k","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frhettadam%2Foptimal-k/lists"}