{"id":15063965,"url":"https://github.com/inoueakimitsu/clustermil","last_synced_at":"2026-02-09T09:03:43.453Z","repository":{"id":44646307,"uuid":"420438670","full_name":"inoueakimitsu/clustermil","owner":"inoueakimitsu","description":"clustering based multiple instance learning","archived":false,"fork":false,"pushed_at":"2022-07-23T23:58:11.000Z","size":14,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-13T03:33:10.913Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","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/inoueakimitsu.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-10-23T14:42:24.000Z","updated_at":"2024-03-05T14:52:19.000Z","dependencies_parsed_at":"2022-07-31T01:07:46.974Z","dependency_job_id":null,"html_url":"https://github.com/inoueakimitsu/clustermil","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/inoueakimitsu/clustermil","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inoueakimitsu%2Fclustermil","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inoueakimitsu%2Fclustermil/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inoueakimitsu%2Fclustermil/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inoueakimitsu%2Fclustermil/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/inoueakimitsu","download_url":"https://codeload.github.com/inoueakimitsu/clustermil/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inoueakimitsu%2Fclustermil/sbom","scorecard":{"id":489411,"data":{"date":"2025-08-11","repo":{"name":"github.com/inoueakimitsu/clustermil","commit":"ce2b7c1f978914202e134cb8e2151eab4d39443e"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.7,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/5 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":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"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":"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":"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":"Dangerous-Workflow","score":-1,"reason":"no workflows found","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":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"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":"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":"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":"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":"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":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 8 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"}},{"name":"Vulnerabilities","score":0,"reason":"11 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: PYSEC-2018-34 / GHSA-2fc2-6r4j-p65h","Warn: Project is vulnerable to: PYSEC-2021-856 / GHSA-5545-2q6w-2gh6","Warn: Project is vulnerable to: PYSEC-2019-108 / GHSA-9fq2-x9r6-wfmf","Warn: Project is vulnerable to: PYSEC-2018-33 / GHSA-cw6w-4rcx-xphc","Warn: Project is vulnerable to: PYSEC-2021-857 / GHSA-f7c7-j99h-c22f","Warn: Project is vulnerable to: GHSA-fpfv-jqm9-f5jm","Warn: Project is vulnerable to: PYSEC-2017-1 / GHSA-frgw-fgh6-9g52","Warn: Project is vulnerable to: PYSEC-2020-73","Warn: Project is vulnerable to: PYSEC-2020-107 / GHSA-jjw5-xxj6-pcv5","Warn: Project is vulnerable to: PYSEC-2024-110 / GHSA-jw8x-6495-233v","Warn: Project is vulnerable to: PYSEC-2020-108"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-19T18:39:58.235Z","repository_id":44646307,"created_at":"2025-08-19T18:39:58.235Z","updated_at":"2025-08-19T18:39:58.235Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29260426,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-09T04:11:57.159Z","status":"ssl_error","status_checked_at":"2026-02-09T04:11:56.117Z","response_time":56,"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":[],"created_at":"2024-09-25T00:09:26.020Z","updated_at":"2026-02-09T09:03:43.408Z","avatar_url":"https://github.com/inoueakimitsu.png","language":"Python","readme":"# clustermil\n\n[![Build Status](https://app.travis-ci.com/inoueakimitsu/clustermil.svg?branch=main)](https://app.travis-ci.com/inoueakimitsu/clustermil)\n\u003ca href=\"https://github.com/inoueakimitsu/clustermil/issues\"\u003e\u003cimg alt=\"GitHub issues\" src=\"https://img.shields.io/github/issues/inoueakimitsu/clustermil\"\u003e\u003c/a\u003e \n\nPython package for multiple instance learning (MIL) for large n_instance dataset.\n\n## Features\n\n- support count-based multiple instance assumptions (see [wikipedia](https://en.wikipedia.org/wiki/Multiple_instance_learning#:~:text=Presence-%2C%20threshold-%2C%20and%20count-based%20assumptions%5Bedit%5D))\n- support multi-class setting\n- support scikit-learn Clustering algorithms (such as `MiniBatchKMeans`)\n- fast even if n_instance is large\n\n## Installation\n\n```bash\npip install clustermil\n```\n\n## Usage\n\n```python\n# Prepare follwing dataset\n#\n# - bags ... list of np.ndarray\n#            (num_instance_in_the_bag * num_features)\n# - lower_threshold ... np.ndarray (num_bags * num_classes)\n# - upper_threshold ... np.ndarray (num_bags * num_classes)\n#\n# bags[i_bag] contains not less than lower_thrshold[i_bag, i_class]\n# i_class instances.\n\n# Prepare single-instance clustering algorithms\nfrom sklearn.cluster import MiniBatchKMeans\nn_clusters = 100\nclustering = MiniBatchKMeans(n_clusters=n_clusters)\nclusters = clustering.fit_predict(np.vstack(bags)) # flatten bags into instances\n\n# Prepare one-hot encoder\nfrom sklearn.preprocessing import OneHotEncoder\nonehot_encoder = OneHotEncoder()\nonehot_encoder.fit(clusters)\n\n# generate ClusterMilClassifier with helper function\nfrom clustermil import generate_mil_classifier\n\nmilclassifier = generate_mil_classifier(\n            clustering,\n            onehot_encoder,\n            bags,\n            lower_threshold,\n            upper_threshold,\n            n_clusters)\n\n# after multiple instance learning,\n# you can predict instance class\nmilclassifier.predict([instance_feature])\n```\n\nSee `tests/test_classification.py` for an example of a fully working test data generation process.\n\n## License\n\nclustermil is available under the MIT License.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finoueakimitsu%2Fclustermil","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finoueakimitsu%2Fclustermil","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finoueakimitsu%2Fclustermil/lists"}