{"id":15288191,"url":"https://github.com/dayyass/graph-based-clustering","last_synced_at":"2026-03-03T21:01:58.076Z","repository":{"id":46951527,"uuid":"407251542","full_name":"dayyass/graph-based-clustering","owner":"dayyass","description":"Graph-Based Clustering using connected components and spanning trees.","archived":false,"fork":false,"pushed_at":"2021-11-01T19:27:42.000Z","size":402,"stargazers_count":28,"open_issues_count":6,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-26T02:50:59.509Z","etag":null,"topics":["clustering","data-science","graph","graph-algorithms","hacktoberfest","machine-learning","python","sklearn"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/graph-based-clustering/","language":"Jupyter Notebook","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/dayyass.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":"2021-09-16T17:13:29.000Z","updated_at":"2025-08-22T20:05:59.000Z","dependencies_parsed_at":"2022-09-26T21:40:17.320Z","dependency_job_id":null,"html_url":"https://github.com/dayyass/graph-based-clustering","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/dayyass/graph-based-clustering","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dayyass%2Fgraph-based-clustering","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dayyass%2Fgraph-based-clustering/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dayyass%2Fgraph-based-clustering/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dayyass%2Fgraph-based-clustering/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dayyass","download_url":"https://codeload.github.com/dayyass/graph-based-clustering/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dayyass%2Fgraph-based-clustering/sbom","scorecard":{"id":328466,"data":{"date":"2025-08-11","repo":{"name":"github.com/dayyass/graph-based-clustering","commit":"b5ac8730dc657698b90493f8c726204aa96517dd"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/6 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codecov.yml:19: update your workflow using https://app.stepsecurity.io/secureworkflow/dayyass/graph-based-clustering/codecov.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codecov.yml:21: update your workflow using https://app.stepsecurity.io/secureworkflow/dayyass/graph-based-clustering/codecov.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/codecov.yml:33: update your workflow using https://app.stepsecurity.io/secureworkflow/dayyass/graph-based-clustering/codecov.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/linter.yml:19: update your workflow using https://app.stepsecurity.io/secureworkflow/dayyass/graph-based-clustering/linter.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/linter.yml:21: update your workflow using https://app.stepsecurity.io/secureworkflow/dayyass/graph-based-clustering/linter.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/tests.yml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/dayyass/graph-based-clustering/tests.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/tests.yml:22: update your workflow using https://app.stepsecurity.io/secureworkflow/dayyass/graph-based-clustering/tests.yml/main?enable=pin","Warn: pipCommand not pinned by hash: .github/workflows/codecov.yml:26","Warn: pipCommand not pinned by hash: .github/workflows/codecov.yml:27","Warn: pipCommand not pinned by hash: .github/workflows/codecov.yml:28","Warn: pipCommand not pinned by hash: .github/workflows/linter.yml:26","Warn: pipCommand not pinned by hash: .github/workflows/linter.yml:27","Warn: pipCommand not pinned by hash: .github/workflows/tests.yml:27","Warn: pipCommand not pinned by hash: .github/workflows/tests.yml:28","Info:   0 out of   6 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 third-party GitHubAction dependencies pinned","Info:   0 out of   7 pipCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/codecov.yml:1","Warn: no topLevel permission defined: .github/workflows/linter.yml:1","Warn: no topLevel permission defined: .github/workflows/tests.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":5,"reason":"5 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-fpfv-jqm9-f5jm","Warn: Project is vulnerable to: PYSEC-2024-110 / GHSA-jw8x-6495-233v","Warn: Project is vulnerable to: GHSA-jxfp-4rvq-9h9m","Warn: Project is vulnerable to: PYSEC-2023-102","Warn: Project is vulnerable to: PYSEC-2023-114"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 26 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-18T03:02:25.834Z","repository_id":46951527,"created_at":"2025-08-18T03:02:25.834Z","updated_at":"2025-08-18T03:02:25.834Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30060631,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-03T18:21:05.932Z","status":"ssl_error","status_checked_at":"2026-03-03T18:20:59.341Z","response_time":61,"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","data-science","graph","graph-algorithms","hacktoberfest","machine-learning","python","sklearn"],"created_at":"2024-09-30T15:44:38.016Z","updated_at":"2026-03-03T21:01:58.050Z","avatar_url":"https://github.com/dayyass.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![tests](https://github.com/dayyass/graph-based-clustering/actions/workflows/tests.yml/badge.svg)](https://github.com/dayyass/graph-based-clustering/actions/workflows/tests.yml)\n[![linter](https://github.com/dayyass/graph-based-clustering/actions/workflows/linter.yml/badge.svg)](https://github.com/dayyass/graph-based-clustering/actions/workflows/linter.yml)\n[![codecov](https://codecov.io/gh/dayyass/graph-based-clustering/branch/main/graph/badge.svg?token=ZVR4C5SRON)](https://codecov.io/gh/dayyass/graph-based-clustering)\n\n[![python 3.7](https://img.shields.io/badge/python-3.7-blue.svg)](https://github.com/dayyass/graph-based-clustering#requirements)\n[![release (latest by date)](https://img.shields.io/github/v/release/dayyass/graph-based-clustering)](https://github.com/dayyass/graph-based-clustering/releases/latest)\n[![license](https://img.shields.io/github/license/dayyass/graph-based-clustering?color=blue)](https://github.com/dayyass/graph-based-clustering/blob/main/LICENSE)\n\n[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-black)](https://github.com/dayyass/graph-based-clustering/blob/main/.pre-commit-config.yaml)\n[![code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n\n[![pypi version](https://img.shields.io/pypi/v/graph-based-clustering)](https://pypi.org/project/graph-based-clustering)\n[![pypi downloads](https://img.shields.io/pypi/dm/graph-based-clustering)](https://pypi.org/project/graph-based-clustering)\n\n### Graph-Based Clustering\n\nGraph-Based Clustering using connected components and minimum spanning trees.\n\nBoth clustering methods, supported by this library, are **transductive** - meaning they are not designed to be applied to new, unseen data.\n\n### Installation\n\nTo install **graph-based-clustering** run:\n```\npip install graph-based-clustering\n```\n\n### Usage\n\nThe library has sklearn-like `fit/fit_predict` interface.\n\n#### ConnectedComponentsClustering\n\nThis method computes pairwise distances matrix on the input data, and using *threshold* (parameter provided by the user) to binarize pairwise distances matrix makes an undirected graph in order to find connected components to perform the clustering.\n\nRequired arguments:\n- **threshold** - paremeter to binarize pairwise distances matrix and make undirected graph\n\nOptional arguments:\n- **metric** - sklearn.metrics.[pairwise_distances](https://scikit-learn.org/stable/modules/generated/sklearn.metrics.pairwise_distances.html) parameter (default: *\"euclidean\"*)\n- **n_jobs** - sklearn.metrics.[pairwise_distances](https://scikit-learn.org/stable/modules/generated/sklearn.metrics.pairwise_distances.html) parameter (default: *None*)\n\nExample:\n\n```python3\nimport numpy as np\nfrom graph_based_clustering import ConnectedComponentsClustering\n\nX = np.array([[0, 1], [1, 0], [1, 1]])\n\nclustering = ConnectedComponentsClustering(\n    threshold=0.275,\n    metric=\"euclidean\",\n    n_jobs=-1,\n)\n\nclustering.fit(X)\nlabels_pred = clustering.labels_\n\n# alternative\nlabels_pred = clustering.fit_predict(X)\n```\n\n#### SpanTreeConnectedComponentsClustering\n\nThis method computes pairwise distances matrix on the input data, builds a graph on the obtained matrix, finds minimum spanning tree, and finaly, performs the clustering through dividing the graph into *n_clusters* (parameter given by the user) by removing *n-1* edges with the highest weights.\n\nRequired arguments:\n- **n_clusters** - the number of clusters to find\n\nOptional arguments:\n- **metric** - sklearn.metrics.[pairwise_distances](https://scikit-learn.org/stable/modules/generated/sklearn.metrics.pairwise_distances.html) parameter (default: *\"euclidean\"*)\n- **n_jobs** - sklearn.metrics.[pairwise_distances](https://scikit-learn.org/stable/modules/generated/sklearn.metrics.pairwise_distances.html) parameter (default: *None*)\n\nExample:\n\n```python3\nimport numpy as np\nfrom graph_based_clustering import SpanTreeConnectedComponentsClustering\n\nX = np.array([[0, 1], [1, 0], [1, 1]])\n\nclustering = SpanTreeConnectedComponentsClustering(\n    n_clusters=3,\n    metric=\"euclidean\",\n    n_jobs=-1,\n)\n\nclustering.fit(X)\nlabels_pred = clustering.labels_\n\n# alternative\nlabels_pred = clustering.fit_predict(X)\n```\n\n### Comparing on sklearn toy datasets\n\n#### ConnectedComponentsClustering\n\n![ConnectedComponentsClustering](notebooks/images/ConnectedComponentsClustering.png \"ConnectedComponentsClustering\")\u003cbr/\u003e\n\n#### SpanTreeConnectedComponentsClustering\n\n![SpanTreeConnectedComponentsClustering](notebooks/images/SpanTreeConnectedComponentsClustering.png \"SpanTreeConnectedComponentsClustering\")\u003cbr/\u003e\n\n### Requirements\nPython \u003e= 3.7\n\n### Citation\nIf you use **graph-based-clustering** in a scientific publication, we would appreciate references to the following BibTex entry:\n```bibtex\n@misc{dayyass2021graphbasedclustering,\n    author       = {El-Ayyass, Dani},\n    title        = {Graph-Based Clustering using connected components and spanning trees},\n    howpublished = {\\url{https://github.com/dayyass/graph-based-clustering}},\n    year         = {2021}\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdayyass%2Fgraph-based-clustering","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdayyass%2Fgraph-based-clustering","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdayyass%2Fgraph-based-clustering/lists"}