{"id":13507332,"url":"https://github.com/ayrat555/rock","last_synced_at":"2025-07-17T12:40:38.128Z","repository":{"id":57544470,"uuid":"90516783","full_name":"ayrat555/rock","owner":"ayrat555","description":"Elixir implementation of ROCK: A Robust Clustering Algorithm for Categorical Attributes","archived":false,"fork":false,"pushed_at":"2020-07-14T10:56:33.000Z","size":61,"stargazers_count":12,"open_issues_count":1,"forks_count":4,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-09T04:34:41.267Z","etag":null,"topics":["categorical-attributes","cluster","clustering","clustering-algorithm","elixir"],"latest_commit_sha":null,"homepage":null,"language":"Elixir","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/ayrat555.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2017-05-07T07:43:08.000Z","updated_at":"2025-05-06T14:48:38.000Z","dependencies_parsed_at":"2022-08-27T05:13:18.436Z","dependency_job_id":null,"html_url":"https://github.com/ayrat555/rock","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ayrat555/rock","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ayrat555%2Frock","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ayrat555%2Frock/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ayrat555%2Frock/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ayrat555%2Frock/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ayrat555","download_url":"https://codeload.github.com/ayrat555/rock/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ayrat555%2Frock/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265408454,"owners_count":23760136,"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":["categorical-attributes","cluster","clustering","clustering-algorithm","elixir"],"created_at":"2024-08-01T02:00:31.327Z","updated_at":"2025-07-17T12:40:38.094Z","avatar_url":"https://github.com/ayrat555.png","language":"Elixir","funding_links":[],"categories":["Algorithms and Data structures"],"sub_categories":[],"readme":"# ROCK\n\nROCK: A Robust Clustering Algorithm for Categorical Attributes\n\nThe algorithm's description http://theory.stanford.edu/~sudipto/mypapers/categorical.pdf\n\n## Installation\n\nThe easiest way to add Rock to your project is by [using Mix](http://elixir-lang.org/getting-started/mix-otp/introduction-to-mix.html).\n\nAdd `:rock` as a dependency to your project's `mix.exs`:\n\n```elixir\ndefp deps do\n  [\n    {:rock, \"~\u003e 0.1.2\"}\n  ]\nend\n```\n\nAnd run:\n\n    $ mix deps.get\n\n## Basic Usage\n\nTo clusterize points using the Rock algorithm you should use Rock.clusterize/4 with the arguments:\n\n  * `points`, points that will be clusterized\n  * `number_of_clusters`, the number of desired clusters.\n  * `theta`, neighborhood parameter in the range [0,1). Default value is 0.5.\n  * `similarity_function`, distance function to use. Jaccard Coefficient is used by default.\n\n```elixir\n\n  ## Examples\n\n      points =\n      [\n        {\"point1\", [\"1\", \"2\", \"3\"]},\n        {\"point2\", [\"1\", \"2\", \"4\"]},\n        {\"point3\", [\"1\", \"2\", \"5\"]},\n        {\"point4\", [\"1\", \"3\", \"4\"]},\n        {\"point5\", [\"1\", \"3\", \"5\"]},\n        {\"point6\", [\"1\", \"4\", \"5\"]},\n        {\"point7\", [\"2\", \"3\", \"4\"]},\n        {\"point8\", [\"2\", \"3\", \"5\"]},\n        {\"point9\", [\"2\", \"4\", \"5\"]},\n        {\"point10\", [\"3\", \"4\", \"5\"]},\n        {\"point11\", [\"1\", \"2\", \"6\"]},\n        {\"point12\", [\"1\", \"2\", \"7\"]},\n        {\"point13\", [\"1\", \"6\", \"7\"]},\n        {\"point14\", [\"2\", \"6\", \"7\"]}\n      ]\n\n      # Example 1\n\n      Rock.clusterize(points, 5, 0.4)\n      [\n        [\n          {\"point4\", [\"1\", \"3\", \"4\"]},\n          {\"point5\", [\"1\", \"3\", \"5\"]},\n          {\"point6\", [\"1\", \"4\", \"5\"]},\n          {\"point10\", [\"3\", \"4\", \"5\"]},\n          {\"point7\", [\"2\", \"3\", \"4\"]},\n          {\"point8\", [\"2\", \"3\", \"5\"]}\n        ],\n        [\n          {\"point11\", [\"1\", \"2\", \"6\"]},\n          {\"point12\", [\"1\", \"2\", \"7\"]},\n          {\"point1\", [\"1\", \"2\", \"3\"]},\n          {\"point2\", [\"1\", \"2\", \"4\"]},\n          {\"point3\", [\"1\", \"2\", \"5\"]}\n        ],\n        [\n          {\"point9\", [\"2\", \"4\", \"5\"]}\n        ],\n        [\n          {\"point13\", [\"1\", \"6\", \"7\"]}\n        ],\n        [\n          {\"point14\", [\"2\", \"6\", \"7\"]}\n        ]\n      ]\n\n      # Example 2 (with custom similarity function)\n\n      similarity_function = fn(\n          %Rock.Struct.Point{attributes: attributes1},\n          %Rock.Struct.Point{attributes: attributes2}) -\u003e\n\n        count1 = Enum.count(attributes1)\n        count2 = Enum.count(attributes2)\n\n        if count1 \u003e= count2, do: (count2 - 1) / count1, else: (count1 - 1) / count2\n      end\n\n      Rock.clusterize(points, 4, 0.5, similarity_function)\n      [\n        [\n          {\"point1\", [\"1\", \"2\", \"3\"]},\n          {\"point2\", [\"1\", \"2\", \"4\"]},\n          {\"point3\", [\"1\", \"2\", \"5\"]},\n          {\"point4\", [\"1\", \"3\", \"4\"]},\n          {\"point5\", [\"1\", \"3\", \"5\"]},\n          {\"point6\", [\"1\", \"4\", \"5\"]},\n          {\"point7\", [\"2\", \"3\", \"4\"]},\n          {\"point8\", [\"2\", \"3\", \"5\"]},\n          {\"point9\", [\"2\", \"4\", \"5\"]},\n          {\"point10\", [\"3\", \"4\", \"5\"]},\n          {\"point11\", [\"1\", \"2\", \"6\"]}\n        ],\n        [\n          {\"point12\", [\"1\", \"2\", \"7\"]}\n        ],\n        [\n          {\"point13\", [\"1\", \"6\", \"7\"]}\n        ],\n        [\n          {\"point14\", [\"2\", \"6\", \"7\"]}\n        ]\n      ]\n```\n\n\n## Contributing\n\n1. [Fork it!](http://github.com/ayrat555/rock/fork)\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create new Pull Request\n\n## Author\n\nAyrat Badykov (@ayrat555)\n\n## License\n\nRock is released under the MIT License. See the LICENSE file for further details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fayrat555%2Frock","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fayrat555%2Frock","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fayrat555%2Frock/lists"}