{"id":19164406,"url":"https://github.com/hlsxx/k-means-rust","last_synced_at":"2025-07-05T00:36:55.028Z","repository":{"id":155101320,"uuid":"631307832","full_name":"hlsxx/k-means-rust","owner":"hlsxx","description":"The aim of this project is to implement the k-means algorithm using Rust-lang. The source code includes a parallel implementation in Rayon.","archived":false,"fork":false,"pushed_at":"2023-09-19T19:30:30.000Z","size":1992,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-22T23:12:42.774Z","etag":null,"topics":["k-means","k-means-clustering","k-means-rust","kmeans","kmeans-algorithm","kmeans-clustering","kmeans-clustering-algorithm","kmeans-rust","parallel-programming","rayon","rust","rust-lang","rust-parallel"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/hlsxx.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}},"created_at":"2023-04-22T15:54:26.000Z","updated_at":"2025-01-07T08:16:44.000Z","dependencies_parsed_at":"2023-09-19T01:00:16.759Z","dependency_job_id":"46d9dbb2-353c-436a-8435-1232fd969b4f","html_url":"https://github.com/hlsxx/k-means-rust","commit_stats":null,"previous_names":["holesxx/k-means-rust","hlsxx/k-means-rust"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/hlsxx/k-means-rust","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hlsxx%2Fk-means-rust","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hlsxx%2Fk-means-rust/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hlsxx%2Fk-means-rust/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hlsxx%2Fk-means-rust/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hlsxx","download_url":"https://codeload.github.com/hlsxx/k-means-rust/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hlsxx%2Fk-means-rust/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263640772,"owners_count":23493387,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["k-means","k-means-clustering","k-means-rust","kmeans","kmeans-algorithm","kmeans-clustering","kmeans-clustering-algorithm","kmeans-rust","parallel-programming","rayon","rust","rust-lang","rust-parallel"],"created_at":"2024-11-09T09:21:54.184Z","updated_at":"2025-07-05T00:36:55.011Z","avatar_url":"https://github.com/hlsxx.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ✨ k-means-rust\nThe aim of this project is to implement the k-means algorithm using Rust-lang. The source code includes a parallel implementation in [Rayon](https://github.com/rayon-rs/rayon).\n\nHere are some key characteristics of the K-means algorithm:\n1. Initialization: The algorithm starts by randomly selecting K cluster centroids from the dataset.\n2. Assignment: Each data point is then assigned to the nearest centroid based on the Euclidean distance metric.\n3. Update: The centroids of each cluster are updated by taking the mean of all data points assigned to that cluster.\n4. Repeat: Steps 2 and 3 are repeated until convergence, that is, until the assignment of data points to clusters no longer changes.\n5. Optimal K: The choice of K, the number of clusters, can significantly impact the clustering results, and it is often determined using heuristics or optimization techniques.\n\n## 🚀 Generate points\nIf you want to create more or fewer points, you can use the \"points_generator.rs\" file located in the \"bin\" folder. Running the command below will generate points and store them in a \"points.txt\" file within the \"inputs\" folder.\n```sh\ncargo run --bin points_generator\n```\n## ✨  Usage\nThe \"examples\" folder contains multiple implementations of the k-means algorithm, each of which differs from the others in some way.\n\n```sh\ncargon run --example parallel-iterations-2\n```\n## 🏁 Result\nThe program will generate a plot and store it in the \"outputs\" folder.\n\n![Example plot](https://github.com/Holes70/k-means-rust/blob/master/outputs/k-means.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhlsxx%2Fk-means-rust","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhlsxx%2Fk-means-rust","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhlsxx%2Fk-means-rust/lists"}