{"id":13564055,"url":"https://github.com/muesli/silhouette","last_synced_at":"2025-05-07T11:20:21.681Z","repository":{"id":57534231,"uuid":"136219308","full_name":"muesli/silhouette","owner":"muesli","description":"Silhouette cluster analysis implementation in Go","archived":false,"fork":false,"pushed_at":"2019-09-18T00:29:19.000Z","size":18,"stargazers_count":11,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-31T09:21:54.347Z","etag":null,"topics":["hacktoberfest"],"latest_commit_sha":null,"homepage":null,"language":"Go","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/muesli.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}},"created_at":"2018-06-05T18:35:56.000Z","updated_at":"2021-11-12T00:24:20.000Z","dependencies_parsed_at":"2022-09-26T18:21:31.183Z","dependency_job_id":null,"html_url":"https://github.com/muesli/silhouette","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muesli%2Fsilhouette","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muesli%2Fsilhouette/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muesli%2Fsilhouette/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muesli%2Fsilhouette/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/muesli","download_url":"https://codeload.github.com/muesli/silhouette/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252865972,"owners_count":21816371,"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":["hacktoberfest"],"created_at":"2024-08-01T13:01:26.055Z","updated_at":"2025-05-07T11:20:21.658Z","avatar_url":"https://github.com/muesli.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"# silhouette\nSilhouette cluster analysis implementation in Go\n\n## What It Does\n\nSilhouette refers to an [algorithm](https://en.wikipedia.org/wiki/Silhouette_(clustering))\nused to interpret and validate the consistency within clusters of data.\n\nThe silhouette value is a measure of how similar an object is to its own cluster\ncompared to other clusters. The silhouette ranges from −1 to +1, where a high\nvalue indicates that the object is well matched to its own cluster and poorly\nmatched to neighboring clusters.\n\nIf most objects have a high value, then the clustering configuration is\nappropriate. If many points have a low or negative value, then the clustering\nconfiguration may have too many or too few clusters.\n\n## When You Should Use It\n\n- When you have numeric, multi-dimensional data sets\n- If you want to check whether your data set is clustered\n- When you have a vague idea of the clustering in your data set\n- You want to figure out the optimal clustering configuration\n\n## Example\n```go\nimport (\n    \"github.com/muesli/silhouette\"\n    \"github.com/muesli/clusters\"\n    \"github.com/muesli/kmeans\"\n)\n\n// initialize your data set\n// for the example we'll use three distinct clusters of data points\nvar d clusters.Observations\nfor x := 0; x \u003c 64; x++ {\n\td = append(d, clusters.Coordinates{\n\t\trand.Float64() * 0.1,\n\t\trand.Float64() * 0.1,\n\t})\n}\nfor x := 0; x \u003c 64; x++ {\n\td = append(d, clusters.Coordinates{\n\t\t0.5 + rand.Float64()*0.1,\n\t\t0.5 + rand.Float64()*0.1,\n\t})\n}\nfor x := 0; x \u003c 64; x++ {\n\td = append(d, clusters.Coordinates{\n\t\t0.9 + rand.Float64()*0.1,\n\t\t0.9 + rand.Float64()*0.1,\n\t})\n}\n\n// silhouette will theoretically work with multiple clustering algorithms\n// it's commonly used with k-means\nkm := kmeans.New()\n\n// compute the average silhouette score (coefficient) for 2 to 8 clusters, using\n// the k-means clustering algorithm\nscores, err := silhouette.Scores(d, 8, km)\nfor _, s := range scores {\n    fmt.Printf(\"k: %d (score: %.2f)\\n\", s.K, s.Score)\n}\n\n// estimate the amount of clusters in our data set\n// this returns the k with the highest score (where 2 \u003c= k \u003c= 8)\nk, score, err := silhouette.EstimateK(d, 8, km)\n\n// k is usually 3 for this example, with a score close to 1.0\n// note that k-means doesn't always converge optimally\n...\n}\n```\n\n## Development\n\n[![GoDoc](https://godoc.org/github.com/golang/gddo?status.svg)](https://godoc.org/github.com/muesli/silhouette)\n[![Build Status](https://travis-ci.org/muesli/silhouette.svg?branch=master)](https://travis-ci.org/muesli/silhouette)\n[![Coverage Status](https://coveralls.io/repos/github/muesli/silhouette/badge.svg?branch=master)](https://coveralls.io/github/muesli/silhouette?branch=master)\n[![Go ReportCard](http://goreportcard.com/badge/muesli/silhouette)](http://goreportcard.com/report/muesli/silhouette)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmuesli%2Fsilhouette","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmuesli%2Fsilhouette","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmuesli%2Fsilhouette/lists"}